Skip to content

Commit 0e5cc65

Browse files
committed
Log structureIsReused value
1 parent 506f1cf commit 0e5cc65

4 files changed

+29
-29
lines changed

src/server/project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,12 +1221,12 @@ namespace ts.server {
12211221
);
12221222
const elapsed = timestamp() - start;
12231223
this.sendPerformanceEvent("UpdateGraph", elapsed);
1224-
this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram} Elapsed: ${elapsed}ms`);
1224+
this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${(<any>ts).StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
12251225
if (this.hasAddedorRemovedFiles) {
12261226
this.print(/*writeProjectFileNames*/ true);
12271227
}
12281228
else if (this.program !== oldProgram) {
1229-
this.writeLog(`Different program with same set of files:: structureIsReused:: ${this.program?.structureIsReused}`);
1229+
this.writeLog(`Different program with same set of files`);
12301230
}
12311231
return hasNewProgram;
12321232
}

tests/baselines/reference/tsserver/persistResolutions/creates-new-resolutions-for-program-if-tsbuildinfo-is-not-present.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed
5252
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Missing file
5353
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
5454
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
55-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true Elapsed:: *ms
55+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms
5656
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
5757
Files (9)
5858
/a/lib/lib.d.ts
@@ -167,8 +167,8 @@ import { something2 } from "./fileNotFound";
167167

168168
Modify global file::
169169
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
170-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false Elapsed:: *ms
171-
Different program with same set of files:: structureIsReused:: 2
170+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
171+
Different program with same set of files
172172

173173
Project: /user/username/projects/myproject/tsconfig.json
174174
{"fileName":"/a/lib/lib.d.ts","version":"-7698705165-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }"}
@@ -235,7 +235,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
235235
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
236236
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
237237
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
238-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true Elapsed:: *ms
238+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms
239239
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
240240
Files (10)
241241
/a/lib/lib.d.ts
@@ -376,7 +376,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
376376
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
377377
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
378378
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
379-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true Elapsed:: *ms
379+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true structureIsReused:: Not Elapsed:: *ms
380380
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
381381
Files (11)
382382
/a/lib/lib.d.ts
@@ -509,8 +509,8 @@ Modify main file::
509509
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
510510
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
511511
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
512-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false Elapsed:: *ms
513-
Different program with same set of files:: structureIsReused:: 2
512+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
513+
Different program with same set of files
514514

515515
Project: /user/username/projects/myproject/tsconfig.json
516516
{"fileName":"/a/lib/lib.d.ts","version":"-7698705165-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }"}
@@ -590,7 +590,7 @@ File '/user/username/projects/myproject/src/newFile.ts' exist - use it as a name
590590
======== Module name './newFile' was successfully resolved to '/user/username/projects/myproject/src/newFile.ts'. ========
591591
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
592592
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
593-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true Elapsed:: *ms
593+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true structureIsReused:: Not Elapsed:: *ms
594594
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
595595
Files (12)
596596
/a/lib/lib.d.ts
@@ -750,7 +750,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
750750
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' found in cache from location '/user/username/projects/myproject/src', it was successfully resolved to '/user/username/projects/myproject/src/fileNotFound.ts'.
751751
DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
752752
Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
753-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true Elapsed:: *ms
753+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true structureIsReused:: Not Elapsed:: *ms
754754
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
755755
Files (13)
756756
/a/lib/lib.d.ts

tests/baselines/reference/tsserver/persistResolutions/creates-new-resolutions-for-program-if-tsbuildinfo-is-present-but-program-is-not-persisted.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed
5252
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Missing file
5353
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
5454
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
55-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true Elapsed:: *ms
55+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms
5656
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
5757
Files (9)
5858
/a/lib/lib.d.ts
@@ -167,8 +167,8 @@ import { something2 } from "./fileNotFound";
167167

168168
Modify global file::
169169
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
170-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false Elapsed:: *ms
171-
Different program with same set of files:: structureIsReused:: 2
170+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
171+
Different program with same set of files
172172

173173
Project: /user/username/projects/myproject/tsconfig.json
174174
{"fileName":"/a/lib/lib.d.ts","version":"-7698705165-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }"}
@@ -235,7 +235,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
235235
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
236236
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
237237
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
238-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true Elapsed:: *ms
238+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms
239239
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
240240
Files (10)
241241
/a/lib/lib.d.ts
@@ -376,7 +376,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
376376
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
377377
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
378378
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
379-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true Elapsed:: *ms
379+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true structureIsReused:: Not Elapsed:: *ms
380380
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
381381
Files (11)
382382
/a/lib/lib.d.ts
@@ -509,8 +509,8 @@ Modify main file::
509509
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
510510
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
511511
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
512-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false Elapsed:: *ms
513-
Different program with same set of files:: structureIsReused:: 2
512+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
513+
Different program with same set of files
514514

515515
Project: /user/username/projects/myproject/tsconfig.json
516516
{"fileName":"/a/lib/lib.d.ts","version":"-7698705165-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }"}
@@ -590,7 +590,7 @@ File '/user/username/projects/myproject/src/newFile.ts' exist - use it as a name
590590
======== Module name './newFile' was successfully resolved to '/user/username/projects/myproject/src/newFile.ts'. ========
591591
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
592592
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
593-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true Elapsed:: *ms
593+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true structureIsReused:: Not Elapsed:: *ms
594594
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
595595
Files (12)
596596
/a/lib/lib.d.ts
@@ -750,7 +750,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
750750
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' found in cache from location '/user/username/projects/myproject/src', it was successfully resolved to '/user/username/projects/myproject/src/fileNotFound.ts'.
751751
DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
752752
Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
753-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true Elapsed:: *ms
753+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true structureIsReused:: Not Elapsed:: *ms
754754
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
755755
Files (13)
756756
/a/lib/lib.d.ts

0 commit comments

Comments
 (0)