Skip to content

Commit dc92735

Browse files
committed
Fixed typeprof.conf.json could not be loaded on VSCode on Windows
The problem was that the `url` processed by `uri_to_path` was like `c%3A/Users/shunh/vscode-typeprof-test`, and typeprof.conf.json could not be loaded. This meant that TypeProf could be launched as an LSP, but the results of type analysis were not displayed on VSCode. So, I changed that if `%3A` is included in the url returned by `uri_to_path`, it is replaced with `:`.
1 parent 75082bb commit dc92735

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/typeprof/lsp/server.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ def path_to_uri(path)
6969
end
7070

7171
def uri_to_path(url)
72-
url.delete_prefix(@url_schema)
72+
path = url.delete_prefix(@url_schema)
73+
74+
if path.include?('%3A')
75+
path.sub(/%3A/, ':')
76+
else
77+
path
78+
end
7379
end
7480

7581
#: (Array[String]) -> void

0 commit comments

Comments
 (0)