From 5fd5de4061362aa1066cb9a47aa9cb79eab38e47 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 02:26:38 +0200 Subject: Make sure that adding a snippet requires corresponding capability --- crates/ra_ide/src/completion/completion_item.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/completion/completion_item.rs') diff --git a/crates/ra_ide/src/completion/completion_item.rs b/crates/ra_ide/src/completion/completion_item.rs index edbf4a5b7..fb06cc125 100644 --- a/crates/ra_ide/src/completion/completion_item.rs +++ b/crates/ra_ide/src/completion/completion_item.rs @@ -2,6 +2,7 @@ use std::fmt; +use super::completion_config::SnippetCap; use hir::Documentation; use ra_syntax::TextRange; use ra_text_edit::TextEdit; @@ -270,7 +271,11 @@ impl Builder { self.insert_text = Some(insert_text.into()); self } - pub(crate) fn insert_snippet(mut self, snippet: impl Into) -> Builder { + pub(crate) fn insert_snippet( + mut self, + _cap: SnippetCap, + snippet: impl Into, + ) -> Builder { self.insert_text_format = InsertTextFormat::Snippet; self.insert_text(snippet) } @@ -282,7 +287,7 @@ impl Builder { self.text_edit = Some(edit); self } - pub(crate) fn snippet_edit(mut self, edit: TextEdit) -> Builder { + pub(crate) fn snippet_edit(mut self, _cap: SnippetCap, edit: TextEdit) -> Builder { self.insert_text_format = InsertTextFormat::Snippet; self.text_edit(edit) } -- cgit v1.2.3