diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-18 22:23:22 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-18 22:23:22 +0100 |
commit | d9666ce5098442ab0cbac4d4363435074eb12923 (patch) | |
tree | f384246a35bb32f1d7ecc39c966150fd175f00c2 /crates/ide_completion | |
parent | 4f6301b8f6ff79bc5114d400bdce31dc3f37216b (diff) | |
parent | 2ee090faaf69474a2baadf0494ef3c6ed4fdbcbc (diff) |
Merge #9334
9334: feat: Allow to disable import insertion on single path glob imports r=Veykril a=Veykril
On by default as I feel like this is something the majority would prefer.
Closes #8490
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide_completion')
-rw-r--r-- | crates/ide_completion/src/item.rs | 2 | ||||
-rw-r--r-- | crates/ide_completion/src/tests.rs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/crates/ide_completion/src/item.rs b/crates/ide_completion/src/item.rs index 99edb9499..ae63d132e 100644 --- a/crates/ide_completion/src/item.rs +++ b/crates/ide_completion/src/item.rs | |||
@@ -378,7 +378,7 @@ impl ImportEdit { | |||
378 | let _p = profile::span("ImportEdit::to_text_edit"); | 378 | let _p = profile::span("ImportEdit::to_text_edit"); |
379 | 379 | ||
380 | let new_ast = self.scope.clone_for_update(); | 380 | let new_ast = self.scope.clone_for_update(); |
381 | insert_use::insert_use(&new_ast, mod_path_to_ast(&self.import.import_path), cfg); | 381 | insert_use::insert_use(&new_ast, mod_path_to_ast(&self.import.import_path), &cfg); |
382 | let mut import_insert = TextEdit::builder(); | 382 | let mut import_insert = TextEdit::builder(); |
383 | algo::diff(self.scope.as_syntax_node(), new_ast.as_syntax_node()) | 383 | algo::diff(self.scope.as_syntax_node(), new_ast.as_syntax_node()) |
384 | .into_text_edit(&mut import_insert); | 384 | .into_text_edit(&mut import_insert); |
diff --git a/crates/ide_completion/src/tests.rs b/crates/ide_completion/src/tests.rs index 1ea6017ce..211c89c40 100644 --- a/crates/ide_completion/src/tests.rs +++ b/crates/ide_completion/src/tests.rs | |||
@@ -36,6 +36,7 @@ pub(crate) const TEST_CONFIG: CompletionConfig = CompletionConfig { | |||
36 | prefix_kind: PrefixKind::Plain, | 36 | prefix_kind: PrefixKind::Plain, |
37 | enforce_granularity: true, | 37 | enforce_granularity: true, |
38 | group: true, | 38 | group: true, |
39 | skip_glob_imports: true, | ||
39 | }, | 40 | }, |
40 | }; | 41 | }; |
41 | 42 | ||