From 106ea7ad85de375304bd4205bd7fe62864b7fe46 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 19 Jul 2021 23:09:29 +1000 Subject: [PATCH 1/2] 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 :-) --- crates/rust-analyzer/src/config.rs | 4 +++- docs/user/generated_config.adoc | 4 +++- editors/code/package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 7df60229648..323f2744f7a 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -142,7 +142,9 @@ struct ConfigData { /// 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 = "[]", /// Use semantic tokens for strings. diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index 86d147ee8bc..35342a81097 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -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`):: + diff --git a/editors/code/package.json b/editors/code/package.json index c4ed4b59814..cf60b6eba5a 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -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": { From d22b830ed156d43e87aef9cfd51d51713b297b6c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 22 Jul 2021 21:03:06 +1000 Subject: [PATCH 2/2] mention files.watcherExclude MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laurențiu Nicola --- crates/rust-analyzer/src/config.rs | 2 +- docs/user/generated_config.adoc | 2 +- editors/code/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 323f2744f7a..b6d4aef72eb 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -144,7 +144,7 @@ struct ConfigData { files_watcher: String = "\"client\"", /// 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'. + /// also need to add the folders to Code's `files.watcherExclude`. files_excludeDirs: Vec = "[]", /// Use semantic tokens for strings. diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index 35342a81097..675e57386e8 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -206,7 +206,7 @@ Controls file watching implementation. -- 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'. +also need to add the folders to Code's `files.watcherExclude`. -- [[rust-analyzer.highlighting.strings]]rust-analyzer.highlighting.strings (default: `true`):: + diff --git a/editors/code/package.json b/editors/code/package.json index cf60b6eba5a..47a64aa7188 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -648,7 +648,7 @@ "type": "string" }, "rust-analyzer.files.excludeDirs": { - "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'.", + "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 `files.watcherExclude`.", "default": [], "type": "array", "items": {