internal: Expose snippet capability to diagnostic quickfixes

This commit is contained in:
DropDemBits 2024-06-07 21:29:48 -04:00
parent a8ad08b9b2
commit 4e6d908382
No known key found for this signature in database
GPG key ID: 7FE02A6C1EDFA075
5 changed files with 13 additions and 6 deletions

View file

@ -86,7 +86,7 @@ use ide_db::{
label::Label,
source_change::SourceChange,
syntax_helpers::node_ext::parse_tt_as_comma_sep_paths,
FxHashMap, FxHashSet, RootDatabase,
FxHashMap, FxHashSet, RootDatabase, SnippetCap,
};
use once_cell::sync::Lazy;
use stdx::never;
@ -229,6 +229,7 @@ pub struct DiagnosticsConfig {
pub expr_fill_default: ExprFillDefaultMode,
pub style_lints: bool,
// FIXME: We may want to include a whole `AssistConfig` here
pub snippet_cap: Option<SnippetCap>,
pub insert_use: InsertUseConfig,
pub prefer_no_std: bool,
pub prefer_prelude: bool,
@ -248,6 +249,7 @@ impl DiagnosticsConfig {
disabled: Default::default(),
expr_fill_default: Default::default(),
style_lints: true,
snippet_cap: SnippetCap::new(true),
insert_use: InsertUseConfig {
granularity: ImportGranularity::Preserve,
enforce_granularity: false,