mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-18 16:08:55 +00:00
fix(python): visit a shared base or subclass once when walking inheritance
This commit is contained in:
@@ -316,7 +316,9 @@ export async function ancestryResolution(
|
||||
continue;
|
||||
}
|
||||
for (const parent of found) {
|
||||
if (!seen.add(declarationKey(parent))) continue;
|
||||
const key = declarationKey(parent);
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
out.push({ decl: parent, depth: d });
|
||||
next.push(parent);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,9 @@ export async function pythonDescendants(
|
||||
const next: ClassInheritance[] = [];
|
||||
for (const parent of level) {
|
||||
for (const sub of subclasses.get(declarationKey(parent)) ?? []) {
|
||||
if (!seen.add(declarationKey(sub))) continue;
|
||||
const key = declarationKey(sub);
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
out.push(sub);
|
||||
next.push(sub);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user