Skip to content

Commit

Permalink
minor update to excludeDirs doc
Browse files Browse the repository at this point in the history
I saw reference to globs in rust-lang#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 :-)
  • Loading branch information
dae committed Jul 19, 2021
1 parent 64bf67c commit 106ea7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ config_data! {

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

/// Use semantic tokens for strings.
Expand Down
4 changes: 3 additions & 1 deletion docs/user/generated_config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ Controls file watching implementation.
[[rust-analyzer.files.excludeDirs]]rust-analyzer.files.excludeDirs (default: `[]`)::
+
--
These directories will be ignored by rust-analyzer.
These directories will be ignored by rust-analyzer. They are
relative to the workspace root, and globs are not supported. You may
also need to add the folders to Code's 'watcher exclude'.
--
[[rust-analyzer.highlighting.strings]]rust-analyzer.highlighting.strings (default: `true`)::
+
Expand Down
2 changes: 1 addition & 1 deletion editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
"type": "string"
},
"rust-analyzer.files.excludeDirs": {
"markdownDescription": "These directories will be ignored by rust-analyzer.",
"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'.",
"default": [],
"type": "array",
"items": {
Expand Down

0 comments on commit 106ea7a

Please sign in to comment.