From 69bc569b2f60d03fab487a86423bbc0959d6fb62 Mon Sep 17 00:00:00 2001 From: zhengbli Date: Fri, 21 Aug 2015 14:33:59 -0700 Subject: [PATCH] Fix issue when the newly added files in tsconfig is not opened --- src/server/editorServices.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index b9f76db4c9e76..dd29d3cf2c9ae 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1116,13 +1116,15 @@ namespace ts.server { else { // if the root file was opened by client, it would belong to either // openFileRoots or openFileReferenced. - if (this.openFileRoots.indexOf(info) >= 0) { - this.openFileRoots = copyListRemovingItem(info, this.openFileRoots); + if (info.isOpen) { + if (this.openFileRoots.indexOf(info) >= 0) { + this.openFileRoots = copyListRemovingItem(info, this.openFileRoots); + } + if (this.openFilesReferenced.indexOf(info) >= 0) { + this.openFilesReferenced = copyListRemovingItem(info, this.openFilesReferenced); + } + this.openFileRootsConfigured.push(info); } - if (this.openFilesReferenced.indexOf(info) >= 0) { - this.openFilesReferenced = copyListRemovingItem(info, this.openFilesReferenced); - } - this.openFileRootsConfigured.push(info); } project.addRoot(info); }