Skip to content

Commit 70b8b4a

Browse files
committed
Log structureIsReused value
1 parent b1bd6d6 commit 70b8b4a

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
@@ -1195,12 +1195,12 @@ namespace ts.server {
11951195
);
11961196
const elapsed = timestamp() - start;
11971197
this.sendPerformanceEvent("UpdateGraph", elapsed);
1198-
this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram} Elapsed: ${elapsed}ms`);
1198+
this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${(<any>ts).StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
11991199
if (this.hasAddedorRemovedFiles) {
12001200
this.print(/*writeProjectFileNames*/ true);
12011201
}
12021202
else if (this.program !== oldProgram) {
1203-
this.writeLog(`Different program with same set of files:: structureIsReused:: ${this.program.structureIsReused}`);
1203+
this.writeLog(`Different program with same set of files`);
12041204
}
12051205
return hasNewProgram;
12061206
}

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
@@ -55,7 +55,7 @@ FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: WatchTy
5555
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Missing file
5656
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
5757
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
58-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true Elapsed:: *ms
58+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms
5959
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
6060
Files (9)
6161
/a/lib/lib.d.ts
@@ -181,8 +181,8 @@ import { something2 } from "./fileNotFound";
181181

182182
Modify global file::
183183
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
184-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false Elapsed:: *ms
185-
Different program with same set of files:: structureIsReused:: 2
184+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
185+
Different program with same set of files
186186

187187
Project: /user/username/projects/myproject/tsconfig.json
188188
{"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; }"}
@@ -249,7 +249,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
249249
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
250250
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'.
251251
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
252-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true Elapsed:: *ms
252+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms
253253
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
254254
Files (10)
255255
/a/lib/lib.d.ts
@@ -390,7 +390,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
390390
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
391391
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'.
392392
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
393-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true Elapsed:: *ms
393+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true structureIsReused:: Not Elapsed:: *ms
394394
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
395395
Files (11)
396396
/a/lib/lib.d.ts
@@ -523,8 +523,8 @@ Modify main file::
523523
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
524524
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'.
525525
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
526-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false Elapsed:: *ms
527-
Different program with same set of files:: structureIsReused:: 2
526+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
527+
Different program with same set of files
528528

529529
Project: /user/username/projects/myproject/tsconfig.json
530530
{"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; }"}
@@ -604,7 +604,7 @@ File '/user/username/projects/myproject/src/newFile.ts' exist - use it as a name
604604
======== Module name './newFile' was successfully resolved to '/user/username/projects/myproject/src/newFile.ts'. ========
605605
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'.
606606
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
607-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true Elapsed:: *ms
607+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true structureIsReused:: Not Elapsed:: *ms
608608
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
609609
Files (12)
610610
/a/lib/lib.d.ts
@@ -764,7 +764,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
764764
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'.
765765
DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
766766
Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
767-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true Elapsed:: *ms
767+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true structureIsReused:: Not Elapsed:: *ms
768768
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
769769
Files (13)
770770
/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
@@ -55,7 +55,7 @@ FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: WatchTy
5555
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Missing file
5656
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
5757
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
58-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true Elapsed:: *ms
58+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms
5959
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
6060
Files (9)
6161
/a/lib/lib.d.ts
@@ -181,8 +181,8 @@ import { something2 } from "./fileNotFound";
181181

182182
Modify global file::
183183
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
184-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false Elapsed:: *ms
185-
Different program with same set of files:: structureIsReused:: 2
184+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
185+
Different program with same set of files
186186

187187
Project: /user/username/projects/myproject/tsconfig.json
188188
{"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; }"}
@@ -249,7 +249,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
249249
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
250250
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'.
251251
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
252-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true Elapsed:: *ms
252+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms
253253
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
254254
Files (10)
255255
/a/lib/lib.d.ts
@@ -390,7 +390,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
390390
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
391391
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'.
392392
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
393-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true Elapsed:: *ms
393+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true structureIsReused:: Not Elapsed:: *ms
394394
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
395395
Files (11)
396396
/a/lib/lib.d.ts
@@ -523,8 +523,8 @@ Modify main file::
523523
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
524524
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'.
525525
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
526-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false Elapsed:: *ms
527-
Different program with same set of files:: structureIsReused:: 2
526+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
527+
Different program with same set of files
528528

529529
Project: /user/username/projects/myproject/tsconfig.json
530530
{"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; }"}
@@ -604,7 +604,7 @@ File '/user/username/projects/myproject/src/newFile.ts' exist - use it as a name
604604
======== Module name './newFile' was successfully resolved to '/user/username/projects/myproject/src/newFile.ts'. ========
605605
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'.
606606
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
607-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true Elapsed:: *ms
607+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true structureIsReused:: Not Elapsed:: *ms
608608
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
609609
Files (12)
610610
/a/lib/lib.d.ts
@@ -764,7 +764,7 @@ Reusing resolution of module './filePresent' from '/user/username/projects/mypro
764764
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'.
765765
DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
766766
Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
767-
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true Elapsed:: *ms
767+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true structureIsReused:: Not Elapsed:: *ms
768768
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
769769
Files (13)
770770
/a/lib/lib.d.ts

0 commit comments

Comments
 (0)