From 47464e556c160ce705c2e3c84f501ad4e8dbb123 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 1 Dec 2020 22:46:06 +0200 Subject: Properly fill client completion resolve capabilities data --- crates/completion/src/config.rs | 10 ++++++++++ crates/completion/src/lib.rs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'crates/completion/src') 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 @@ //! completions if we are allowed to. use ide_db::helpers::insert_use::MergeBehaviour; +use rustc_hash::FxHashSet; #[derive(Clone, Debug, PartialEq, Eq)] pub struct CompletionConfig { @@ -14,6 +15,14 @@ pub struct CompletionConfig { pub add_call_argument_snippets: bool, pub snippet_cap: Option, pub merge: Option, + pub resolve_capabilities: FxHashSet, +} + +#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)] +pub enum CompletionResolveCapability { + Documentation, + Detail, + AdditionalTextEdits, } impl CompletionConfig { @@ -36,6 +45,7 @@ impl Default for CompletionConfig { add_call_argument_snippets: true, snippet_cap: Some(SnippetCap { _private: () }), merge: Some(MergeBehaviour::Full), + resolve_capabilities: FxHashSet::default(), } } } 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; use crate::{completions::Completions, context::CompletionContext, item::CompletionKind}; pub use crate::{ - config::CompletionConfig, + config::{CompletionConfig, CompletionResolveCapability}, item::{CompletionItem, CompletionItemKind, CompletionScore, ImportToAdd, InsertTextFormat}, }; -- cgit v1.2.3