mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
feat: Add proc macro semantic token type
This commit is contained in:
parent
a0dd822972
commit
fc11216ad5
28 changed files with 56 additions and 14 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue