about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/ide/src/references.rs2
-rw-r--r--crates/rust-analyzer/src/config.rs9
-rw-r--r--docs/user/generated_config.adoc10
-rw-r--r--editors/code/package.json10
4 files changed, 14 insertions, 17 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index 73d118d8bb2..5b410c454d9 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -118,8 +118,6 @@ pub(crate) fn find_all_refs(
 }
 
 fn filter_import_references(usages: &mut UsageSearchResult) {
-    // todo use this https://github.com/rust-lang/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs#L432
-
     for (_file_id, refs) in &mut usages.references {
         refs.retain(|it| match it.name.as_name_ref() {
             Some(name_ref) => {
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 80a4b709e7c..835eeb144a6 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -219,10 +219,6 @@ config_data! {
         files_excludeDirs: Vec<PathBuf> = "[]",
         /// Controls file watching implementation.
         files_watcher: FilesWatcherDef = "\"client\"",
-
-        /// Exclude imports from find-all-references.
-        findAllRefs_excludeImports: bool = "false",
-
         /// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
         highlightRelated_breakPoints_enable: bool = "true",
         /// Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`).
@@ -362,6 +358,9 @@ config_data! {
         /// this is rust-analyzer itself, but we override this in tests).
         procMacro_server: Option<PathBuf>          = "null",
 
+        /// Exclude imports from find-all-references.
+        references_excludeImports: bool = "false",
+
         /// Command to be executed instead of 'cargo' for runnables.
         runnables_command: Option<String> = "null",
         /// Additional arguments to be passed to cargo for runnables such as
@@ -1151,7 +1150,7 @@ impl Config {
     }
 
     pub fn find_all_refs_exclude_imports(&self) -> bool {
-        self.data.findAllRefs_excludeImports
+        self.data.references_excludeImports
     }
 
     pub fn snippet_cap(&self) -> bool {
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc
index 337629e17fd..0e301e5d67d 100644
--- a/docs/user/generated_config.adoc
+++ b/docs/user/generated_config.adoc
@@ -262,11 +262,6 @@ also need to add the folders to Code's `files.watcherExclude`.
 --
 Controls file watching implementation.
 --
-[[rust-analyzer.findAllRefs.excludeImports]]rust-analyzer.findAllRefs.excludeImports (default: `false`)::
-+
---
-Exclude imports from find-all-references.
---
 [[rust-analyzer.highlightRelated.breakPoints.enable]]rust-analyzer.highlightRelated.breakPoints.enable (default: `true`)::
 +
 --
@@ -551,6 +546,11 @@ This config takes a map of crate names with the exported proc-macro names to ign
 Internal config, path to proc-macro server executable (typically,
 this is rust-analyzer itself, but we override this in tests).
 --
+[[rust-analyzer.references.excludeImports]]rust-analyzer.references.excludeImports (default: `false`)::
++
+--
+Exclude imports from find-all-references.
+--
 [[rust-analyzer.runnables.command]]rust-analyzer.runnables.command (default: `null`)::
 +
 --
diff --git a/editors/code/package.json b/editors/code/package.json
index 07e9a08e1bd..9d39c7c296b 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -706,11 +706,6 @@
                         "Use server-side file watching"
                     ]
                 },
-                "rust-analyzer.findAllRefs.excludeImports": {
-                    "markdownDescription": "Exclude imports from find-all-references.",
-                    "default": false,
-                    "type": "boolean"
-                },
                 "rust-analyzer.highlightRelated.breakPoints.enable": {
                     "markdownDescription": "Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.",
                     "default": true,
@@ -1041,6 +1036,11 @@
                         "string"
                     ]
                 },
+                "rust-analyzer.references.excludeImports": {
+                    "markdownDescription": "Exclude imports from find-all-references.",
+                    "default": false,
+                    "type": "boolean"
+                },
                 "rust-analyzer.runnables.command": {
                     "markdownDescription": "Command to be executed instead of 'cargo' for runnables.",
                     "default": null,