Move CompletionConfig to a separate module
This commit is contained in:
parent
88d243c742
commit
bd3b239390
@ -1,5 +1,6 @@
|
|||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
|
|
||||||
|
mod completion_config;
|
||||||
mod completion_item;
|
mod completion_item;
|
||||||
mod completion_context;
|
mod completion_context;
|
||||||
mod presentation;
|
mod presentation;
|
||||||
@ -28,27 +29,11 @@ use crate::{
|
|||||||
FilePosition,
|
FilePosition,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use crate::completion::completion_item::{
|
pub use crate::completion::{
|
||||||
CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat,
|
completion_config::CompletionConfig,
|
||||||
|
completion_item::{CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
||||||
pub struct CompletionConfig {
|
|
||||||
pub enable_postfix_completions: bool,
|
|
||||||
pub add_call_parenthesis: bool,
|
|
||||||
pub add_call_argument_snippets: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for CompletionConfig {
|
|
||||||
fn default() -> Self {
|
|
||||||
CompletionConfig {
|
|
||||||
enable_postfix_completions: true,
|
|
||||||
add_call_parenthesis: true,
|
|
||||||
add_call_argument_snippets: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Main entry point for completion. We run completion as a two-phase process.
|
/// Main entry point for completion. We run completion as a two-phase process.
|
||||||
///
|
///
|
||||||
/// First, we look at the position and collect a so-called `CompletionContext.
|
/// First, we look at the position and collect a so-called `CompletionContext.
|
||||||
|
16
crates/ra_ide/src/completion/completion_config.rs
Normal file
16
crates/ra_ide/src/completion/completion_config.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
|
pub struct CompletionConfig {
|
||||||
|
pub enable_postfix_completions: bool,
|
||||||
|
pub add_call_parenthesis: bool,
|
||||||
|
pub add_call_argument_snippets: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for CompletionConfig {
|
||||||
|
fn default() -> Self {
|
||||||
|
CompletionConfig {
|
||||||
|
enable_postfix_completions: true,
|
||||||
|
add_call_parenthesis: true,
|
||||||
|
add_call_argument_snippets: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user