Merge #3364
3364: Fix union classification r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
9ef6359950
3 changed files with 5 additions and 3 deletions
|
@ -292,7 +292,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight {
|
||||||
match parent.kind() {
|
match parent.kind() {
|
||||||
STRUCT_DEF => HighlightTag::Struct.into(),
|
STRUCT_DEF => HighlightTag::Struct.into(),
|
||||||
ENUM_DEF => HighlightTag::Enum.into(),
|
ENUM_DEF => HighlightTag::Enum.into(),
|
||||||
UNION_KW => HighlightTag::Union.into(),
|
UNION_DEF => HighlightTag::Union.into(),
|
||||||
TRAIT_DEF => HighlightTag::Trait.into(),
|
TRAIT_DEF => HighlightTag::Trait.into(),
|
||||||
TYPE_ALIAS_DEF => HighlightTag::TypeAlias.into(),
|
TYPE_ALIAS_DEF => HighlightTag::TypeAlias.into(),
|
||||||
TYPE_PARAM => HighlightTag::TypeParam.into(),
|
TYPE_PARAM => HighlightTag::TypeParam.into(),
|
||||||
|
|
|
@ -90,6 +90,10 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
|
||||||
let def: hir::Struct = sema.to_def(&it)?;
|
let def: hir::Struct = sema.to_def(&it)?;
|
||||||
Some(from_module_def(def.into()))
|
Some(from_module_def(def.into()))
|
||||||
},
|
},
|
||||||
|
ast::UnionDef(it) => {
|
||||||
|
let def: hir::Union = sema.to_def(&it)?;
|
||||||
|
Some(from_module_def(def.into()))
|
||||||
|
},
|
||||||
ast::EnumDef(it) => {
|
ast::EnumDef(it) => {
|
||||||
let def: hir::Enum = sema.to_def(&it)?;
|
let def: hir::Enum = sema.to_def(&it)?;
|
||||||
Some(from_module_def(def.into()))
|
Some(from_module_def(def.into()))
|
||||||
|
|
|
@ -460,14 +460,12 @@
|
||||||
{
|
{
|
||||||
"selector": "typeAlias",
|
"selector": "typeAlias",
|
||||||
"scope": [
|
"scope": [
|
||||||
"entity.name.type",
|
|
||||||
"entity.name.typeAlias"
|
"entity.name.typeAlias"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"selector": "union",
|
"selector": "union",
|
||||||
"scope": [
|
"scope": [
|
||||||
"entity.name.type",
|
|
||||||
"entity.name.union"
|
"entity.name.union"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue