@@ -1609,7 +1609,10 @@ namespace ts.server {
1609
1609
}
1610
1610
1611
1611
// No need to analyze lib.d.ts
1612
- let fileNamesInProject = fileNames . filter ( value => value . indexOf ( "lib.d.ts" ) < 0 ) ;
1612
+ const fileNamesInProject = fileNames . filter ( value => value . indexOf ( "lib.d.ts" ) < 0 ) ;
1613
+ if ( fileNamesInProject . length === 0 ) {
1614
+ return ;
1615
+ }
1613
1616
1614
1617
// Sort the file name list to make the recently touched files come first
1615
1618
const highPriorityFiles : NormalizedPath [ ] = [ ] ;
@@ -1625,7 +1628,7 @@ namespace ts.server {
1625
1628
else {
1626
1629
const info = this . projectService . getScriptInfo ( fileNameInProject ) ;
1627
1630
if ( ! info . isScriptOpen ( ) ) {
1628
- if ( fileNameInProject . indexOf ( Extension . Dts ) > 0 ) {
1631
+ if ( fileExtensionIs ( fileNameInProject , Extension . Dts ) ) {
1629
1632
veryLowPriorityFiles . push ( fileNameInProject ) ;
1630
1633
}
1631
1634
else {
@@ -1638,14 +1641,11 @@ namespace ts.server {
1638
1641
}
1639
1642
}
1640
1643
1641
- fileNamesInProject = highPriorityFiles . concat ( mediumPriorityFiles ) . concat ( lowPriorityFiles ) . concat ( veryLowPriorityFiles ) ;
1642
-
1643
- if ( fileNamesInProject . length > 0 ) {
1644
- const checkList = fileNamesInProject . map ( fileName => ( { fileName, project } ) ) ;
1645
- // Project level error analysis runs on background files too, therefore
1646
- // doesn't require the file to be opened
1647
- this . updateErrorCheck ( next , checkList , delay , /*requireOpen*/ false ) ;
1648
- }
1644
+ const sortedFiles = [ ...highPriorityFiles , ...mediumPriorityFiles , ...lowPriorityFiles , ...veryLowPriorityFiles ] ;
1645
+ const checkList = sortedFiles . map ( fileName => ( { fileName, project } ) ) ;
1646
+ // Project level error analysis runs on background files too, therefore
1647
+ // doesn't require the file to be opened
1648
+ this . updateErrorCheck ( next , checkList , delay , /*requireOpen*/ false ) ;
1649
1649
}
1650
1650
1651
1651
getCanonicalFileName ( fileName : string ) {
0 commit comments