mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 12:59:12 +00:00
Fix a missing standard token in semantic highlighting
That was used as a fallback, causing a panic when the fallback was chosen. I also made sure this won't happen again by guaranteeing in the macro generating the tokens that they all exist.
This commit is contained in:
parent
6862329068
commit
783fa8eb9d
1 changed files with 3 additions and 2 deletions
|
|
@ -24,7 +24,7 @@ macro_rules! define_semantic_token_types {
|
|||
}
|
||||
|
||||
pub(crate) const SUPPORTED_TYPES: &[SemanticTokenType] = &[
|
||||
$(SemanticTokenType::$standard,)*
|
||||
$(self::types::$standard,)*
|
||||
$(self::types::$custom),*
|
||||
];
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ macro_rules! define_semantic_token_types {
|
|||
use self::types::*;
|
||||
$(
|
||||
if token == $custom {
|
||||
None $(.or(Some(SemanticTokenType::$fallback)))?
|
||||
None $(.or(Some(self::types::$fallback)))?
|
||||
} else
|
||||
)*
|
||||
{ Some(token )}
|
||||
|
|
@ -60,6 +60,7 @@ define_semantic_token_types![
|
|||
STRUCT,
|
||||
TYPE_PARAMETER,
|
||||
VARIABLE,
|
||||
TYPE,
|
||||
}
|
||||
|
||||
custom {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue