Fix highlighting of Self

This commit is contained in:
Lukas Wirth 2022-03-05 23:34:37 +01:00
parent c0d6471143
commit 5c0aee013e
9 changed files with 19 additions and 4 deletions

View file

@ -190,6 +190,7 @@ fn keyword(
T![for] if parent_matches::<ast::ForExpr>(&token) => h | HlMod::ControlFlow,
T![unsafe] => h | HlMod::Unsafe,
T![true] | T![false] => HlTag::BoolLiteral.into(),
T![Self] => return Some(HlTag::Symbol(SymbolKind::SelfType).into()),
// crate is handled just as a token if it's in an `extern crate`
T![crate] if parent_matches::<ast::ExternCrate>(&token) => h,
// self, crate and super are handled as either a Name or NameRef already, unless they