Skip to content

Commit

Permalink
Merge pull request #19045 from ChayimFriedman2/missing-token
Browse files Browse the repository at this point in the history
fix: Fix a missing standard token in semantic highlighting
  • Loading branch information
Veykril authored Jan 27, 2025
2 parents ad0aea4 + 86d5e29 commit 238d7bd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ macro_rules! define_semantic_token_types {
}

pub(crate) const SUPPORTED_TYPES: &[SemanticTokenType] = &[
$(SemanticTokenType::$standard,)*
$(self::types::$standard,)*
$(self::types::$custom),*
];

pub(crate) fn standard_fallback_type(token: SemanticTokenType) -> Option<SemanticTokenType> {
use self::types::*;
$(
if token == $custom {
None $(.or(Some(SemanticTokenType::$fallback)))?
None $(.or(Some(self::types::$fallback)))?
} else
)*
{ Some(token )}
Expand Down Expand Up @@ -60,6 +60,7 @@ define_semantic_token_types![
STRUCT,
TYPE_PARAMETER,
VARIABLE,
TYPE,
}

custom {
Expand Down

0 comments on commit 238d7bd

Please sign in to comment.