Use CompletionTextEdit::InsertAndReplace if supported by the client

This commit is contained in:
Lukas Wirth
2021-04-08 14:22:54 +02:00
parent 3191a93185
commit 8fa3011908
5 changed files with 50 additions and 20 deletions

View File

@@ -656,6 +656,19 @@ impl Config {
pub fn code_lens_refresh(&self) -> bool {
try_or!(self.caps.workspace.as_ref()?.code_lens.as_ref()?.refresh_support?, false)
}
pub fn insert_replace_support(&self) -> bool {
try_or!(
self.caps
.text_document
.as_ref()?
.completion
.as_ref()?
.completion_item
.as_ref()?
.insert_replace_support?,
false
)
}
}
#[derive(Deserialize, Debug, Clone)]