feat: Add proc macro semantic token type

This commit is contained in:
Shoyu Vanilla 2024-03-11 21:18:44 +09:00
parent a0dd822972
commit fc11216ad5
28 changed files with 56 additions and 14 deletions

View file

@ -1236,6 +1236,11 @@ impl<'db> SemanticsImpl<'db> {
sa.resolve_macro_call(self.db, macro_call)
}
pub fn is_proc_macro_call(&self, macro_call: &ast::MacroCall) -> bool {
self.resolve_macro_call(macro_call)
.map_or(false, |m| matches!(m.id, MacroId::ProcMacroId(..)))
}
pub fn is_unsafe_macro_call(&self, macro_call: &ast::MacroCall) -> bool {
let sa = match self.analyze(macro_call.syntax()) {
Some(it) => it,