fix(language-service): Recover from error in analyzing Ng Modules (#37108)
In place of failing to return analyzed Ng Modules when the analyzer fails, return the previously-analyzed Ng Modules (which may be empty) and log an error. Closes https://github.com/angular/vscode-ng-language-service/issues/777 PR Close #37108
This commit is contained in:
@ -101,6 +101,7 @@ export class MockTypescriptHost implements ts.LanguageServiceHost {
|
||||
private readonly overrideDirectory = new Set<string>();
|
||||
private readonly existsCache = new Map<string, boolean>();
|
||||
private readonly fileCache = new Map<string, string|undefined>();
|
||||
errors: string[] = [];
|
||||
|
||||
constructor(
|
||||
private readonly scriptNames: string[],
|
||||
@ -398,6 +399,10 @@ export class MockTypescriptHost implements ts.LanguageServiceHost {
|
||||
}
|
||||
throw new Error(`Failed to find marker '${selector}' in ${fileName}`);
|
||||
}
|
||||
|
||||
error(msg: string) {
|
||||
this.errors.push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
const locationMarker = /\~\{(\w+(-\w+)*)\}/g;
|
||||
|
Reference in New Issue
Block a user