mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Fix highlighting of Self
This commit is contained in:
parent
c0d6471143
commit
5c0aee013e
9 changed files with 19 additions and 4 deletions
|
@ -66,6 +66,7 @@ define_semantic_token_types![
|
|||
(PARENTHESIS, "parenthesis"),
|
||||
(PUNCTUATION, "punctuation"),
|
||||
(SELF_KEYWORD, "selfKeyword"),
|
||||
(SELF_TYPE_KEYWORD, "selfTypeKeyword"),
|
||||
(SEMICOLON, "semicolon"),
|
||||
(TYPE_ALIAS, "typeAlias"),
|
||||
(TOOL_MODULE, "toolModule"),
|
||||
|
|
|
@ -55,7 +55,9 @@ pub(crate) fn symbol_kind(symbol_kind: SymbolKind) -> lsp_types::SymbolKind {
|
|||
| SymbolKind::Attribute
|
||||
| SymbolKind::Derive => lsp_types::SymbolKind::FUNCTION,
|
||||
SymbolKind::Module | SymbolKind::ToolModule => lsp_types::SymbolKind::MODULE,
|
||||
SymbolKind::TypeAlias | SymbolKind::TypeParam => lsp_types::SymbolKind::TYPE_PARAMETER,
|
||||
SymbolKind::TypeAlias | SymbolKind::TypeParam | SymbolKind::SelfType => {
|
||||
lsp_types::SymbolKind::TYPE_PARAMETER
|
||||
}
|
||||
SymbolKind::Field => lsp_types::SymbolKind::FIELD,
|
||||
SymbolKind::Static => lsp_types::SymbolKind::CONSTANT,
|
||||
SymbolKind::Const => lsp_types::SymbolKind::CONSTANT,
|
||||
|
@ -124,6 +126,7 @@ pub(crate) fn completion_item_kind(
|
|||
SymbolKind::Macro => lsp_types::CompletionItemKind::FUNCTION,
|
||||
SymbolKind::Module => lsp_types::CompletionItemKind::MODULE,
|
||||
SymbolKind::SelfParam => lsp_types::CompletionItemKind::VALUE,
|
||||
SymbolKind::SelfType => lsp_types::CompletionItemKind::TYPE_PARAMETER,
|
||||
SymbolKind::Static => lsp_types::CompletionItemKind::VALUE,
|
||||
SymbolKind::Struct => lsp_types::CompletionItemKind::STRUCT,
|
||||
SymbolKind::Trait => lsp_types::CompletionItemKind::INTERFACE,
|
||||
|
@ -483,6 +486,7 @@ fn semantic_token_type_and_modifiers(
|
|||
SymbolKind::Label => semantic_tokens::LABEL,
|
||||
SymbolKind::ValueParam => lsp_types::SemanticTokenType::PARAMETER,
|
||||
SymbolKind::SelfParam => semantic_tokens::SELF_KEYWORD,
|
||||
SymbolKind::SelfType => semantic_tokens::SELF_TYPE_KEYWORD,
|
||||
SymbolKind::Local => lsp_types::SemanticTokenType::VARIABLE,
|
||||
SymbolKind::Function => {
|
||||
if highlight.mods.contains(HlMod::Associated) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue