mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Unify naming
This commit is contained in:
parent
c01ef6eaba
commit
7e217a42e1
13 changed files with 90 additions and 103 deletions
|
@ -69,20 +69,19 @@ fn build_completion(
|
|||
ctx: RenderContext<'_>,
|
||||
name: String,
|
||||
pat: String,
|
||||
item: impl HasAttrs + Copy,
|
||||
def: impl HasAttrs + Copy,
|
||||
) -> CompletionItem {
|
||||
let mut completion = CompletionItem::new(CompletionKind::Snippet, ctx.source_range(), name);
|
||||
completion
|
||||
.kind(CompletionItemKind::Binding)
|
||||
.set_documentation(ctx.docs(item))
|
||||
.set_deprecated(ctx.is_deprecated(item))
|
||||
let mut item = CompletionItem::new(CompletionKind::Snippet, ctx.source_range(), name);
|
||||
item.kind(CompletionItemKind::Binding)
|
||||
.set_documentation(ctx.docs(def))
|
||||
.set_deprecated(ctx.is_deprecated(def))
|
||||
.detail(&pat);
|
||||
if let Some(snippet_cap) = ctx.snippet_cap() {
|
||||
completion.insert_snippet(snippet_cap, pat);
|
||||
item.insert_snippet(snippet_cap, pat);
|
||||
} else {
|
||||
completion.insert_text(pat);
|
||||
item.insert_text(pat);
|
||||
};
|
||||
completion.build()
|
||||
item.build()
|
||||
}
|
||||
|
||||
fn render_pat(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue