build(bazel): fix bazel types reference directive resolves (#25581)
PR Close #25581
This commit is contained in:

committed by
Misko Hevery

parent
20b9c61d4c
commit
910381ddbd
@ -17,7 +17,16 @@ import {FactoryGenerator} from './generator';
|
||||
export class GeneratedFactoryHostWrapper implements ts.CompilerHost {
|
||||
constructor(
|
||||
private delegate: ts.CompilerHost, private generator: FactoryGenerator,
|
||||
private factoryToSourceMap: Map<string, string>) {}
|
||||
private factoryToSourceMap: Map<string, string>) {
|
||||
if (delegate.resolveTypeReferenceDirectives) {
|
||||
this.resolveTypeReferenceDirectives = (names: string[], containingFile: string) =>
|
||||
delegate.resolveTypeReferenceDirectives !(names, containingFile);
|
||||
}
|
||||
}
|
||||
|
||||
resolveTypeReferenceDirectives?:
|
||||
(names: string[],
|
||||
containingFile: string) => (ts.ResolvedTypeReferenceDirective | undefined)[];
|
||||
|
||||
getSourceFile(
|
||||
fileName: string, languageVersion: ts.ScriptTarget,
|
||||
|
@ -78,6 +78,9 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHos
|
||||
trace !: (s: string) => void;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
getDirectories !: (path: string) => string[];
|
||||
resolveTypeReferenceDirectives?:
|
||||
(names: string[],
|
||||
containingFile: string) => (ts.ResolvedTypeReferenceDirective | undefined)[];
|
||||
directoryExists?: (directoryName: string) => boolean;
|
||||
|
||||
constructor(
|
||||
@ -102,6 +105,10 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHos
|
||||
if (context.getDefaultLibLocation) {
|
||||
this.getDefaultLibLocation = () => context.getDefaultLibLocation !();
|
||||
}
|
||||
if (context.resolveTypeReferenceDirectives) {
|
||||
this.resolveTypeReferenceDirectives = (names: string[], containingFile: string) =>
|
||||
context.resolveTypeReferenceDirectives !(names, containingFile);
|
||||
}
|
||||
if (context.trace) {
|
||||
this.trace = s => context.trace !(s);
|
||||
}
|
||||
|
Reference in New Issue
Block a user