mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Support labels in reference search
This commit is contained in:
parent
e1acb0ca5c
commit
42e3f97c30
21 changed files with 142 additions and 14 deletions
|
@ -45,6 +45,7 @@ define_semantic_token_types![
|
|||
(FORMAT_SPECIFIER, "formatSpecifier"),
|
||||
(GENERIC, "generic"),
|
||||
(LIFETIME, "lifetime"),
|
||||
(LABEL, "label"),
|
||||
(PUNCTUATION, "punctuation"),
|
||||
(SELF_KEYWORD, "selfKeyword"),
|
||||
(TYPE_ALIAS, "typeAlias"),
|
||||
|
|
|
@ -46,7 +46,8 @@ pub(crate) fn symbol_kind(symbol_kind: SymbolKind) -> lsp_types::SymbolKind {
|
|||
SymbolKind::Local
|
||||
| SymbolKind::SelfParam
|
||||
| SymbolKind::LifetimeParam
|
||||
| SymbolKind::ValueParam => lsp_types::SymbolKind::Variable,
|
||||
| SymbolKind::ValueParam
|
||||
| SymbolKind::Label => lsp_types::SymbolKind::Variable,
|
||||
SymbolKind::Union => lsp_types::SymbolKind::Struct,
|
||||
}
|
||||
}
|
||||
|
@ -378,6 +379,7 @@ fn semantic_token_type_and_modifiers(
|
|||
SymbolKind::Field => lsp_types::SemanticTokenType::PROPERTY,
|
||||
SymbolKind::TypeParam => lsp_types::SemanticTokenType::TYPE_PARAMETER,
|
||||
SymbolKind::LifetimeParam => semantic_tokens::LIFETIME,
|
||||
SymbolKind::Label => semantic_tokens::LABEL,
|
||||
SymbolKind::ValueParam => lsp_types::SemanticTokenType::PARAMETER,
|
||||
SymbolKind::SelfParam => semantic_tokens::SELF_KEYWORD,
|
||||
SymbolKind::Local => lsp_types::SemanticTokenType::VARIABLE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue