mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Cleanup getDiagnosticsForProject (#18151)
This commit is contained in:
@@ -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[] = [];
|
||||
@@ -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 {
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user