Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates rust-analyzer’s VFS loading configuration (via load-cargo) to include Markdown files, enabling .md files to be discovered/loaded alongside Rust sources and Cargo config files.
Changes:
- Add
mdto the set of file extensions loaded from workspace roots (ProjectFolders).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| dirs.extensions.push("rs".into()); | ||
| dirs.extensions.push("toml".into()); | ||
| dirs.extensions.push("md".into()); |
There was a problem hiding this comment.
Adding md to the VFS loader extensions means markdown files can now be resolved/loaded, but in FilesWatcher::Client mode rust-analyzer only registers watchers for **/*.rs, Cargo.{lock,toml}, and rust-analyzer.toml (see crates/rust-analyzer/src/reload.rs). As a result, changes to *.md files (e.g. README updates used by include_str!) won’t invalidate/reload VFS contents unless the file is opened in the editor. Consider also extending the client watcher glob patterns to include **/*.md so markdown-backed expansions/docs update correctly.
| dirs.extensions.push("toml".into()); | ||
| dirs.extensions.push("md".into()); |
There was a problem hiding this comment.
This change alters which files are loaded into VFS (and therefore which paths resolve_path/include_str! can successfully read), but there’s no regression test asserting that .md files under a workspace root become non-excluded/available. Please add a test that fails without this line (e.g., create a small temp workspace with a Rust file using include_str!("README.md") or directly assert the produced vfs::loader::Directories.extensions contains md).
complete #21928
related #11137
add md into vfs