More orthogonal method naming
This commit is contained in:
parent
3dfb16be69
commit
79f35cc699
4 changed files with 4 additions and 9 deletions
|
@ -40,7 +40,7 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC
|
|||
fn keyword(ctx: &CompletionContext, kw: &str, snippet: &str) -> CompletionItem {
|
||||
CompletionItem::new(CompletionKind::Keyword, ctx.source_range(), kw)
|
||||
.kind(CompletionItemKind::Keyword)
|
||||
.snippet(snippet)
|
||||
.insert_snippet(snippet)
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ fn postfix_snippet(ctx: &CompletionContext, label: &str, detail: &str, snippet:
|
|||
let mut builder = TextEditBuilder::default();
|
||||
builder.delete(delete_range);
|
||||
CompletionItem::new(CompletionKind::Postfix, replace_range, label)
|
||||
.snippet(snippet)
|
||||
.insert_snippet(snippet)
|
||||
.detail(detail)
|
||||
.text_edit(builder.finish())
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::completion::{CompletionItem, Completions, CompletionKind, CompletionI
|
|||
|
||||
fn snippet(ctx: &CompletionContext, label: &str, snippet: &str) -> Builder {
|
||||
CompletionItem::new(CompletionKind::Snippet, ctx.source_range(), label)
|
||||
.snippet(snippet)
|
||||
.insert_snippet(snippet)
|
||||
.kind(CompletionItemKind::Snippet)
|
||||
}
|
||||
|
||||
|
|
|
@ -199,12 +199,7 @@ impl Builder {
|
|||
self.insert_text = Some(insert_text.into());
|
||||
self
|
||||
}
|
||||
#[allow(unused)]
|
||||
pub(crate) fn insert_text_format(mut self, insert_text_format: InsertTextFormat) -> Builder {
|
||||
self.insert_text_format = insert_text_format;
|
||||
self
|
||||
}
|
||||
pub(crate) fn snippet(mut self, snippet: impl Into<String>) -> Builder {
|
||||
pub(crate) fn insert_snippet(mut self, snippet: impl Into<String>) -> Builder {
|
||||
self.insert_text_format = InsertTextFormat::Snippet;
|
||||
self.insert_text(snippet)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue