-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 features don't work when rust source file is opened from more than one level outside of the project directory #2970
Comments
I've updated this issue several times, after discovering new information. After reading the log output I eventually managed to catch, I believe the error is caused by passing the current directory to the language server, instead of the path to the file. I will attempt to fix this error, and if I'm successful I'll make a PR. |
Update on the attempted PR, it's now past 2am my time and I was completely unfamiliar with the codebase to start with, lol. I'll continue tomorrow, but so far I have confirmed that the issue occurs when |
It actually happens not just in rust-analyzer. I was thinking that |
Parts of the code base that I think passes the current_directory should be in helix/helix-term/src/commands/lsp.rs Lines 149 to 156 in 6e2aaed
|
Alright I never got around to working on it today unfortunately. I've discovered the the LSP features seem to be extremely picky and will break unless I open my projects a very specific way... It also completely breaks if I try and use a helper script for reasons I can't begin to comprehend given that the situation should be exactly the same.. I'll get around to figuring it out eventually, I'm tired |
Fixed in #3553 |
Summary
When opening a Rust source file with a file path either one level outside of the project directory or anywhere inside the directory, these features work perfectly. However, using a path more than one layer outside of the project directory, either on the commandline or in the editor, the 'goto definition' and 'show documentation' features and likely others do not work. Most simply do nothing, but 'goto definition' returns the error 'No definition found.'.
Reproduction Steps
Assume the following directory layout:
This works:
~/src/SaphiraKai$ hx libaether/src/lib.rs
I am fully able to use features such as
<space>k
.However, moving up a single directory layer breaks.
This does not work:
~/src$ hx SaphiraKai/libaether/src/lib.rs
Attempting to use
<space>k
and other LSP features simply do nothing, or yield an error.I've also tried various other directory structure layouts, including this:
This works:
~/rd$ hx libaether/src/lib.rs
This does not work:
~$ hx rd/libaether/src/lib.rs
Helix log
I managed to get the output from opening a broken session, attempting to use
<space>k
, and then closing the session:~/.cache/helix/helix.log
Platform
Linux
Terminal Emulator
st-instantos (the instantOS fork of suckless terminal)
Helix Version
helix 22.05
The text was updated successfully, but these errors were encountered: