mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
use Source for TypeAlias
This commit is contained in:
parent
647c8f3df8
commit
f2ccc54468
7 changed files with 22 additions and 38 deletions
|
@ -141,13 +141,12 @@ impl Completions {
|
|||
}
|
||||
|
||||
pub(crate) fn add_type_alias(&mut self, ctx: &CompletionContext, type_alias: hir::TypeAlias) {
|
||||
let (_file_id, type_def) = type_alias.source(ctx.db);
|
||||
let type_def = type_alias.source(ctx.db).ast;
|
||||
let name = match type_def.name() {
|
||||
Some(name) => name,
|
||||
_ => return,
|
||||
};
|
||||
let (_, ast_node) = type_alias.source(ctx.db);
|
||||
let detail = type_label(&ast_node);
|
||||
let detail = type_label(&type_def);
|
||||
|
||||
CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name.text().to_string())
|
||||
.kind(CompletionItemKind::TypeAlias)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue