feat(ivy): integrate indexing pipeline with NgtscProgram (#31151)
Add an IndexingContext class to store indexing information and a transformer module to generate indexing analysis. Integrate the indexing module with the rest of NgtscProgram and add integration tests. Closes #30959 PR Close #31151
This commit is contained in:

committed by
Kara Erickson

parent
3fb73ac62b
commit
74f4f5dfab
@ -82,7 +82,7 @@ export interface DecoratorHandler<A, M> {
|
||||
* `IndexingContext`, which stores information about components discovered in the
|
||||
* program.
|
||||
*/
|
||||
index?(context: IndexingContext, node: ClassDeclaration, metadata: M): void;
|
||||
index?(context: IndexingContext, node: ClassDeclaration, metadata: A): void;
|
||||
|
||||
/**
|
||||
* Perform resolution on the given decorator along with the result of analysis.
|
||||
|
@ -254,7 +254,16 @@ export class IvyCompilation {
|
||||
/**
|
||||
* Feeds components discovered in the compilation to a context for indexing.
|
||||
*/
|
||||
index(context: IndexingContext) { throw new Error('Method not implemented.'); }
|
||||
index(context: IndexingContext) {
|
||||
this.ivyClasses.forEach((ivyClass, declaration) => {
|
||||
for (const match of ivyClass.matchedHandlers) {
|
||||
if (match.handler.index !== undefined && match.analyzed !== null &&
|
||||
match.analyzed.analysis !== undefined) {
|
||||
match.handler.index(context, declaration, match.analyzed.analysis);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
resolve(): void {
|
||||
const resolveSpan = this.perf.start('resolve');
|
||||
|
Reference in New Issue
Block a user