Skip to content

Cleanup getDiagnosticsForProject #18151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
Sep 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,10 @@ namespace ts.server {
}

// No need to analyze lib.d.ts
let fileNamesInProject = fileNames.filter(value => value.indexOf("lib.d.ts") < 0);
const fileNamesInProject = fileNames.filter(value => value.indexOf("lib.d.ts") < 0);
if (fileNamesInProject.length === 0) {
return;
}

// Sort the file name list to make the recently touched files come first
const highPriorityFiles: NormalizedPath[] = [];
Expand All @@ -1625,7 +1628,7 @@ namespace ts.server {
else {
const info = this.projectService.getScriptInfo(fileNameInProject);
if (!info.isScriptOpen()) {
if (fileNameInProject.indexOf(Extension.Dts) > 0) {
if (fileExtensionIs(fileNameInProject, Extension.Dts)) {
veryLowPriorityFiles.push(fileNameInProject);
}
else {
Expand All @@ -1638,14 +1641,11 @@ namespace ts.server {
}
}

fileNamesInProject = highPriorityFiles.concat(mediumPriorityFiles).concat(lowPriorityFiles).concat(veryLowPriorityFiles);

if (fileNamesInProject.length > 0) {
const checkList = fileNamesInProject.map(fileName => ({ fileName, project }));
// Project level error analysis runs on background files too, therefore
// doesn't require the file to be opened
this.updateErrorCheck(next, checkList, delay, /*requireOpen*/ false);
}
const sortedFiles = [...highPriorityFiles, ...mediumPriorityFiles, ...lowPriorityFiles, ...veryLowPriorityFiles];
const checkList = sortedFiles.map(fileName => ({ fileName, project }));
// Project level error analysis runs on background files too, therefore
// doesn't require the file to be opened
this.updateErrorCheck(next, checkList, delay, /*requireOpen*/ false);
}

getCanonicalFileName(fileName: string) {
Expand Down