| T![loop]
| T![match]
| T![return]
- | T![while] => h | HighlightModifier::Control,
+ | T![while] => h | HighlightModifier::ControlFlow,
T![unsafe] => h | HighlightModifier::Unsafe,
_ => h,
}
#[repr(u8)]
pub enum HighlightModifier {
/// Used with keywords like `if` and `break`.
- Control = 0,
+ ControlFlow = 0,
/// `foo` in `fn foo(x: i32)` is a definition, `foo` in `foo(90 + 2)` is
/// not.
Definition,
impl HighlightModifier {
const ALL: &'static [HighlightModifier] = &[
- HighlightModifier::Control,
+ HighlightModifier::ControlFlow,
HighlightModifier::Definition,
HighlightModifier::Mutable,
HighlightModifier::Unsafe,
fn as_str(self) -> &'static str {
match self {
- HighlightModifier::Control => "control",
+ HighlightModifier::ControlFlow => "control",
HighlightModifier::Definition => "declaration",
HighlightModifier::Mutable => "mutable",
HighlightModifier::Unsafe => "unsafe",
use crate::{
req,
- semantic_tokens::{self, ModifierSet, CONSTANT, CONTROL, MUTABLE, UNSAFE},
+ semantic_tokens::{self, ModifierSet, CONSTANT, CONTROL_FLOW, MUTABLE, UNSAFE},
world::WorldSnapshot,
Result,
};
for modifier in self.modifiers.iter() {
let modifier = match modifier {
HighlightModifier::Definition => SemanticTokenModifier::DECLARATION,
- HighlightModifier::Control => CONTROL,
+ HighlightModifier::ControlFlow => CONTROL_FLOW,
HighlightModifier::Mutable => MUTABLE,
HighlightModifier::Unsafe => UNSAFE,
};
pub(crate) const UNION: SemanticTokenType = SemanticTokenType::new("union");
pub(crate) const CONSTANT: SemanticTokenModifier = SemanticTokenModifier::new("constant");
-pub(crate) const CONTROL: SemanticTokenModifier = SemanticTokenModifier::new("control");
+pub(crate) const CONTROL_FLOW: SemanticTokenModifier = SemanticTokenModifier::new("controlFlow");
pub(crate) const MUTABLE: SemanticTokenModifier = SemanticTokenModifier::new("mutable");
pub(crate) const UNSAFE: SemanticTokenModifier = SemanticTokenModifier::new("unsafe");
CONSTANT,
MUTABLE,
UNSAFE,
- CONTROL,
+ CONTROL_FLOW,
];
#[derive(Default)]
"description": "Style for compile-time constants"
},
{
- "id": "control",
+ "id": "controlFlow",
"description": "Style for control flow keywords"
},
{
"keyword.unsafe": [
"keyword.other.unsafe"
],
- "keyword.control": [
- "keyword.control"
- ],
"variable.constant": [
"entity.name.constant"
]