MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / path_to_uri

Function path_to_uri

crates/opencode-lsp/src/lib.rs:74–79  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

72}
73
74fn 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
81fn uri_to_path(uri: &lsp_types::Uri) -> PathBuf {
82 Url::parse(&uri.to_string())

Callers 12

initializeMethod · 0.85
open_documentMethod · 0.85
goto_definitionMethod · 0.85
completionMethod · 0.85
referencesMethod · 0.85
hoverMethod · 0.85
document_symbolMethod · 0.85
goto_implementationMethod · 0.85
type_definitionMethod · 0.85
renameMethod · 0.85
flatten_document_symbolFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected