Handle package.json, jsconfig.json, tsconfig.json in the getDiagnostics of fourslash tests

This commit is contained in:
Sheetal Nandi 2018-06-14 11:51:18 -07:00
parent 8e16bfffc2
commit fe260588fa

View File

@ -507,8 +507,17 @@ namespace FourSlash {
}
private getAllDiagnostics(): ts.Diagnostic[] {
return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName =>
ts.isAnySupportedFileExtension(fileName) ? this.getDiagnostics(fileName) : []);
return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName => {
if (!ts.isAnySupportedFileExtension(fileName)) {
return [];
}
const baseName = ts.getBaseFileName(fileName);
if (baseName === "package.json" || baseName === "tsconfig.json" || baseName === "jsconfig.json") {
return [];
}
return this.getDiagnostics(fileName);
});
}
public verifyErrorExistsAfterMarker(markerName: string, shouldExist: boolean, after: boolean) {