(path: &Path)
| 72 | } |
| 73 | |
| 74 | fn path_to_uri(path: &Path) -> Result<lsp_types::Uri, LspError> { |
| 75 | let url = Url::from_file_path(path) |
| 76 | .map_err(|_| LspError::InitializeError("Invalid file path".to_string()))?; |
| 77 | lsp_types::Uri::from_str(url.as_str()) |
| 78 | .map_err(|e| LspError::InitializeError(format!("Invalid URI: {}", e))) |
| 79 | } |
| 80 | |
| 81 | fn uri_to_path(uri: &lsp_types::Uri) -> PathBuf { |
| 82 | Url::parse(&uri.to_string()) |
no test coverage detected