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 project: file not included in module tree #4342

Closed
zjp-CN opened this issue Oct 18, 2022 · 3 comments
Closed

Rust project: file not included in module tree #4342

zjp-CN opened this issue Oct 18, 2022 · 3 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@zjp-CN
Copy link
Contributor

zjp-CN commented Oct 18, 2022

I'm reading cross-term's example interactive-demo. And I open the source file with helix (master version), and get a single error from rust-analyzer file not included in module tree on the first line.

git clone https://github.com/crossterm-rs/crossterm.git
cd examples/interactive-demo
hx src/main.rs

Hover doc, autocompletion and goto-definition are not working. But you can see they work in neovim (under examples/interactive-demo too):

helix-nvim.mp4
@the-mikedavis
Copy link
Member

This is the expected behavior of the current workspace detection - the crossterm repo's root is the highest directory in the git repository that has a root marker (Cargo.toml). Rust-analyzer thinks that the module isn't included because it isn't included in crossterm (which is correct) rather than the interactive-demo project. Also see #3993, #2732, #2970

zjp-CN added a commit to zjp-CN/helix that referenced this issue Oct 19, 2022
fix helix-editor#4342

You can use `ROOT=$PWD hx src/main.rs` to specify the project root
if helix is failed to detect the unusual project structure.
@kirawi kirawi added C-bug Category: This is a bug A-helix-term Area: Helix term improvements labels Nov 10, 2022
@gabydd
Copy link
Member

gabydd commented Jul 14, 2023

@pascalkuthe do you think this and related issues are reasonably solved #5748

@pascalkuthe
Copy link
Member

yeah that's fixed by that PR specifying editor.workspace-lsp-roots = ["examples/interactive-demo"] in a .helix/config.toml file inside the crossterm repo works. There is no situation to autodetect stuff like this and exactly why we ended up with the implementation in #5748

I forgot to link this issue in that PR, thanks 👍

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

Successfully merging a pull request may close this issue.

5 participants