-
Notifications
You must be signed in to change notification settings - Fork 3
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
Version 0.6.3 fails under Windows under VS Code: Error file:///c%3A//...
could not be converted back to a URL
#62
Comments
Looks like this error comes from here: https://github.com/facebook/starlark-rust/blob/7dd526ad8f2f0e275aa1575a845038544e24bfee/starlark_lsp/src/server.rs#L237 |
Previous implementation was mixing Url paths with file paths. It caused errors like: "Error: `file:///C:/work/bazel_plain/sample.bzl` could not be converted back to a URL\n" More: cameron-martin/bazel-lsp#62 The Url.path() is usually `"/" + path to file` which works fine as file path under unix-like systems, but breaks under Windows, where it can be e.g. "/c:/some/file". See https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#syntax Switched to using Url.to_file_path() which represents actual file path. In the process: - Enabled back Windows tests that at least for my machine started passing; - In validate() function not converting from Url to LspUrl and back, just returning to client Url passed in the request.
Previous implementation was mixing Url paths with file paths. It caused errors like: "Error: `file:///C:/work/bazel_plain/sample.bzl` could not be converted back to a URL\n" More: cameron-martin/bazel-lsp#62 The Url.path() is usually `"/" + path to file` which works fine as file path under unix-like systems, but breaks under Windows, where it can be e.g. "/c:/some/file". See https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#syntax Switched to using Url.to_file_path() which represents actual file path. In the process: - Enabled back Windows tests that at least for my machine started passing; - In validate() function not converting from Url to LspUrl and back, just returning to client Url passed in the request.
Previous implementation was mixing Url paths with file paths. It caused errors like: "Error: `file:///C:/work/bazel_plain/sample.bzl` could not be converted back to a URL\n" More: cameron-martin/bazel-lsp#62 The Url.path() is usually `"/" + path to file` which works fine as file path under unix-like systems, but breaks under Windows, where it can be e.g. "/c:/some/file". See https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#syntax Switched to using Url.to_file_path() which represents actual file path. In the process: - Enabled back Windows tests that at least for my machine started passing; - In validate() function not converting from Url to LspUrl and back, just returning to client Url passed in the request.
Summary: Previous implementation was using `Url.path()` where it should use `Url.to_file_path()` It caused errors like: ``` "Error: `file:///C:/work/bazel_plain/sample.bzl` could not be converted back to a URL\n" ``` More: cameron-martin/bazel-lsp#62 The `Url.path()` is usually `"/" + path to file` which works fine as file path under unix-like systems, but breaks under Windows, where it can be e.g. `"/c:/some/file"`. See https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#syntax Switched to using `Url.to_file_path()` which represents actual file path. In the process: - Enabled back Windows tests that at least for my machine started passing; - In validate() function not converting from Url to LspUrl and back, just returning to client Url passed in the request. X-link: facebook/starlark-rust#136 Reviewed By: KapJI Differential Revision: D66655476 Pulled By: ndmitchell fbshipit-source-id: b4590fb27348019424e27ee1d12ffe27d86c6f9f
Summary: Previous implementation was using `Url.path()` where it should use `Url.to_file_path()` It caused errors like: ``` "Error: `file:///C:/work/bazel_plain/sample.bzl` could not be converted back to a URL\n" ``` More: cameron-martin/bazel-lsp#62 The `Url.path()` is usually `"/" + path to file` which works fine as file path under unix-like systems, but breaks under Windows, where it can be e.g. `"/c:/some/file"`. See https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#syntax Switched to using `Url.to_file_path()` which represents actual file path. In the process: - Enabled back Windows tests that at least for my machine started passing; - In validate() function not converting from Url to LspUrl and back, just returning to client Url passed in the request. Pull Request resolved: #136 Reviewed By: KapJI Differential Revision: D66655476 Pulled By: ndmitchell fbshipit-source-id: b4590fb27348019424e27ee1d12ffe27d86c6f9f
This PR upgrades stalark-rust to the current HEAD and contains required fixes to bazel-lsp. Previous version was from Sep 3, and there were a lot of changes in the mean time. This fixes e.g. #62 # Changes ## remove get_registered_starlark_docs This follows change from facebook/starlark-rust@9a7b00e which removed it in starlark_bin Basically get_registered_starlark_docs returned only some random symbols built in into the binary itself, namely: list, StackFrame, dict, string ## adapt to starlark-rust rewrite DocParams Rewrite happened in facebook/starlark-rust@723a272
Can this be closed now after merging #64? |
Yes, double checked right now that it works under Windows. For some reason was not able to build bazel-lsp on current HEAD though, running git-bisect shows this PR as culprit: #69 I am getting an errors like:
|
Hmm, I wonder why it works on CI but not your machine. I'll check it out on my windows machine later today. |
I have downloaded also bazel-lsp.exe from release PR job (https://github.com/cameron-martin/bazel-lsp/actions/runs/12307052626/job/34349973144?pr=80) and it works as expected. |
From vscode logs:
(one may enable logs using: bazel-contrib/vscode-bazel#425)
Similar, slightly different error under neovim:
Here is what neovim sends under Linux where it works:
The text was updated successfully, but these errors were encountered: