Skip to content

Commit bd3b239

Browse files
committed
Move CompletionConfig to a separate module
1 parent 88d243c commit bd3b239

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

crates/ra_ide/src/completion.rs

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! FIXME: write short doc here
22
3+
mod completion_config;
34
mod completion_item;
45
mod completion_context;
56
mod presentation;
@@ -28,27 +29,11 @@ use crate::{
2829
FilePosition,
2930
};
3031

31-
pub use crate::completion::completion_item::{
32-
CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat,
32+
pub use crate::completion::{
33+
completion_config::CompletionConfig,
34+
completion_item::{CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat},
3335
};
3436

35-
#[derive(Clone, Debug, PartialEq, Eq)]
36-
pub struct CompletionConfig {
37-
pub enable_postfix_completions: bool,
38-
pub add_call_parenthesis: bool,
39-
pub add_call_argument_snippets: bool,
40-
}
41-
42-
impl Default for CompletionConfig {
43-
fn default() -> Self {
44-
CompletionConfig {
45-
enable_postfix_completions: true,
46-
add_call_parenthesis: true,
47-
add_call_argument_snippets: true,
48-
}
49-
}
50-
}
51-
5237
/// Main entry point for completion. We run completion as a two-phase process.
5338
///
5439
/// First, we look at the position and collect a so-called `CompletionContext.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#[derive(Clone, Debug, PartialEq, Eq)]
2+
pub struct CompletionConfig {
3+
pub enable_postfix_completions: bool,
4+
pub add_call_parenthesis: bool,
5+
pub add_call_argument_snippets: bool,
6+
}
7+
8+
impl Default for CompletionConfig {
9+
fn default() -> Self {
10+
CompletionConfig {
11+
enable_postfix_completions: true,
12+
add_call_parenthesis: true,
13+
add_call_argument_snippets: true,
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)