mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 21:04:18 +00:00
Push macro-parsing error calculation out of fundamental queries
This commit is contained in:
parent
067d9d995b
commit
56552f4839
15 changed files with 145 additions and 140 deletions
|
|
@ -234,6 +234,14 @@ impl ItemScope {
|
|||
self.impls.iter().copied()
|
||||
}
|
||||
|
||||
pub fn all_macro_calls(&self) -> impl Iterator<Item = MacroCallId> + '_ {
|
||||
self.macro_invocations.values().copied().chain(self.attr_macros.values().copied()).chain(
|
||||
self.derive_macros.values().flat_map(|it| {
|
||||
it.iter().flat_map(|it| it.derive_call_ids.iter().copied().flatten())
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn modules_in_scope(&self) -> impl Iterator<Item = (ModuleId, Visibility)> + '_ {
|
||||
self.types.values().copied().filter_map(|(def, vis, _)| match def {
|
||||
ModuleDefId::ModuleId(module) => Some((module, vis)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue