mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Filter out macro calls by file id in when building DynMap
This commit is contained in:
parent
41a0e95d61
commit
0c9268c1ee
1 changed files with 12 additions and 4 deletions
|
@ -114,15 +114,23 @@ impl ChildBySource for ItemScope {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
self.unnamed_consts().for_each(|konst| {
|
self.unnamed_consts().for_each(|konst| {
|
||||||
let src = konst.lookup(db).source(db);
|
let loc = konst.lookup(db);
|
||||||
res[keys::CONST].insert(src, konst);
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
|
res[keys::CONST].insert(src, konst);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
self.impls().for_each(|imp| add_impl(db, file_id, res, imp));
|
self.impls().for_each(|imp| add_impl(db, file_id, res, imp));
|
||||||
self.attr_macro_invocs().for_each(|(ast_id, call_id)| {
|
self.attr_macro_invocs().for_each(|(ast_id, call_id)| {
|
||||||
let item = ast_id.with_value(ast_id.to_node(db.upcast()));
|
if ast_id.file_id == file_id {
|
||||||
res[keys::ATTR_MACRO_CALL].insert(item, call_id);
|
let item = ast_id.with_value(ast_id.to_node(db.upcast()));
|
||||||
|
res[keys::ATTR_MACRO_CALL].insert(item, call_id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
self.derive_macro_invocs().for_each(|(ast_id, calls)| {
|
self.derive_macro_invocs().for_each(|(ast_id, calls)| {
|
||||||
|
if ast_id.file_id != file_id {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let adt = ast_id.to_node(db.upcast());
|
let adt = ast_id.to_node(db.upcast());
|
||||||
for (attr_id, calls) in calls {
|
for (attr_id, calls) in calls {
|
||||||
if let Some(Either::Right(attr)) =
|
if let Some(Either::Right(attr)) =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue