Skip to content

Commit 6a84be8

Browse files
committed
fix: di type search
1 parent 9aa6e7b commit 6a84be8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/indexer/di/DiIndexData.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export class DiIndexData extends IndexData<DiData> {
2525
return this.getValues().flatMap(data => data.virtualTypes);
2626
}
2727

28-
public findTypeByName(name: string): DiType | undefined {
29-
return this.getTypes().find(type => type.name === name);
28+
public findTypesByName(name: string): DiType[] {
29+
return this.getTypes().filter(type => type.name === name);
3030
}
3131

3232
public findVirtualTypeByName(name: string): DiVirtualType | undefined {
@@ -38,7 +38,8 @@ export class DiIndexData extends IndexData<DiData> {
3838
}
3939

4040
public findPluginsForType(type: string): DiPlugin[] {
41-
const typeData = this.findTypeByName(type);
42-
return typeData?.plugins || [];
41+
const typeData = this.findTypesByName(type);
42+
43+
return typeData.flatMap(type => type.plugins);
4344
}
4445
}

0 commit comments

Comments
 (0)