-
Notifications
You must be signed in to change notification settings - Fork 91
Fixed typeprof.conf.json could not be loaded on VSCode on Windows #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 `:`.
Hmm, should we use |
Thank you for your comment. |
Ah, maybe we should add def path_to_uri(path)
@url_schema + File.expand_path(path).split("/").map {|s| CGI.escape_uri_component(s) }.join("/")
end
def uri_to_path(url)
uri.delete_prefix(@url_schema).split("/").map {|s| CGI.unescape_uri_component(s) }.join("/")
end |
It worked fine. |
…n uri_to_path method
Maybe the cgi gem bundled with Ruby 3.2 is the version before the Aside from that, TypeProf does not support Ruby 3.2 and can be excluded from the CI matrix. |
Thank you for your comment. I thought it would be better to modify to use CGI.escapeURIComponent / CGI.unescapeURIComponent as a fix for Windows. Also, it would be better to deal with removing Ruby 3.2 from CI as a separate issue, such as by creating a separate PR. |
I think so too. |
Thanks! |
The problem was that the
url
processed byuri_to_path
was likec%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 byuri_to_path
, it is replaced with:
.However, if you have any other good ways to fix it, please comment.
Note: