mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Only add entries to SourceToDef dynmaps when they come from the same file
This commit is contained in:
parent
0c0142f61a
commit
c90ecc5c26
3 changed files with 125 additions and 76 deletions
|
@ -95,7 +95,7 @@ use hir_def::{
|
||||||
GenericDefId, ImplId, LifetimeParamId, ModuleId, StaticId, StructId, TraitId, TypeAliasId,
|
GenericDefId, ImplId, LifetimeParamId, ModuleId, StaticId, StructId, TraitId, TypeAliasId,
|
||||||
TypeParamId, UnionId, VariantId,
|
TypeParamId, UnionId, VariantId,
|
||||||
};
|
};
|
||||||
use hir_expand::{name::AsName, AstId, MacroCallId, MacroDefId, MacroDefKind};
|
use hir_expand::{name::AsName, AstId, HirFileId, MacroCallId, MacroDefId, MacroDefKind};
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use stdx::impl_from;
|
use stdx::impl_from;
|
||||||
|
@ -106,7 +106,7 @@ use syntax::{
|
||||||
|
|
||||||
use crate::{db::HirDatabase, InFile};
|
use crate::{db::HirDatabase, InFile};
|
||||||
|
|
||||||
pub(super) type SourceToDefCache = FxHashMap<ChildContainer, DynMap>;
|
pub(super) type SourceToDefCache = FxHashMap<ChildContainer, FxHashMap<HirFileId, DynMap>>;
|
||||||
|
|
||||||
pub(super) struct SourceToDefCtx<'a, 'b> {
|
pub(super) struct SourceToDefCtx<'a, 'b> {
|
||||||
pub(super) db: &'b dyn HirDatabase,
|
pub(super) db: &'b dyn HirDatabase,
|
||||||
|
@ -252,17 +252,18 @@ impl SourceToDefCtx<'_, '_> {
|
||||||
|
|
||||||
fn dyn_map<Ast: AstNode + 'static>(&mut self, src: InFile<&Ast>) -> Option<&DynMap> {
|
fn dyn_map<Ast: AstNode + 'static>(&mut self, src: InFile<&Ast>) -> Option<&DynMap> {
|
||||||
let container = self.find_container(src.map(|it| it.syntax()))?;
|
let container = self.find_container(src.map(|it| it.syntax()))?;
|
||||||
|
Some(self.cache_for(container, src.file_id))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn cache_for(&mut self, container: ChildContainer, file_id: HirFileId) -> &DynMap {
|
||||||
let db = self.db;
|
let db = self.db;
|
||||||
let dyn_map =
|
let dyn_maps = self.cache.entry(container).or_default();
|
||||||
&*self.cache.entry(container).or_insert_with(|| container.child_by_source(db));
|
dyn_maps.entry(file_id).or_insert_with(|| container.child_by_source(db, file_id))
|
||||||
Some(dyn_map)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn type_param_to_def(&mut self, src: InFile<ast::TypeParam>) -> Option<TypeParamId> {
|
pub(super) fn type_param_to_def(&mut self, src: InFile<ast::TypeParam>) -> Option<TypeParamId> {
|
||||||
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
||||||
let db = self.db;
|
let dyn_map = self.cache_for(container, src.file_id);
|
||||||
let dyn_map =
|
|
||||||
&*self.cache.entry(container).or_insert_with(|| container.child_by_source(db));
|
|
||||||
dyn_map[keys::TYPE_PARAM].get(&src).copied()
|
dyn_map[keys::TYPE_PARAM].get(&src).copied()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,9 +272,7 @@ impl SourceToDefCtx<'_, '_> {
|
||||||
src: InFile<ast::LifetimeParam>,
|
src: InFile<ast::LifetimeParam>,
|
||||||
) -> Option<LifetimeParamId> {
|
) -> Option<LifetimeParamId> {
|
||||||
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
||||||
let db = self.db;
|
let dyn_map = self.cache_for(container, src.file_id);
|
||||||
let dyn_map =
|
|
||||||
&*self.cache.entry(container).or_insert_with(|| container.child_by_source(db));
|
|
||||||
dyn_map[keys::LIFETIME_PARAM].get(&src).copied()
|
dyn_map[keys::LIFETIME_PARAM].get(&src).copied()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,9 +281,7 @@ impl SourceToDefCtx<'_, '_> {
|
||||||
src: InFile<ast::ConstParam>,
|
src: InFile<ast::ConstParam>,
|
||||||
) -> Option<ConstParamId> {
|
) -> Option<ConstParamId> {
|
||||||
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
||||||
let db = self.db;
|
let dyn_map = self.cache_for(container, src.file_id);
|
||||||
let dyn_map =
|
|
||||||
&*self.cache.entry(container).or_insert_with(|| container.child_by_source(db));
|
|
||||||
dyn_map[keys::CONST_PARAM].get(&src).copied()
|
dyn_map[keys::CONST_PARAM].get(&src).copied()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,17 +419,17 @@ impl_from! {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChildContainer {
|
impl ChildContainer {
|
||||||
fn child_by_source(self, db: &dyn HirDatabase) -> DynMap {
|
fn child_by_source(self, db: &dyn HirDatabase, file_id: HirFileId) -> DynMap {
|
||||||
let db = db.upcast();
|
let db = db.upcast();
|
||||||
match self {
|
match self {
|
||||||
ChildContainer::DefWithBodyId(it) => it.child_by_source(db),
|
ChildContainer::DefWithBodyId(it) => it.child_by_source(db, file_id),
|
||||||
ChildContainer::ModuleId(it) => it.child_by_source(db),
|
ChildContainer::ModuleId(it) => it.child_by_source(db, file_id),
|
||||||
ChildContainer::TraitId(it) => it.child_by_source(db),
|
ChildContainer::TraitId(it) => it.child_by_source(db, file_id),
|
||||||
ChildContainer::ImplId(it) => it.child_by_source(db),
|
ChildContainer::ImplId(it) => it.child_by_source(db, file_id),
|
||||||
ChildContainer::EnumId(it) => it.child_by_source(db),
|
ChildContainer::EnumId(it) => it.child_by_source(db, file_id),
|
||||||
ChildContainer::VariantId(it) => it.child_by_source(db),
|
ChildContainer::VariantId(it) => it.child_by_source(db, file_id),
|
||||||
ChildContainer::TypeAliasId(_) => DynMap::default(),
|
ChildContainer::TypeAliasId(_) => DynMap::default(),
|
||||||
ChildContainer::GenericDefId(it) => it.child_by_source(db),
|
ChildContainer::GenericDefId(it) => it.child_by_source(db, file_id),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
//! node for a *child*, and get its hir.
|
//! node for a *child*, and get its hir.
|
||||||
|
|
||||||
use either::Either;
|
use either::Either;
|
||||||
|
use hir_expand::HirFileId;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::DefDatabase,
|
db::DefDatabase,
|
||||||
|
@ -17,137 +18,188 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
pub trait ChildBySource {
|
pub trait ChildBySource {
|
||||||
fn child_by_source(&self, db: &dyn DefDatabase) -> DynMap {
|
fn child_by_source(&self, db: &dyn DefDatabase, file_id: HirFileId) -> DynMap {
|
||||||
let mut res = DynMap::default();
|
let mut res = DynMap::default();
|
||||||
self.child_by_source_to(db, &mut res);
|
self.child_by_source_to(db, file_id, &mut res);
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, map: &mut DynMap);
|
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, map: &mut DynMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChildBySource for TraitId {
|
impl ChildBySource for TraitId {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
|
||||||
let data = db.trait_data(*self);
|
let data = db.trait_data(*self);
|
||||||
for (_name, item) in data.items.iter() {
|
for &(_, item) in data.items.iter() {
|
||||||
match *item {
|
match item {
|
||||||
AssocItemId::FunctionId(func) => {
|
AssocItemId::FunctionId(func) => {
|
||||||
let src = func.lookup(db).source(db);
|
let loc = func.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
res[keys::FUNCTION].insert(src, func)
|
res[keys::FUNCTION].insert(src, func)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AssocItemId::ConstId(konst) => {
|
AssocItemId::ConstId(konst) => {
|
||||||
let src = konst.lookup(db).source(db);
|
let loc = konst.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
res[keys::CONST].insert(src, konst)
|
res[keys::CONST].insert(src, konst)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AssocItemId::TypeAliasId(ty) => {
|
AssocItemId::TypeAliasId(ty) => {
|
||||||
let src = ty.lookup(db).source(db);
|
let loc = ty.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
res[keys::TYPE_ALIAS].insert(src, ty)
|
res[keys::TYPE_ALIAS].insert(src, ty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ChildBySource for ImplId {
|
impl ChildBySource for ImplId {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
|
||||||
let data = db.impl_data(*self);
|
let data = db.impl_data(*self);
|
||||||
for &item in data.items.iter() {
|
for &item in data.items.iter() {
|
||||||
match item {
|
match item {
|
||||||
AssocItemId::FunctionId(func) => {
|
AssocItemId::FunctionId(func) => {
|
||||||
let src = func.lookup(db).source(db);
|
let loc = func.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
res[keys::FUNCTION].insert(src, func)
|
res[keys::FUNCTION].insert(src, func)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AssocItemId::ConstId(konst) => {
|
AssocItemId::ConstId(konst) => {
|
||||||
let src = konst.lookup(db).source(db);
|
let loc = konst.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
res[keys::CONST].insert(src, konst)
|
res[keys::CONST].insert(src, konst)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AssocItemId::TypeAliasId(ty) => {
|
AssocItemId::TypeAliasId(ty) => {
|
||||||
let src = ty.lookup(db).source(db);
|
let loc = ty.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
res[keys::TYPE_ALIAS].insert(src, ty)
|
res[keys::TYPE_ALIAS].insert(src, ty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ChildBySource for ModuleId {
|
impl ChildBySource for ModuleId {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
|
||||||
let def_map = self.def_map(db);
|
let def_map = self.def_map(db);
|
||||||
let module_data = &def_map[self.local_id];
|
let module_data = &def_map[self.local_id];
|
||||||
module_data.scope.child_by_source_to(db, res);
|
module_data.scope.child_by_source_to(db, file_id, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChildBySource for ItemScope {
|
impl ChildBySource for ItemScope {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
|
||||||
self.declarations().for_each(|item| add_module_def(db, res, item));
|
self.declarations().for_each(|item| add_module_def(db, file_id, res, item));
|
||||||
self.unnamed_consts().for_each(|konst| {
|
self.unnamed_consts().for_each(|konst| {
|
||||||
let src = konst.lookup(db).source(db);
|
let src = konst.lookup(db).source(db);
|
||||||
res[keys::CONST].insert(src, konst);
|
res[keys::CONST].insert(src, konst);
|
||||||
});
|
});
|
||||||
self.impls().for_each(|imp| add_impl(db, 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()));
|
let item = ast_id.with_value(ast_id.to_node(db.upcast()));
|
||||||
res[keys::ATTR_MACRO].insert(item, call_id);
|
res[keys::ATTR_MACRO].insert(item, call_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
fn add_module_def(db: &dyn DefDatabase, map: &mut DynMap, item: ModuleDefId) {
|
fn add_module_def(
|
||||||
|
db: &dyn DefDatabase,
|
||||||
|
file_id: HirFileId,
|
||||||
|
map: &mut DynMap,
|
||||||
|
item: ModuleDefId,
|
||||||
|
) {
|
||||||
match item {
|
match item {
|
||||||
ModuleDefId::FunctionId(func) => {
|
ModuleDefId::FunctionId(func) => {
|
||||||
let src = func.lookup(db).source(db);
|
let loc = func.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::FUNCTION].insert(src, func)
|
map[keys::FUNCTION].insert(src, func)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ModuleDefId::ConstId(konst) => {
|
ModuleDefId::ConstId(konst) => {
|
||||||
let src = konst.lookup(db).source(db);
|
let loc = konst.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::CONST].insert(src, konst)
|
map[keys::CONST].insert(src, konst)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ModuleDefId::StaticId(statik) => {
|
ModuleDefId::StaticId(statik) => {
|
||||||
let src = statik.lookup(db).source(db);
|
let loc = statik.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::STATIC].insert(src, statik)
|
map[keys::STATIC].insert(src, statik)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ModuleDefId::TypeAliasId(ty) => {
|
ModuleDefId::TypeAliasId(ty) => {
|
||||||
let src = ty.lookup(db).source(db);
|
let loc = ty.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::TYPE_ALIAS].insert(src, ty)
|
map[keys::TYPE_ALIAS].insert(src, ty)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ModuleDefId::TraitId(trait_) => {
|
ModuleDefId::TraitId(trait_) => {
|
||||||
let src = trait_.lookup(db).source(db);
|
let loc = trait_.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::TRAIT].insert(src, trait_)
|
map[keys::TRAIT].insert(src, trait_)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ModuleDefId::AdtId(adt) => match adt {
|
ModuleDefId::AdtId(adt) => match adt {
|
||||||
AdtId::StructId(strukt) => {
|
AdtId::StructId(strukt) => {
|
||||||
let src = strukt.lookup(db).source(db);
|
let loc = strukt.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::STRUCT].insert(src, strukt)
|
map[keys::STRUCT].insert(src, strukt)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AdtId::UnionId(union_) => {
|
AdtId::UnionId(union_) => {
|
||||||
let src = union_.lookup(db).source(db);
|
let loc = union_.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::UNION].insert(src, union_)
|
map[keys::UNION].insert(src, union_)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AdtId::EnumId(enum_) => {
|
AdtId::EnumId(enum_) => {
|
||||||
let src = enum_.lookup(db).source(db);
|
let loc = enum_.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::ENUM].insert(src, enum_)
|
map[keys::ENUM].insert(src, enum_)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn add_impl(db: &dyn DefDatabase, map: &mut DynMap, imp: ImplId) {
|
fn add_impl(db: &dyn DefDatabase, file_id: HirFileId, map: &mut DynMap, imp: ImplId) {
|
||||||
let src = imp.lookup(db).source(db);
|
let loc = imp.lookup(db);
|
||||||
|
if loc.id.file_id() == file_id {
|
||||||
|
let src = loc.source(db);
|
||||||
map[keys::IMPL].insert(src, imp)
|
map[keys::IMPL].insert(src, imp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ChildBySource for VariantId {
|
impl ChildBySource for VariantId {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, _: HirFileId, res: &mut DynMap) {
|
||||||
let arena_map = self.child_source(db);
|
let arena_map = self.child_source(db);
|
||||||
let arena_map = arena_map.as_ref();
|
let arena_map = arena_map.as_ref();
|
||||||
|
let parent = *self;
|
||||||
for (local_id, source) in arena_map.value.iter() {
|
for (local_id, source) in arena_map.value.iter() {
|
||||||
let id = FieldId { parent: *self, local_id };
|
let id = FieldId { parent, local_id };
|
||||||
match source {
|
match source.clone() {
|
||||||
Either::Left(source) => {
|
Either::Left(source) => {
|
||||||
res[keys::TUPLE_FIELD].insert(arena_map.with_value(source.clone()), id)
|
res[keys::TUPLE_FIELD].insert(arena_map.with_value(source), id)
|
||||||
}
|
}
|
||||||
Either::Right(source) => {
|
Either::Right(source) => {
|
||||||
res[keys::RECORD_FIELD].insert(arena_map.with_value(source.clone()), id)
|
res[keys::RECORD_FIELD].insert(arena_map.with_value(source), id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +207,7 @@ impl ChildBySource for VariantId {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChildBySource for EnumId {
|
impl ChildBySource for EnumId {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, _: HirFileId, res: &mut DynMap) {
|
||||||
let arena_map = self.child_source(db);
|
let arena_map = self.child_source(db);
|
||||||
let arena_map = arena_map.as_ref();
|
let arena_map = arena_map.as_ref();
|
||||||
for (local_id, source) in arena_map.value.iter() {
|
for (local_id, source) in arena_map.value.iter() {
|
||||||
|
@ -166,12 +218,12 @@ impl ChildBySource for EnumId {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChildBySource for DefWithBodyId {
|
impl ChildBySource for DefWithBodyId {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
|
||||||
let body = db.body(*self);
|
let body = db.body(*self);
|
||||||
for (_, def_map) in body.blocks(db) {
|
for (_, def_map) in body.blocks(db) {
|
||||||
// All block expressions are merged into the same map, because they logically all add
|
// All block expressions are merged into the same map, because they logically all add
|
||||||
// inner items to the containing `DefWithBodyId`.
|
// inner items to the containing `DefWithBodyId`.
|
||||||
def_map[def_map.root()].scope.child_by_source_to(db, res);
|
def_map[def_map.root()].scope.child_by_source_to(db, file_id, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ use base_db::FileId;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
name::{name, AsName, Name},
|
name::{name, AsName, Name},
|
||||||
InFile,
|
HirFileId, InFile,
|
||||||
};
|
};
|
||||||
use la_arena::{Arena, ArenaMap};
|
use la_arena::{Arena, ArenaMap};
|
||||||
use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner};
|
use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner};
|
||||||
|
@ -438,7 +438,7 @@ impl HasChildSource<LocalConstParamId> for GenericDefId {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChildBySource for GenericDefId {
|
impl ChildBySource for GenericDefId {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, _: HirFileId, res: &mut DynMap) {
|
||||||
let (_, sm) = GenericParams::new(db, *self);
|
let (_, sm) = GenericParams::new(db, *self);
|
||||||
|
|
||||||
let sm = sm.as_ref();
|
let sm = sm.as_ref();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue