Introduce SymbolKind::Attribute
This commit is contained in:
@@ -50,7 +50,9 @@ pub(crate) fn symbol_kind(symbol_kind: SymbolKind) -> lsp_types::SymbolKind {
|
||||
SymbolKind::Enum => lsp_types::SymbolKind::ENUM,
|
||||
SymbolKind::Variant => lsp_types::SymbolKind::ENUM_MEMBER,
|
||||
SymbolKind::Trait => lsp_types::SymbolKind::INTERFACE,
|
||||
SymbolKind::Macro | SymbolKind::BuiltinAttr => lsp_types::SymbolKind::FUNCTION,
|
||||
SymbolKind::Macro | SymbolKind::BuiltinAttr | SymbolKind::Attribute => {
|
||||
lsp_types::SymbolKind::FUNCTION
|
||||
}
|
||||
SymbolKind::Module | SymbolKind::ToolModule => lsp_types::SymbolKind::MODULE,
|
||||
SymbolKind::TypeAlias | SymbolKind::TypeParam => lsp_types::SymbolKind::TYPE_PARAMETER,
|
||||
SymbolKind::Field => lsp_types::SymbolKind::FIELD,
|
||||
@@ -100,7 +102,6 @@ pub(crate) fn completion_item_kind(
|
||||
completion_item_kind: CompletionItemKind,
|
||||
) -> lsp_types::CompletionItemKind {
|
||||
match completion_item_kind {
|
||||
CompletionItemKind::Attribute => lsp_types::CompletionItemKind::ENUM_MEMBER,
|
||||
CompletionItemKind::Binding => lsp_types::CompletionItemKind::VARIABLE,
|
||||
CompletionItemKind::BuiltinType => lsp_types::CompletionItemKind::STRUCT,
|
||||
CompletionItemKind::Keyword => lsp_types::CompletionItemKind::KEYWORD,
|
||||
@@ -108,6 +109,7 @@ pub(crate) fn completion_item_kind(
|
||||
CompletionItemKind::Snippet => lsp_types::CompletionItemKind::SNIPPET,
|
||||
CompletionItemKind::UnresolvedReference => lsp_types::CompletionItemKind::REFERENCE,
|
||||
CompletionItemKind::SymbolKind(symbol) => match symbol {
|
||||
SymbolKind::Attribute => lsp_types::CompletionItemKind::FUNCTION,
|
||||
SymbolKind::Const => lsp_types::CompletionItemKind::CONSTANT,
|
||||
SymbolKind::ConstParam => lsp_types::CompletionItemKind::TYPE_PARAMETER,
|
||||
SymbolKind::Enum => lsp_types::CompletionItemKind::ENUM,
|
||||
@@ -117,7 +119,7 @@ pub(crate) fn completion_item_kind(
|
||||
SymbolKind::Label => lsp_types::CompletionItemKind::VARIABLE,
|
||||
SymbolKind::LifetimeParam => lsp_types::CompletionItemKind::TYPE_PARAMETER,
|
||||
SymbolKind::Local => lsp_types::CompletionItemKind::VARIABLE,
|
||||
SymbolKind::Macro => lsp_types::CompletionItemKind::METHOD,
|
||||
SymbolKind::Macro => lsp_types::CompletionItemKind::FUNCTION,
|
||||
SymbolKind::Module => lsp_types::CompletionItemKind::MODULE,
|
||||
SymbolKind::SelfParam => lsp_types::CompletionItemKind::VALUE,
|
||||
SymbolKind::Static => lsp_types::CompletionItemKind::VALUE,
|
||||
@@ -468,6 +470,7 @@ fn semantic_token_type_and_modifiers(
|
||||
let mut mods = semantic_tokens::ModifierSet::default();
|
||||
let type_ = match highlight.tag {
|
||||
HlTag::Symbol(symbol) => match symbol {
|
||||
SymbolKind::Attribute => semantic_tokens::ATTRIBUTE,
|
||||
SymbolKind::Module => lsp_types::SemanticTokenType::NAMESPACE,
|
||||
SymbolKind::Impl => semantic_tokens::TYPE_ALIAS,
|
||||
SymbolKind::Field => lsp_types::SemanticTokenType::PROPERTY,
|
||||
@@ -504,7 +507,7 @@ fn semantic_token_type_and_modifiers(
|
||||
SymbolKind::BuiltinAttr => semantic_tokens::BUILTIN_ATTRIBUTE,
|
||||
SymbolKind::ToolModule => semantic_tokens::TOOL_MODULE,
|
||||
},
|
||||
HlTag::Attribute => semantic_tokens::ATTRIBUTE,
|
||||
HlTag::AttributeBracket => semantic_tokens::ATTRIBUTE_BRACKET,
|
||||
HlTag::BoolLiteral => semantic_tokens::BOOLEAN,
|
||||
HlTag::BuiltinType => semantic_tokens::BUILTIN_TYPE,
|
||||
HlTag::ByteLiteral | HlTag::NumericLiteral => lsp_types::SemanticTokenType::NUMBER,
|
||||
|
||||
Reference in New Issue
Block a user