Skip to content

Commit b26733f

Browse files
committed
Change attribute semantic token type to decorator
1 parent 9700c95 commit b26733f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/rust-analyzer/src/semantic_tokens.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ macro_rules! define_semantic_token_types {
4040
define_semantic_token_types![
4141
(ANGLE, "angle"),
4242
(ARITHMETIC, "arithmetic"),
43-
(ATTRIBUTE, "attribute"),
4443
(ATTRIBUTE_BRACKET, "attributeBracket"),
4544
(BITWISE, "bitwise"),
4645
(BOOLEAN, "boolean"),
@@ -53,6 +52,8 @@ define_semantic_token_types![
5352
(COMMA, "comma"),
5453
(COMPARISON, "comparison"),
5554
(CONST_PARAMETER, "constParameter"),
55+
// FIXME: to be replaced once lsp-types has the upstream version
56+
(DECORATOR, "decorator"),
5657
(DERIVE, "derive"),
5758
(DERIVE_HELPER, "deriveHelper"),
5859
(DOT, "dot"),
@@ -63,7 +64,6 @@ define_semantic_token_types![
6364
(LIFETIME, "lifetime"),
6465
(LOGICAL, "logical"),
6566
(MACRO_BANG, "macroBang"),
66-
(OPERATOR, "operator"),
6767
(PARENTHESIS, "parenthesis"),
6868
(PUNCTUATION, "punctuation"),
6969
(SELF_KEYWORD, "selfKeyword"),

crates/rust-analyzer/src/to_proto.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ fn semantic_token_type_and_modifiers(
558558
let mut mods = semantic_tokens::ModifierSet::default();
559559
let type_ = match highlight.tag {
560560
HlTag::Symbol(symbol) => match symbol {
561-
SymbolKind::Attribute => semantic_tokens::ATTRIBUTE,
561+
SymbolKind::Attribute => semantic_tokens::DECORATOR,
562562
SymbolKind::Derive => semantic_tokens::DERIVE,
563563
SymbolKind::DeriveHelper => semantic_tokens::DERIVE_HELPER,
564564
SymbolKind::Module => lsp_types::SemanticTokenType::NAMESPACE,
@@ -613,7 +613,7 @@ fn semantic_token_type_and_modifiers(
613613
HlOperator::Arithmetic => semantic_tokens::ARITHMETIC,
614614
HlOperator::Logical => semantic_tokens::LOGICAL,
615615
HlOperator::Comparison => semantic_tokens::COMPARISON,
616-
HlOperator::Other => semantic_tokens::OPERATOR,
616+
HlOperator::Other => lsp_types::SemanticTokenType::OPERATOR,
617617
},
618618
HlTag::StringLiteral => lsp_types::SemanticTokenType::STRING,
619619
HlTag::UnresolvedReference => semantic_tokens::UNRESOLVED_REFERENCE,

0 commit comments

Comments
 (0)