mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Properly fill client completion resolve capabilities data
This commit is contained in:
parent
9a4daffe16
commit
47464e556c
5 changed files with 56 additions and 5 deletions
|
@ -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<SnippetCap>,
|
||||
pub merge: Option<MergeBehaviour>,
|
||||
pub resolve_capabilities: FxHashSet<CompletionResolveCapability>,
|
||||
}
|
||||
|
||||
#[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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue