Allow to disable import insertion on single path glob imports
This commit is contained in:
@@ -44,6 +44,9 @@ config_data! {
|
||||
assist_importPrefix: ImportPrefixDef = "\"plain\"",
|
||||
/// Group inserted imports by the [following order](https://rust-analyzer.github.io/manual.html#auto-import). Groups are separated by newlines.
|
||||
assist_importGroup: bool = "true",
|
||||
/// Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
|
||||
assist_allowMergingIntoGlobImports: bool = "true",
|
||||
|
||||
/// Show function name and docs in parameter hints.
|
||||
callInfo_full: bool = "true",
|
||||
|
||||
@@ -672,6 +675,7 @@ impl Config {
|
||||
ImportPrefixDef::BySelf => PrefixKind::BySelf,
|
||||
},
|
||||
group: self.data.assist_importGroup,
|
||||
skip_glob_imports: !self.data.assist_allowMergingIntoGlobImports,
|
||||
}
|
||||
}
|
||||
pub fn completion(&self) -> CompletionConfig {
|
||||
|
||||
@@ -143,6 +143,7 @@ fn integrated_completion_benchmark() {
|
||||
prefix_kind: hir::PrefixKind::ByCrate,
|
||||
enforce_granularity: true,
|
||||
group: true,
|
||||
skip_glob_imports: true,
|
||||
},
|
||||
};
|
||||
let position =
|
||||
@@ -178,6 +179,7 @@ fn integrated_completion_benchmark() {
|
||||
prefix_kind: hir::PrefixKind::ByCrate,
|
||||
enforce_granularity: true,
|
||||
group: true,
|
||||
skip_glob_imports: true,
|
||||
},
|
||||
};
|
||||
let position =
|
||||
|
||||
@@ -1187,6 +1187,7 @@ mod tests {
|
||||
prefix_kind: PrefixKind::Plain,
|
||||
enforce_granularity: true,
|
||||
group: true,
|
||||
skip_glob_imports: true,
|
||||
},
|
||||
},
|
||||
ide_db::base_db::FilePosition { file_id, offset },
|
||||
|
||||
Reference in New Issue
Block a user