mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Partially unify SymbolKind and CompletionItemKind
This commit is contained in:
parent
563a175fdb
commit
f2cb7dbcb7
13 changed files with 128 additions and 110 deletions
|
@ -32,7 +32,7 @@
|
|||
//! ```
|
||||
|
||||
use hir::{self, HasAttrs, HasSource};
|
||||
use ide_db::traits::get_missing_assoc_items;
|
||||
use ide_db::{traits::get_missing_assoc_items, SymbolKind};
|
||||
use syntax::{
|
||||
ast::{self, edit, Impl},
|
||||
display::function_declaration,
|
||||
|
@ -152,7 +152,7 @@ fn add_function_impl(
|
|||
let completion_kind = if func.self_param(ctx.db).is_some() {
|
||||
CompletionItemKind::Method
|
||||
} else {
|
||||
CompletionItemKind::Function
|
||||
CompletionItemKind::SymbolKind(SymbolKind::Function)
|
||||
};
|
||||
let range = TextRange::new(fn_def_node.text_range().start(), ctx.source_range().end());
|
||||
|
||||
|
@ -188,7 +188,7 @@ fn add_type_alias_impl(
|
|||
CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone())
|
||||
.text_edit(TextEdit::replace(range, snippet))
|
||||
.lookup_by(alias_name)
|
||||
.kind(CompletionItemKind::TypeAlias)
|
||||
.kind(SymbolKind::TypeAlias)
|
||||
.set_documentation(type_alias.docs(ctx.db))
|
||||
.add_to(acc);
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ fn add_const_impl(
|
|||
CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone())
|
||||
.text_edit(TextEdit::replace(range, snippet))
|
||||
.lookup_by(const_name)
|
||||
.kind(CompletionItemKind::Const)
|
||||
.kind(SymbolKind::Const)
|
||||
.set_documentation(const_.docs(ctx.db))
|
||||
.add_to(acc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue