mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
scip: Populate SymbolInformation::kind
SymbolInformation::kind is finer-grained than the SCIP symbol suffix. This also fixes a bug where all type aliases where treated like type parameters. ``` trait SomeTrait { type AssociatedType; // ← this is SomeTrait#[AssociatedType] } type MyTypeAlias = u8; // ← this used to be [MyTypeAlias] // and now is MyTypeAlias# ```
This commit is contained in:
parent
566bb77f91
commit
73d9c77f2a
5 changed files with 248 additions and 75 deletions
|
@ -10,7 +10,7 @@ use hir::{
|
|||
Adt, AsAssocItem, AssocItem, AttributeTemplate, BuiltinAttr, BuiltinType, Const, Crate,
|
||||
DefWithBody, DeriveHelper, DocLinkDef, ExternCrateDecl, Field, Function, GenericParam,
|
||||
HasVisibility, HirDisplay, Impl, Label, Local, Macro, Module, ModuleDef, Name, PathResolution,
|
||||
Semantics, Static, ToolModule, Trait, TraitAlias, TypeAlias, Variant, Visibility,
|
||||
Semantics, Static, ToolModule, Trait, TraitAlias, TypeAlias, Variant, VariantDef, Visibility,
|
||||
};
|
||||
use stdx::{format_to, impl_from};
|
||||
use syntax::{
|
||||
|
@ -791,6 +791,12 @@ impl From<DocLinkDef> for Definition {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<VariantDef> for Definition {
|
||||
fn from(def: VariantDef) -> Self {
|
||||
ModuleDef::from(def).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<DefWithBody> for Definition {
|
||||
type Error = ();
|
||||
fn try_from(def: DefWithBody) -> Result<Self, Self::Error> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue