mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Merge #7578
7578: Add a semantic token type for char literals r=Veykril a=petr-tik Fixes #7530 The LSP spec doesn't recognise character literals, so had to extend the suported types to our own custom type Co-authored-by: petr-tik <petr-tik@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,7 @@ macro_rules! define_semantic_token_types {
|
||||
(BRACE, "brace"),
|
||||
(BRACKET, "bracket"),
|
||||
(BUILTIN_TYPE, "builtinType"),
|
||||
(CHAR_LITERAL, "characterLiteral"),
|
||||
(COMMA, "comma"),
|
||||
(COLON, "colon"),
|
||||
(DOT, "dot"),
|
||||
|
||||
@@ -426,7 +426,8 @@ fn semantic_token_type_and_modifiers(
|
||||
HlTag::None => semantic_tokens::GENERIC,
|
||||
HlTag::ByteLiteral | HlTag::NumericLiteral => lsp_types::SemanticTokenType::NUMBER,
|
||||
HlTag::BoolLiteral => semantic_tokens::BOOLEAN,
|
||||
HlTag::CharLiteral | HlTag::StringLiteral => lsp_types::SemanticTokenType::STRING,
|
||||
HlTag::StringLiteral => lsp_types::SemanticTokenType::STRING,
|
||||
HlTag::CharLiteral => semantic_tokens::CHAR_LITERAL,
|
||||
HlTag::Comment => lsp_types::SemanticTokenType::COMMENT,
|
||||
HlTag::Attribute => semantic_tokens::ATTRIBUTE,
|
||||
HlTag::Keyword => lsp_types::SemanticTokenType::KEYWORD,
|
||||
|
||||
Reference in New Issue
Block a user