Skip to content

Commit f7f4792

Browse files
committed
fixes
1 parent 773f9b3 commit f7f4792

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

crates/ide/src/references.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ pub(crate) fn find_all_refs(
118118
}
119119

120120
fn filter_import_references(usages: &mut UsageSearchResult) {
121-
// todo use this https://github.com/rust-lang/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs#L432
122-
123121
for (_file_id, refs) in &mut usages.references {
124122
refs.retain(|it| match it.name.as_name_ref() {
125123
Some(name_ref) => {

crates/rust-analyzer/src/config.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ config_data! {
219219
files_excludeDirs: Vec<PathBuf> = "[]",
220220
/// Controls file watching implementation.
221221
files_watcher: FilesWatcherDef = "\"client\"",
222-
223-
/// Exclude imports from find-all-references.
224-
findAllRefs_excludeImports: bool = "false",
225-
226222
/// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
227223
highlightRelated_breakPoints_enable: bool = "true",
228224
/// Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`).
@@ -362,6 +358,9 @@ config_data! {
362358
/// this is rust-analyzer itself, but we override this in tests).
363359
procMacro_server: Option<PathBuf> = "null",
364360

361+
/// Exclude imports from find-all-references.
362+
references_excludeImports: bool = "false",
363+
365364
/// Command to be executed instead of 'cargo' for runnables.
366365
runnables_command: Option<String> = "null",
367366
/// Additional arguments to be passed to cargo for runnables such as
@@ -1151,7 +1150,7 @@ impl Config {
11511150
}
11521151

11531152
pub fn find_all_refs_exclude_imports(&self) -> bool {
1154-
self.data.findAllRefs_excludeImports
1153+
self.data.references_excludeImports
11551154
}
11561155

11571156
pub fn snippet_cap(&self) -> bool {

docs/user/generated_config.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,6 @@ also need to add the folders to Code's `files.watcherExclude`.
262262
--
263263
Controls file watching implementation.
264264
--
265-
[[rust-analyzer.findAllRefs.excludeImports]]rust-analyzer.findAllRefs.excludeImports (default: `false`)::
266-
+
267-
--
268-
Exclude imports from find-all-references.
269-
--
270265
[[rust-analyzer.highlightRelated.breakPoints.enable]]rust-analyzer.highlightRelated.breakPoints.enable (default: `true`)::
271266
+
272267
--
@@ -551,6 +546,11 @@ This config takes a map of crate names with the exported proc-macro names to ign
551546
Internal config, path to proc-macro server executable (typically,
552547
this is rust-analyzer itself, but we override this in tests).
553548
--
549+
[[rust-analyzer.references.excludeImports]]rust-analyzer.references.excludeImports (default: `false`)::
550+
+
551+
--
552+
Exclude imports from find-all-references.
553+
--
554554
[[rust-analyzer.runnables.command]]rust-analyzer.runnables.command (default: `null`)::
555555
+
556556
--

editors/code/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,6 @@
706706
"Use server-side file watching"
707707
]
708708
},
709-
"rust-analyzer.findAllRefs.excludeImports": {
710-
"markdownDescription": "Exclude imports from find-all-references.",
711-
"default": false,
712-
"type": "boolean"
713-
},
714709
"rust-analyzer.highlightRelated.breakPoints.enable": {
715710
"markdownDescription": "Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.",
716711
"default": true,
@@ -1041,6 +1036,11 @@
10411036
"string"
10421037
]
10431038
},
1039+
"rust-analyzer.references.excludeImports": {
1040+
"markdownDescription": "Exclude imports from find-all-references.",
1041+
"default": false,
1042+
"type": "boolean"
1043+
},
10441044
"rust-analyzer.runnables.command": {
10451045
"markdownDescription": "Command to be executed instead of 'cargo' for runnables.",
10461046
"default": null,

0 commit comments

Comments
 (0)