Skip to content

Commit b155fa8

Browse files
author
zhengbli
committed
Add comments
1 parent 4d3cff1 commit b155fa8

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/compiler/sys.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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)) {

src/server/editorServices.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)