Skip to content

Commit 34c6c15

Browse files
authored
Fix URI un-escaping on Windows (#823)
1 parent 9e35174 commit 34c6c15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/ls/converters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func DocumentURIToFileName(uri lsproto.DocumentUri) string {
163163
if len(path) >= 4 {
164164
if nextSlash := strings.IndexByte(path[1:], '/'); nextSlash != -1 {
165165
if possibleDrive, _ := url.PathUnescape(path[1 : nextSlash+2]); strings.HasSuffix(possibleDrive, ":/") {
166-
return possibleDrive + path[len(possibleDrive)+1:]
166+
return possibleDrive + path[nextSlash+2:]
167167
}
168168
}
169169
}

0 commit comments

Comments
 (0)