Allow to disable import insertion on single path glob imports

This commit is contained in:
Lukas Wirth 2021-06-18 23:11:56 +02:00
parent 84507a0b9c
commit 2ee090faaf
14 changed files with 99 additions and 17 deletions

View file

@ -378,7 +378,7 @@ impl ImportEdit {
let _p = profile::span("ImportEdit::to_text_edit");
let new_ast = self.scope.clone_for_update();
insert_use::insert_use(&new_ast, mod_path_to_ast(&self.import.import_path), cfg);
insert_use::insert_use(&new_ast, mod_path_to_ast(&self.import.import_path), &cfg);
let mut import_insert = TextEdit::builder();
algo::diff(self.scope.as_syntax_node(), new_ast.as_syntax_node())
.into_text_edit(&mut import_insert);

View file

@ -36,6 +36,7 @@ pub(crate) const TEST_CONFIG: CompletionConfig = CompletionConfig {
prefix_kind: PrefixKind::Plain,
enforce_granularity: true,
group: true,
skip_glob_imports: true,
},
};