Use get files affected by internally and hence use file paths as input

This commit is contained in:
Sheetal Nandi
2017-10-17 21:18:27 -07:00
parent d3f954e0cc
commit f9c901ada7
2 changed files with 64 additions and 77 deletions

View File

@@ -448,18 +448,23 @@ namespace ts.server {
computeHash: data =>
this.projectService.host.createHash(data),
shouldEmitFile: sourceFile =>
!this.projectService.getScriptInfoForPath(sourceFile.path).isDynamicOrHasMixedContent()
!this.shouldEmitFile(sourceFile)
});
}
}
private shouldEmitFile(sourceFile: SourceFile) {
return !this.projectService.getScriptInfoForPath(sourceFile.path).isDynamicOrHasMixedContent();
}
getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[] {
if (!this.languageServiceEnabled) {
return [];
}
this.updateGraph();
this.ensureBuilder();
return this.builder.getFilesAffectedBy(this.program, scriptInfo.path);
return mapDefined(this.builder.getFilesAffectedBy(this.program, scriptInfo.path),
sourceFile => this.shouldEmitFile(sourceFile) ? sourceFile.fileName : undefined);
}
/**