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

Hovering Over Items Doesn't Work in Nested Crates #6605

Closed
HTGAzureX1212 opened this issue Nov 22, 2020 · 8 comments
Closed

Hovering Over Items Doesn't Work in Nested Crates #6605

HTGAzureX1212 opened this issue Nov 22, 2020 · 8 comments
Labels
A-diagnostics diagnostics / error reporting S-actionable Someone could pick this issue up and work on it right now

Comments

@HTGAzureX1212
Copy link

I have a project with file structure like this:
image

The problem is that when I hover over definitions of Rust source files in the root src folder (not the one in lightsaber_bootlaoder), it works as expected.

For some unknown reason, when I hover over definitions of Rust source files in the src folder in lightsaber_bootloader, no information popped up. It works at a bare minimum in main.rs in that folder:
image

And everything else, straight up doesn't work.

@bjorn3
Copy link
Member

bjorn3 commented Nov 22, 2020

I assume you don't use a cargo workspace. Rust-analyzer runs cargo metadata in the project root. Because lightsaber_bootloader is not part of the workspace, cargo metadata will ignore it and thus rust-analyzer won't know about it either. You can set "rust-analyzer.linkedProjects": ["lightsaber_bootloader/Cargo.toml"] to also run cargo metadata for lightsaber_bootloader.

@HTGAzureX1212
Copy link
Author

I am actually using workspaces

@HTGAzureX1212
Copy link
Author

Nevermind I figured it out, I needed to have the module included ._.

@flodiebold
Copy link
Member

Maybe we could show some kind of big warning banner in such cases, with a button to automatically insert the mod statement...

@HTGAzureX1212
Copy link
Author

Yes, that's what I used to have when I was using IntelliJ Rust

@jonas-schievink
Copy link
Contributor

We can emit an "unused" diagnostic spanning the whole file, like we do for code that's #[cfg]'d out.

@lnicola lnicola added A-diagnostics diagnostics / error reporting S-actionable Someone could pick this issue up and work on it right now labels Dec 21, 2020
@lnicola
Copy link
Member

lnicola commented Dec 21, 2020

@flodiebold dupe of #6377?

@flodiebold
Copy link
Member

Yeah, I'd say so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

5 participants