Add LifetimeParam and ConstParam to CompletionItemKind

This commit is contained in:
Lukas Wirth 2021-01-19 20:21:56 +01:00
parent f647e134a7
commit 83e49200d8
4 changed files with 34 additions and 24 deletions

View file

@ -208,7 +208,11 @@ impl<'a> Render<'a> {
ScopeDef::ModuleDef(Trait(..)) => CompletionItemKind::Trait,
ScopeDef::ModuleDef(TypeAlias(..)) => CompletionItemKind::TypeAlias,
ScopeDef::ModuleDef(BuiltinType(..)) => CompletionItemKind::BuiltinType,
ScopeDef::GenericParam(..) => CompletionItemKind::TypeParam,
ScopeDef::GenericParam(param) => match param {
hir::GenericParam::TypeParam(_) => CompletionItemKind::TypeParam,
hir::GenericParam::LifetimeParam(_) => CompletionItemKind::LifetimeParam,
hir::GenericParam::ConstParam(_) => CompletionItemKind::ConstParam,
},
ScopeDef::Local(..) => CompletionItemKind::Binding,
// (does this need its own kind?)
ScopeDef::AdtSelfType(..) | ScopeDef::ImplSelfType(..) => CompletionItemKind::TypeParam,