We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 998631f commit aba1226Copy full SHA for aba1226
internal/lsp/server_test.go
@@ -16,9 +16,15 @@ import (
16
// pathToFileURI converts a file path to a proper file:// URI that works on all platforms.
17
// On Windows, this properly handles drive letters (e.g., C:\path -> file:///C:/path).
18
func pathToFileURI(path string) string {
19
+ // Convert to forward slashes
20
+ path = filepath.ToSlash(path)
21
+ // On Windows, absolute paths like "C:/path" need a leading slash for proper file URIs
22
+ if len(path) >= 2 && path[1] == ':' {
23
+ path = "/" + path
24
+ }
25
u := url.URL{
26
Scheme: "file",
- Path: filepath.ToSlash(path),
27
+ Path: path,
28
}
29
return u.String()
30
0 commit comments