Use lsp-types DECORATOR token type
This commit is contained in:
parent
31fb917d8d
commit
2a26b054b7
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -871,9 +871,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lsp-types"
|
name = "lsp-types"
|
||||||
version = "0.93.0"
|
version = "0.93.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "70c74e2173b2b31f8655d33724b4b45ac13f439386f66290f539c22b144c2212"
|
checksum = "a3bcfee315dde785ba887edb540b08765fd7df75a7d948844be6bf5712246734"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -22,8 +22,8 @@ anyhow = "1.0.57"
|
|||||||
crossbeam-channel = "0.5.5"
|
crossbeam-channel = "0.5.5"
|
||||||
dissimilar = "1.0.4"
|
dissimilar = "1.0.4"
|
||||||
itertools = "0.10.3"
|
itertools = "0.10.3"
|
||||||
lsp-types = { version = "0.93.0", features = ["proposed"] }
|
|
||||||
scip = "0.1.1"
|
scip = "0.1.1"
|
||||||
|
lsp-types = { version = "0.93.1", features = ["proposed"] }
|
||||||
parking_lot = "0.12.1"
|
parking_lot = "0.12.1"
|
||||||
xflags = "0.2.4"
|
xflags = "0.2.4"
|
||||||
oorandom = "11.1.3"
|
oorandom = "11.1.3"
|
||||||
@ -89,5 +89,5 @@ in-rust-tree = [
|
|||||||
"proc-macro-srv/sysroot-abi",
|
"proc-macro-srv/sysroot-abi",
|
||||||
"sourcegen/in-rust-tree",
|
"sourcegen/in-rust-tree",
|
||||||
"ide/in-rust-tree",
|
"ide/in-rust-tree",
|
||||||
"syntax/in-rust-tree"
|
"syntax/in-rust-tree",
|
||||||
]
|
]
|
||||||
|
@ -12,26 +12,26 @@ macro_rules! define_semantic_token_types {
|
|||||||
$(pub(crate) const $ident: SemanticTokenType = SemanticTokenType::new($string);)*
|
$(pub(crate) const $ident: SemanticTokenType = SemanticTokenType::new($string);)*
|
||||||
|
|
||||||
pub(crate) const SUPPORTED_TYPES: &[SemanticTokenType] = &[
|
pub(crate) const SUPPORTED_TYPES: &[SemanticTokenType] = &[
|
||||||
SemanticTokenType::COMMENT,
|
|
||||||
SemanticTokenType::KEYWORD,
|
|
||||||
SemanticTokenType::STRING,
|
|
||||||
SemanticTokenType::NUMBER,
|
|
||||||
SemanticTokenType::REGEXP,
|
|
||||||
SemanticTokenType::OPERATOR,
|
|
||||||
SemanticTokenType::NAMESPACE,
|
|
||||||
SemanticTokenType::TYPE,
|
|
||||||
SemanticTokenType::STRUCT,
|
|
||||||
SemanticTokenType::CLASS,
|
SemanticTokenType::CLASS,
|
||||||
SemanticTokenType::INTERFACE,
|
SemanticTokenType::COMMENT,
|
||||||
SemanticTokenType::ENUM,
|
|
||||||
SemanticTokenType::ENUM_MEMBER,
|
SemanticTokenType::ENUM_MEMBER,
|
||||||
SemanticTokenType::TYPE_PARAMETER,
|
SemanticTokenType::ENUM,
|
||||||
SemanticTokenType::FUNCTION,
|
SemanticTokenType::FUNCTION,
|
||||||
SemanticTokenType::METHOD,
|
SemanticTokenType::INTERFACE,
|
||||||
SemanticTokenType::PROPERTY,
|
SemanticTokenType::KEYWORD,
|
||||||
SemanticTokenType::MACRO,
|
SemanticTokenType::MACRO,
|
||||||
SemanticTokenType::VARIABLE,
|
SemanticTokenType::METHOD,
|
||||||
|
SemanticTokenType::NAMESPACE,
|
||||||
|
SemanticTokenType::NUMBER,
|
||||||
|
SemanticTokenType::OPERATOR,
|
||||||
SemanticTokenType::PARAMETER,
|
SemanticTokenType::PARAMETER,
|
||||||
|
SemanticTokenType::PROPERTY,
|
||||||
|
SemanticTokenType::REGEXP,
|
||||||
|
SemanticTokenType::STRING,
|
||||||
|
SemanticTokenType::STRUCT,
|
||||||
|
SemanticTokenType::TYPE_PARAMETER,
|
||||||
|
SemanticTokenType::TYPE,
|
||||||
|
SemanticTokenType::VARIABLE,
|
||||||
$($ident),*
|
$($ident),*
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -52,8 +52,6 @@ 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"),
|
||||||
|
@ -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::DECORATOR,
|
SymbolKind::Attribute => lsp_types::SemanticTokenType::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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user