Move CompletionConfig to a separate module

This commit is contained in:
Aleksey Kladov 2020-04-24 02:01:23 +02:00
parent 88d243c742
commit bd3b239390
2 changed files with 20 additions and 19 deletions

View File

@ -1,5 +1,6 @@
//! FIXME: write short doc here
mod completion_config;
mod completion_item;
mod completion_context;
mod presentation;
@ -28,27 +29,11 @@
FilePosition,
};
pub use crate::completion::completion_item::{
CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat,
pub use crate::completion::{
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.
///
/// First, we look at the position and collect a so-called `CompletionContext.

View 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,
}
}
}