rust-analyzer/crates/ide_completion/src/config.rs

23 lines
773 B
Rust
Raw Normal View History

2020-04-24 00:06:12 +00:00
//! Settings for tweaking completion.
//!
//! The fun thing here is `SnippetCap` -- this type can only be created in this
//! module, and we use to statically check that we only produce snippet
//! completions if we are allowed to.
use ide_db::helpers::{insert_use::InsertUseConfig, SnippetCap};
2021-10-04 17:22:41 +00:00
use crate::snippet::{PostfixSnippet, Snippet};
2020-11-10 21:40:07 +00:00
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CompletionConfig {
pub enable_postfix_completions: bool,
pub enable_imports_on_the_fly: bool,
2021-05-30 14:41:33 +00:00
pub enable_self_on_the_fly: bool,
pub add_call_parenthesis: bool,
pub add_call_argument_snippets: bool,
2020-04-24 00:06:12 +00:00
pub snippet_cap: Option<SnippetCap>,
pub insert_use: InsertUseConfig,
pub postfix_snippets: Vec<PostfixSnippet>,
2021-10-04 17:22:41 +00:00
pub snippets: Vec<Snippet>,
2020-04-24 00:06:12 +00:00
}