mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Rename Type => TypeAlias
This commit is contained in:
parent
61d9612633
commit
bd8ed644e4
12 changed files with 57 additions and 43 deletions
|
@ -46,7 +46,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
|
|||
}
|
||||
}
|
||||
hir::ImplItem::Const(ct) => acc.add_const(ctx, ct),
|
||||
hir::ImplItem::Type(ty) => acc.add_type(ctx, ty),
|
||||
hir::ImplItem::TypeAlias(ty) => acc.add_type_alias(ctx, ty),
|
||||
}
|
||||
None::<()>
|
||||
});
|
||||
|
|
|
@ -65,7 +65,7 @@ impl Completions {
|
|||
Resolution::Def(Const(it)) => (CompletionItemKind::Const, it.docs(ctx.db)),
|
||||
Resolution::Def(Static(it)) => (CompletionItemKind::Static, it.docs(ctx.db)),
|
||||
Resolution::Def(Trait(it)) => (CompletionItemKind::Trait, it.docs(ctx.db)),
|
||||
Resolution::Def(Type(it)) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)),
|
||||
Resolution::Def(TypeAlias(it)) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)),
|
||||
Resolution::GenericParam(..) => (CompletionItemKind::TypeParam, None),
|
||||
Resolution::LocalBinding(..) => (CompletionItemKind::Binding, None),
|
||||
Resolution::SelfType(..) => (
|
||||
|
@ -132,7 +132,7 @@ impl Completions {
|
|||
.add_to(self);
|
||||
}
|
||||
|
||||
pub(crate) fn add_type(&mut self, ctx: &CompletionContext, type_alias: hir::Type) {
|
||||
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 name = match type_def.name() {
|
||||
Some(name) => name,
|
||||
|
|
|
@ -154,7 +154,7 @@ impl NavigationTarget {
|
|||
let (file_id, node) = e.source(db);
|
||||
NavigationTarget::from_named(file_id.original_file(db), &*node)
|
||||
}
|
||||
hir::ModuleDef::Type(e) => {
|
||||
hir::ModuleDef::TypeAlias(e) => {
|
||||
let (file_id, node) = e.source(db);
|
||||
NavigationTarget::from_named(file_id.original_file(db), &*node)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue