File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -500,6 +500,9 @@ namespace ts {
500500 for ( const current of files ) {
501501 const name = combinePaths ( path , current ) ;
502502 if ( ! contains ( exclude , getCanonicalPath ( name ) ) ) {
503+ // fs.statSync would throw an exception if the file is a symlink
504+ // whose linked file doesn't exist. fs.lstatSync would return a stat
505+ // object for the symlink file itself in this case
503506 const stat = _fs . lstatSync ( name ) ;
504507 if ( stat . isFile ( ) ) {
505508 if ( ! extension || fileExtensionIs ( name , extension ) ) {
Original file line number Diff line number Diff line change @@ -1273,15 +1273,14 @@ namespace ts.server {
12731273 return error ;
12741274 }
12751275 else {
1276+ // if the project is too large, the root files might not have been all loaded if the total
1277+ // program size reached the upper limit. In that case project.projectOptions.files should
1278+ // be more precise. However this would only happen for configured project.
12761279 const oldFileNames = project . projectOptions ? project . projectOptions . files : project . compilerService . host . roots . map ( info => info . fileName ) ;
12771280 const newFileNames = projectOptions . files ;
12781281 const fileNamesToRemove = oldFileNames . filter ( f => newFileNames . indexOf ( f ) < 0 ) ;
12791282 const fileNamesToAdd = newFileNames . filter ( f => oldFileNames . indexOf ( f ) < 0 ) ;
12801283
1281- if ( fileNamesToAdd . length === 0 && fileNamesToRemove . length === 0 ) {
1282- return ;
1283- }
1284-
12851284 for ( const fileName of fileNamesToRemove ) {
12861285 const info = this . getScriptInfo ( fileName ) ;
12871286 if ( info ) {
You can’t perform that action at this time.
0 commit comments