Skip to content

Commit da40149

Browse files
committed
Fix union classification
1 parent 2995fd2 commit da40149

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

crates/ra_ide/src/syntax_highlighting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight {
292292
match parent.kind() {
293293
STRUCT_DEF => HighlightTag::Struct.into(),
294294
ENUM_DEF => HighlightTag::Enum.into(),
295-
UNION_KW => HighlightTag::Union.into(),
295+
UNION_DEF => HighlightTag::Union.into(),
296296
TRAIT_DEF => HighlightTag::Trait.into(),
297297
TYPE_ALIAS_DEF => HighlightTag::TypeAlias.into(),
298298
TYPE_PARAM => HighlightTag::TypeParam.into(),

crates/ra_ide_db/src/defs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
9090
let def: hir::Struct = sema.to_def(&it)?;
9191
Some(from_module_def(def.into()))
9292
},
93+
ast::UnionDef(it) => {
94+
let def: hir::Union = sema.to_def(&it)?;
95+
Some(from_module_def(def.into()))
96+
},
9397
ast::EnumDef(it) => {
9498
let def: hir::Enum = sema.to_def(&it)?;
9599
Some(from_module_def(def.into()))

editors/code/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,12 @@
460460
{
461461
"selector": "typeAlias",
462462
"scope": [
463-
"entity.name.type",
464463
"entity.name.typeAlias"
465464
]
466465
},
467466
{
468467
"selector": "union",
469468
"scope": [
470-
"entity.name.type",
471469
"entity.name.union"
472470
]
473471
},

0 commit comments

Comments
 (0)