Skip to content

Commit 106ea7a

Browse files
committed
minor update to excludeDirs doc
I saw reference to globs in #7755, but it doesn't look like they're actually supported, and I had to dig through the source to discover that the folders are relative to the workspace root. Further digging was required to get VS Code from hanging for long periods trying to watch giant Bazel folders that had already been excluded from Rust Analyzer. Hopefully this tweak will save others the confusion :-)
1 parent 64bf67c commit 106ea7a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ config_data! {
142142

143143
/// Controls file watching implementation.
144144
files_watcher: String = "\"client\"",
145-
/// These directories will be ignored by rust-analyzer.
145+
/// These directories will be ignored by rust-analyzer. They are
146+
/// relative to the workspace root, and globs are not supported. You may
147+
/// also need to add the folders to Code's 'watcher exclude'.
146148
files_excludeDirs: Vec<PathBuf> = "[]",
147149

148150
/// Use semantic tokens for strings.

docs/user/generated_config.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ Controls file watching implementation.
204204
[[rust-analyzer.files.excludeDirs]]rust-analyzer.files.excludeDirs (default: `[]`)::
205205
+
206206
--
207-
These directories will be ignored by rust-analyzer.
207+
These directories will be ignored by rust-analyzer. They are
208+
relative to the workspace root, and globs are not supported. You may
209+
also need to add the folders to Code's 'watcher exclude'.
208210
--
209211
[[rust-analyzer.highlighting.strings]]rust-analyzer.highlighting.strings (default: `true`)::
210212
+

editors/code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@
648648
"type": "string"
649649
},
650650
"rust-analyzer.files.excludeDirs": {
651-
"markdownDescription": "These directories will be ignored by rust-analyzer.",
651+
"markdownDescription": "These directories will be ignored by rust-analyzer. They are\nrelative to the workspace root, and globs are not supported. You may\nalso need to add the folders to Code's 'watcher exclude'.",
652652
"default": [],
653653
"type": "array",
654654
"items": {

0 commit comments

Comments
 (0)