Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ra_ide/src/syntax_highlighting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight {
match parent.kind() {
STRUCT_DEF => HighlightTag::Struct.into(),
ENUM_DEF => HighlightTag::Enum.into(),
UNION_KW => HighlightTag::Union.into(),
UNION_DEF => HighlightTag::Union.into(),
TRAIT_DEF => HighlightTag::Trait.into(),
TYPE_ALIAS_DEF => HighlightTag::TypeAlias.into(),
TYPE_PARAM => HighlightTag::TypeParam.into(),
Expand Down
4 changes: 4 additions & 0 deletions crates/ra_ide_db/src/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
let def: hir::Struct = sema.to_def(&it)?;
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) => {
let def: hir::Enum = sema.to_def(&it)?;
Some(from_module_def(def.into()))
Expand Down
2 changes: 0 additions & 2 deletions editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,12 @@
{
"selector": "typeAlias",
"scope": [
"entity.name.type",
"entity.name.typeAlias"
]
},
{
"selector": "union",
"scope": [
"entity.name.type",
"entity.name.union"
]
},
Expand Down