Skip to content

Commit 8c5ae9b

Browse files
committed
Skip loading configured project just to report project info through synchronizeProjectList for project opened by external project
// TODO: update tests
1 parent 9a8c2d0 commit 8c5ae9b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/server/project.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ namespace ts.server {
149149
*/
150150
private projectStateVersion = 0;
151151

152+
protected isInitialLoadPending: () => boolean = returnFalse;
153+
152154
/*@internal*/
153155
dirty = false;
154156

@@ -1025,7 +1027,10 @@ namespace ts.server {
10251027

10261028
/* @internal */
10271029
getChangesSinceVersion(lastKnownVersion?: number): ProjectFilesWithTSDiagnostics {
1028-
this.updateGraph();
1030+
// Update the graph only if initial configured project load is not pending
1031+
if (!this.isInitialLoadPending()) {
1032+
this.updateGraph();
1033+
}
10291034

10301035
const info: protocol.ProjectVersionInfo = {
10311036
projectName: this.getProjectName(),
@@ -1312,6 +1317,8 @@ namespace ts.server {
13121317
/*@internal*/
13131318
projectOptions?: ProjectOptions | true;
13141319

1320+
protected isInitialLoadPending: () => boolean = returnTrue;
1321+
13151322
/*@internal*/
13161323
constructor(configFileName: NormalizedPath,
13171324
projectService: ProjectService,
@@ -1335,6 +1342,7 @@ namespace ts.server {
13351342
* @returns: true if set of files in the project stays the same and false - otherwise.
13361343
*/
13371344
updateGraph(): boolean {
1345+
this.isInitialLoadPending = returnFalse;
13381346
const reloadLevel = this.pendingReload;
13391347
this.pendingReload = ConfigFileProgramReloadLevel.None;
13401348
let result: boolean;

0 commit comments

Comments
 (0)