rust-lang / rust-lang/rust-analyzer

"file not included in module tree" is reported after changing the case of filename

Open
#9,947 13 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-vscode S-unactionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

NOTE: This is a VSCode issue on case insensitive file systems, a workaround fix is described in this comment

I'm using VSCode with rust-analyzer 0.2.710 on Windows 10.

To reproduce:

  1. Create a new rust project
  2. Create A.rs under src
  3. Rename A.rs to a.rs
  4. Add mod a; to main.rs
  5. In a.rs it reports file not included in module tree and IntelliSense is disabled.

image

image

Restart VSCode doesn't solve the issue. How can I clear the cache of rust-analyzer?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce on Windows with a Rust project by renaming src/A.rs to src/a.rs and adding mod a; to main.rs. Start by checking how rust-analyzer and VSCode handle the renamed file and module tree. Done means a.rs is included and IntelliSense works without restarting VSCode or relying on the linked workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.