diff options
Diffstat (limited to 'crates/completion')
-rw-r--r-- | crates/completion/src/config.rs | 10 | ||||
-rw-r--r-- | crates/completion/src/lib.rs | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/crates/completion/src/config.rs b/crates/completion/src/config.rs index 654a76f7b..736af455e 100644 --- a/crates/completion/src/config.rs +++ b/crates/completion/src/config.rs | |||
@@ -5,6 +5,7 @@ | |||
5 | //! completions if we are allowed to. | 5 | //! completions if we are allowed to. |
6 | 6 | ||
7 | use ide_db::helpers::insert_use::MergeBehaviour; | 7 | use ide_db::helpers::insert_use::MergeBehaviour; |
8 | use rustc_hash::FxHashSet; | ||
8 | 9 | ||
9 | #[derive(Clone, Debug, PartialEq, Eq)] | 10 | #[derive(Clone, Debug, PartialEq, Eq)] |
10 | pub struct CompletionConfig { | 11 | pub struct CompletionConfig { |
@@ -14,6 +15,14 @@ pub struct CompletionConfig { | |||
14 | pub add_call_argument_snippets: bool, | 15 | pub add_call_argument_snippets: bool, |
15 | pub snippet_cap: Option<SnippetCap>, | 16 | pub snippet_cap: Option<SnippetCap>, |
16 | pub merge: Option<MergeBehaviour>, | 17 | pub merge: Option<MergeBehaviour>, |
18 | pub resolve_capabilities: FxHashSet<CompletionResolveCapability>, | ||
19 | } | ||
20 | |||
21 | #[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)] | ||
22 | pub enum CompletionResolveCapability { | ||
23 | Documentation, | ||
24 | Detail, | ||
25 | AdditionalTextEdits, | ||
17 | } | 26 | } |
18 | 27 | ||
19 | impl CompletionConfig { | 28 | impl CompletionConfig { |
@@ -36,6 +45,7 @@ impl Default for CompletionConfig { | |||
36 | add_call_argument_snippets: true, | 45 | add_call_argument_snippets: true, |
37 | snippet_cap: Some(SnippetCap { _private: () }), | 46 | snippet_cap: Some(SnippetCap { _private: () }), |
38 | merge: Some(MergeBehaviour::Full), | 47 | merge: Some(MergeBehaviour::Full), |
48 | resolve_capabilities: FxHashSet::default(), | ||
39 | } | 49 | } |
40 | } | 50 | } |
41 | } | 51 | } |
diff --git a/crates/completion/src/lib.rs b/crates/completion/src/lib.rs index 28209d4e0..c689b0dde 100644 --- a/crates/completion/src/lib.rs +++ b/crates/completion/src/lib.rs | |||
@@ -17,7 +17,7 @@ use ide_db::RootDatabase; | |||
17 | use crate::{completions::Completions, context::CompletionContext, item::CompletionKind}; | 17 | use crate::{completions::Completions, context::CompletionContext, item::CompletionKind}; |
18 | 18 | ||
19 | pub use crate::{ | 19 | pub use crate::{ |
20 | config::CompletionConfig, | 20 | config::{CompletionConfig, CompletionResolveCapability}, |
21 | item::{CompletionItem, CompletionItemKind, CompletionScore, ImportToAdd, InsertTextFormat}, | 21 | item::{CompletionItem, CompletionItemKind, CompletionScore, ImportToAdd, InsertTextFormat}, |
22 | }; | 22 | }; |
23 | 23 | ||