mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-29 03:27:44 +00:00
Change attribute semantic token type to decorator
This commit is contained in:
parent
9700c95ced
commit
b26733f8a0
@ -40,7 +40,6 @@ macro_rules! define_semantic_token_types {
|
|||||||
define_semantic_token_types![
|
define_semantic_token_types![
|
||||||
(ANGLE, "angle"),
|
(ANGLE, "angle"),
|
||||||
(ARITHMETIC, "arithmetic"),
|
(ARITHMETIC, "arithmetic"),
|
||||||
(ATTRIBUTE, "attribute"),
|
|
||||||
(ATTRIBUTE_BRACKET, "attributeBracket"),
|
(ATTRIBUTE_BRACKET, "attributeBracket"),
|
||||||
(BITWISE, "bitwise"),
|
(BITWISE, "bitwise"),
|
||||||
(BOOLEAN, "boolean"),
|
(BOOLEAN, "boolean"),
|
||||||
@ -53,6 +52,8 @@ define_semantic_token_types![
|
|||||||
(COMMA, "comma"),
|
(COMMA, "comma"),
|
||||||
(COMPARISON, "comparison"),
|
(COMPARISON, "comparison"),
|
||||||
(CONST_PARAMETER, "constParameter"),
|
(CONST_PARAMETER, "constParameter"),
|
||||||
|
// FIXME: to be replaced once lsp-types has the upstream version
|
||||||
|
(DECORATOR, "decorator"),
|
||||||
(DERIVE, "derive"),
|
(DERIVE, "derive"),
|
||||||
(DERIVE_HELPER, "deriveHelper"),
|
(DERIVE_HELPER, "deriveHelper"),
|
||||||
(DOT, "dot"),
|
(DOT, "dot"),
|
||||||
@ -63,7 +64,6 @@ define_semantic_token_types![
|
|||||||
(LIFETIME, "lifetime"),
|
(LIFETIME, "lifetime"),
|
||||||
(LOGICAL, "logical"),
|
(LOGICAL, "logical"),
|
||||||
(MACRO_BANG, "macroBang"),
|
(MACRO_BANG, "macroBang"),
|
||||||
(OPERATOR, "operator"),
|
|
||||||
(PARENTHESIS, "parenthesis"),
|
(PARENTHESIS, "parenthesis"),
|
||||||
(PUNCTUATION, "punctuation"),
|
(PUNCTUATION, "punctuation"),
|
||||||
(SELF_KEYWORD, "selfKeyword"),
|
(SELF_KEYWORD, "selfKeyword"),
|
||||||
|
@ -558,7 +558,7 @@ fn semantic_token_type_and_modifiers(
|
|||||||
let mut mods = semantic_tokens::ModifierSet::default();
|
let mut mods = semantic_tokens::ModifierSet::default();
|
||||||
let type_ = match highlight.tag {
|
let type_ = match highlight.tag {
|
||||||
HlTag::Symbol(symbol) => match symbol {
|
HlTag::Symbol(symbol) => match symbol {
|
||||||
SymbolKind::Attribute => semantic_tokens::ATTRIBUTE,
|
SymbolKind::Attribute => semantic_tokens::DECORATOR,
|
||||||
SymbolKind::Derive => semantic_tokens::DERIVE,
|
SymbolKind::Derive => semantic_tokens::DERIVE,
|
||||||
SymbolKind::DeriveHelper => semantic_tokens::DERIVE_HELPER,
|
SymbolKind::DeriveHelper => semantic_tokens::DERIVE_HELPER,
|
||||||
SymbolKind::Module => lsp_types::SemanticTokenType::NAMESPACE,
|
SymbolKind::Module => lsp_types::SemanticTokenType::NAMESPACE,
|
||||||
@ -613,7 +613,7 @@ fn semantic_token_type_and_modifiers(
|
|||||||
HlOperator::Arithmetic => semantic_tokens::ARITHMETIC,
|
HlOperator::Arithmetic => semantic_tokens::ARITHMETIC,
|
||||||
HlOperator::Logical => semantic_tokens::LOGICAL,
|
HlOperator::Logical => semantic_tokens::LOGICAL,
|
||||||
HlOperator::Comparison => semantic_tokens::COMPARISON,
|
HlOperator::Comparison => semantic_tokens::COMPARISON,
|
||||||
HlOperator::Other => semantic_tokens::OPERATOR,
|
HlOperator::Other => lsp_types::SemanticTokenType::OPERATOR,
|
||||||
},
|
},
|
||||||
HlTag::StringLiteral => lsp_types::SemanticTokenType::STRING,
|
HlTag::StringLiteral => lsp_types::SemanticTokenType::STRING,
|
||||||
HlTag::UnresolvedReference => semantic_tokens::UNRESOLVED_REFERENCE,
|
HlTag::UnresolvedReference => semantic_tokens::UNRESOLVED_REFERENCE,
|
||||||
|
Loading…
Reference in New Issue
Block a user