rust-lang / rust-lang/rust-analyzer

VSCode rust-analyzer -- Looking for files from different projects in each other's folders - "File with cargo diagnostic not found in VFS: file not found:"

Open
#13,520 9 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-flycheck A-vfs C-bug
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)

rust-analyzer version: 0.3.1258-standalone (43fb9563b 2022-10-23)

rustc version: (eg. output of rustc -V)
rustc 1.66.0-nightly (9565dfeb4 2022-10-28)

I am getting errors like these:

[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\libsfasta\src\masking\ml32bit.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\libsfasta\src\masking\ml32bit.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\libsfasta\src\masking\ml32bit.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\libsfasta\src\masking\ml32bit.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\libsfasta\src\datatypes\seq_loc.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\libsfasta\benches\ml32bit.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\libsfasta\benches\ml32bit.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\sfa\src\main.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\sfa\src\main.rs
[ERROR rust_analyzer::main_loop] flycheck 3: File with cargo diagnostic not found in VFS: file not found: c:\Development\phyloclap\sfa\src\main.rs

These are very weird, as those files should not exist (sfa and libsfasta are folders in a different project, and are not and should not be present in the phyloclap project).

It is referenced as such in Cargo.toml though:
libsfasta = { path = "../sfasta/libsfasta" }

So maybe I am misunderstanding something? I have been trying to debug why I do not get compilation errors in VSCode anymore inline as red, but everything else re: Rust-analyzer is working, and this is the only type of error showing up.

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

Start by reproducing the diagnostics in VSCode with the Cargo.toml dependency path ../sfasta/libsfasta, then trace the rust-analyzer flycheck and VFS handling mentioned in the error. Done means diagnostics no longer reference files from the separate project and inline compilation errors appear correctly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.