rust-lang / rust-lang/rust-analyzer
Submodule confusion
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
v0.3.2154
rustc version: (eg. output of rustc -V)
rustc 1.82.0 (f6e511eec 2024-10-15)
editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
VSCODE
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
repository link (if public, optional): (eg. rust-analyzer)
code snippet to reproduce:
- have code that relies on some submodule
submod.rs - refactor code and delete
submod.rsand instead usesubmod/mod.rs - rust-analyzer does not really recognize
submod/mod.rsand instead uses the deletedsubmod.rseven after deleting/targetand rebuilding - f12 view source on a function imported from
submod/mod.rswill opensubmod.rsinstead if the function existed insubmod.rs submod/mod.rswill not have any compiler hints on hover- however,
submod/other_mod.rsincluded bysubmod/mod.rswill have compiler hints
mod submod;
fn main() {
submod::some_func();
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the module move from submod.rs to submod/mod.rs in VSCode using the provided Rust snippet. Start by checking rust-analyzer's handling of submod/mod.rs through F12 and hover, and compare it with submod/other_mod.rs. Done means the new module path is recognized, source navigation no longer opens the deleted file, and compiler hints appear in submod/mod.rs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100