Skip to content

add md into vfs#21968

Merged
lnicola merged 1 commit intorust-lang:masterfrom
asukaminato0721:21928
Apr 6, 2026
Merged

add md into vfs#21968
lnicola merged 1 commit intorust-lang:masterfrom
asukaminato0721:21928

Conversation

@asukaminato0721
Copy link
Copy Markdown
Contributor

@asukaminato0721 asukaminato0721 commented Apr 6, 2026

complete #21928
related #11137

add md into vfs

image

Copilot AI review requested due to automatic review settings April 6, 2026 10:12
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2026
@lnicola lnicola enabled auto-merge April 6, 2026 10:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 md to the set of file extensions loaded from workspace roots (ProjectFolders).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

View changes since this review

Comment on lines 305 to +307
dirs.extensions.push("rs".into());
dirs.extensions.push("toml".into());
dirs.extensions.push("md".into());
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 306 to +307
dirs.extensions.push("toml".into());
dirs.extensions.push("md".into());
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@lnicola lnicola added this pull request to the merge queue Apr 6, 2026
Merged via the queue into rust-lang:master with commit fd3d1c1 Apr 6, 2026
20 of 21 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2026
@asukaminato0721 asukaminato0721 deleted the 21928 branch April 6, 2026 10:34
PRO-2684 added a commit to PRO-2684/rust-analyzer that referenced this pull request Apr 6, 2026
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants