Skip to content
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

LSP: diagnostics for files opened in the editor are not updating correctly on Windows #229

Closed
peterhuene opened this issue Oct 18, 2024 · 2 comments · Fixed by #231
Closed
Assignees

Comments

@peterhuene
Copy link
Collaborator

peterhuene commented Oct 18, 2024

The Sprocket VSCode extension on Windows is not working correctly.

When a file is opened in the editor, the current set of diagnostics for the file (correctly) remains unchanged. However, if the file's buffer becomes dirty, the diagnostics disappear completely and remain cleared until the file is closed.

There also appears to be quite a few requests for the file's diagnostics, which are completing in < 10us, presumably with an empty set of diagnostics.

@peterhuene peterhuene self-assigned this Oct 18, 2024
@peterhuene
Copy link
Collaborator Author

So the document URI being received on Windows from the LSP client has a percent-encoded : in the file path, e.g. file:///C%3A/....

This is tripping up the resolution of the document in the document graph as it was added to the graph with URI file:///C:/....

The fix is to normalize what's coming from the LSP client.

@peterhuene
Copy link
Collaborator Author

Additionally, the requests from VS Code are sending lowercase drive letters, whereas Rust paths are using upper case drive letters.

It looks like RA fixed this by also normalizing what's coming it from VS Code to have upper case drive letters.

peterhuene added a commit to peterhuene/wdl that referenced this issue Oct 21, 2024
This fixes LSP requests that contain percent encoded colons and
lowercase drive letters in request URIs.

This caused the analyzer to report an empty set of diagnostics because
the requested document was unknown to the analyzer (it used both a colon
and an uppercase drive letter in the document graph).

The fix is to percent decode the path segments and normalize the drive
letter to uppercase in the LSP server.

Fixes stjude-rust-labs#229.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant