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

normalize LSP workspaces #6517

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

pascalkuthe
Copy link
Member

Fixes #6505

We didn't normalize/canoncialize LSP workspace paths with can both lead to bugs in the workspace detection and leads to inconsistent paths being sent to the LS which might not handle this correctly.

@pascalkuthe pascalkuthe added C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer. labels Mar 31, 2023
@@ -201,6 +202,7 @@ impl Client {
let (server_rx, server_tx, initialize_notify) =
Transport::start(reader, writer, stderr, id);
let (workspace, workspace_is_cwd) = find_workspace();
let workspace = path::get_normalized_path(&workspace);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about canonicalizing in find_workspace instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to do that at first but the problem with that is the normalize is in helix-core and find_workspace is in helix-loader (which can't pull in helix-core). All other uses of find_workspace don't care about path equality (they just use it to do IO where it doesn't matter which path is used)

@archseer archseer added this to the 23.03.1 milestone Apr 1, 2023
@archseer archseer merged commit bfe8d26 into helix-editor:master Apr 3, 2023
@pascalkuthe pascalkuthe deleted the lsp_root_cannonical branch April 6, 2023 23:03
Triton171 pushed a commit to Triton171/helix that referenced this pull request Jun 18, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rust-analyzer doesn't work most of the time on 23.03
3 participants