New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add proc macro semantic token type #16808
Conversation
crates/hir/src/semantics.rs
Outdated
let sa = match self.analyze(macro_call.syntax()) { | ||
Some(it) => it, | ||
None => return false, | ||
}; | ||
let macro_call = self.find_file(macro_call.syntax()).with_value(macro_call); | ||
sa.is_proc_macro_call(self.db, macro_call) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let sa = match self.analyze(macro_call.syntax()) { | |
Some(it) => it, | |
None => return false, | |
}; | |
let macro_call = self.find_file(macro_call.syntax()).with_value(macro_call); | |
sa.is_proc_macro_call(self.db, macro_call) | |
self.resolve_macro_call(macro_call).map_or(false, |m| matches!(m.id, MacroId::ProcMacroId(..)) |
No need for SourceAnalyzer::is_proc_macro_call
then
if inside_proc_macro_call { | ||
highlight |= HlMod::ProcMacro | ||
} else { | ||
highlight |= HlMod::Macro | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if inside_proc_macro_call { | |
highlight |= HlMod::ProcMacro | |
} else { | |
highlight |= HlMod::Macro | |
} | |
if inside_proc_macro_call { | |
highlight |= HlMod::ProcMacro | |
} | |
highlight |= HlMod::Macro |
I think this makes more sense, that way one doesn't have to handle the proc macro modifier specifically if they are only interested in macros in general
d6e4d6f
to
fc11216
Compare
Thanks! |
☀️ Test successful - checks-actions |
Closes #11529