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

rust-analyzer doesn't work most of the time on 23.03 #6505

Closed
0x00A opened this issue Mar 31, 2023 · 8 comments · Fixed by #6517
Closed

rust-analyzer doesn't work most of the time on 23.03 #6505

0x00A opened this issue Mar 31, 2023 · 8 comments · Fixed by #6517
Labels
C-bug Category: This is a bug

Comments

@0x00A
Copy link

0x00A commented Mar 31, 2023

Summary

After updating to 23.03 today, I noticed that rust-analyzer doesn't work with helix most of the time, go-to definition, doc for item under cursor etc. rarely works, then you restart helix or do :lsp-restart and it works or doesn't. This is not the case with 22.12 which I have used daily since it was released. I tested again with the 22.12 and it works as expected each time.

Reproduction Steps

# src/main.rs

fn main() {
    let _ = foo(32);
}

pub fn foo(n: i32) -> i32 {
    n
}
  1. hx src/main.rs
  2. move to foo
  3. <space>k

I expected this to happen:

popup with the relevant info

foo

pub fn foo(n: i32) -> i32

Instead, this happened:

Nothing

Helix log

broken: helix 23.03.log
working helix 22.12.log

Platform

Windows 10 22H2 (19045.2728)

Terminal Emulator

Windows Terminal Version: 1.16.10261.0, wezterm 20221120-093910-0bf36e5a

Helix Version

helix 23.03 (3cf0372)

@0x00A 0x00A added the C-bug Category: This is a bug label Mar 31, 2023
@yudjinn
Copy link

yudjinn commented Mar 31, 2023

Just tried this out on 23.03, no issues. Followed full reproduction steps and the expected result is what I receive. I know this doesnt resolve your issue, but it does seem to be an issue with your environment in some way

@0x00A
Copy link
Author

0x00A commented Mar 31, 2023

Just tried this out on 23.03, no issues. Followed full reproduction steps and the expected result is what I receive. I know this doesnt resolve your issue, but it does seem to be an issue with your environment in some way

I dug a little deeper and I found the following:

cd C:\
cargo new Uppercase
cd Uppercase
hx

rust-analyzer works as expected on both 23.03 and 22.12

However

cd C:\
cargo new Uppercase
cd uppercase  <--- notice the lowercase first character
hx

rust-analyzer only works on 22.12

On windows paths are not case sensitive so Uppercase and uppercase are the same directory.

@0x00A 0x00A closed this as completed Mar 31, 2023
@0x00A
Copy link
Author

0x00A commented Mar 31, 2023

Accidentally closed.

@pascalkuthe pascalkuthe reopened this Mar 31, 2023
@pascalkuthe
Copy link
Member

pascalkuthe commented Mar 31, 2023

I have some ideas of what might be causing this. Could just post the logs for the reproduction case in the uppercase directory and the Uppercase directory so I have a direct comparison? My guess is that this is a RA bug

@0x00A
Copy link
Author

0x00A commented Mar 31, 2023

Broken cd uppercase broken_cd_uppercase.log
Working cd Uppercase working_cd_Uppercase_helix.log

@pascalkuthe
Copy link
Member

pascalkuthe commented Mar 31, 2023

Ah I think we are missing canonicalization in the workspace detection, I will look into a fix.
I think this regressed by #6290 missing to normalize the LSP roots

@pascalkuthe
Copy link
Member

If I guessed correctly than #6517 should fix this. Could you test again @0x00A I don't use windows

@0x00A
Copy link
Author

0x00A commented Mar 31, 2023

helix 23.03 (5e75d33) works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants