Use updateGraphIfDirty to do quick check if project update is needed

With this updateGraph is used only in locations we are certain project is dirty
This commit is contained in:
Sheetal Nandi
2018-08-01 16:08:25 -07:00
parent 50f442f9ff
commit d74d8613bd
3 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -695,7 +695,7 @@ namespace ts.server {
const { fileName, project } = checkList[index];
index++;
// Ensure the project is upto date before checking if this file is present in the project
project.updateGraph();
updateProjectIfDirty(project);
if (!project.containsFile(fileName, requireOpen)) {
return;
}
@@ -1084,7 +1084,7 @@ namespace ts.server {
private getProjectInfoWorker(uncheckedFileName: string, projectFileName: string | undefined, needFileNameList: boolean, excludeConfigFiles: boolean) {
const { project } = this.getFileAndProjectWorker(uncheckedFileName, projectFileName);
project.updateGraph();
updateProjectIfDirty(project);
const projectInfo = {
configFileName: project.getProjectName(),
languageServiceDisabled: !project.languageServiceEnabled,