Skip to content

Commit 7e761cd

Browse files
committed
Actually make the tsserver tests with persistResolutions
1 parent 22b9cba commit 7e761cd

4 files changed

+88
-115
lines changed

src/testRunner/unittests/tsserver/persistResolutions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace ts.projectSystem {
5353
compilerOptions: {
5454
module: "amd",
5555
composite: true,
56-
// persistResolutions: true,
56+
persistResolutions: true,
5757
traceResolution: true,
5858
outFile
5959
},

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

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Config: /user/username/projects/myproject/tsconfig.json : {
2020
"options": {
2121
"module": 2,
2222
"composite": true,
23+
"persistResolutions": true,
2324
"traceResolution": true,
2425
"configFilePath": "/user/username/projects/myproject/tsconfig.json"
2526
}
@@ -47,10 +48,15 @@ File '/user/username/projects/myproject/src/fileNotFound.d.ts' does not exist.
4748
File '/user/username/projects/myproject/src/fileNotFound.js' does not exist.
4849
File '/user/username/projects/myproject/src/fileNotFound.jsx' does not exist.
4950
======== Module name './fileNotFound' was not resolved. ========
50-
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
51-
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
52-
Reusing resolution of module './filePresent' 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/filePresent.ts'.
53-
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 not resolved.
51+
======== Resolving module './filePresent' from '/user/username/projects/myproject/src/main.ts'. ========
52+
Resolution for module './filePresent' was found in cache from location '/user/username/projects/myproject/src'.
53+
======== Module name './filePresent' was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'. ========
54+
======== Resolving module './filePresent' from '/user/username/projects/myproject/src/main.ts'. ========
55+
Resolution for module './filePresent' was found in cache from location '/user/username/projects/myproject/src'.
56+
======== Module name './filePresent' was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'. ========
57+
======== Resolving module './fileNotFound' from '/user/username/projects/myproject/src/main.ts'. ========
58+
Resolution for module './fileNotFound' was found in cache from location '/user/username/projects/myproject/src'.
59+
======== Module name './fileNotFound' was not resolved. ========
5460
FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: WatchType: Closed Script info
5561
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Missing file
5662
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
@@ -239,17 +245,15 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalNe
239245
Scheduled: /user/username/projects/myproject/tsconfig.json
240246
Scheduled: *ensureProjectForOpenFiles*
241247
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalNewFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
242-
DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalNewFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
243-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
244-
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalNewFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
245248
Running: /user/username/projects/myproject/tsconfig.json
246249
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalNewFile.ts 500 undefined Project: WatchType: Closed Script info
247250
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
248251
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
249252
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
250253
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'.
254+
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'.
251255
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 structureIsReused:: Not Elapsed:: *ms
256+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
253257
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
254258
Files (10)
255259
/a/lib/lib.d.ts
@@ -380,17 +384,15 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalFi
380384
Scheduled: /user/username/projects/myproject/tsconfig.json, Cancelled earlier one
381385
Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
382386
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalFileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
383-
DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalFileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
384-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
385-
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalFileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
386387
Running: /user/username/projects/myproject/tsconfig.json
387388
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined Project: WatchType: Closed Script info
388389
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
389390
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
390391
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
391392
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'.
393+
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'.
392394
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 structureIsReused:: Not Elapsed:: *ms
395+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
394396
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
395397
Files (11)
396398
/a/lib/lib.d.ts
@@ -522,6 +524,7 @@ import { something2 } from "./fileNotFound";
522524
Modify main file::
523525
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
524526
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'.
527+
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'.
525528
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
526529
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
527530
Different program with same set of files
@@ -590,21 +593,19 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/newFile.
590593
Scheduled: /user/username/projects/myproject/tsconfig.json
591594
Scheduled: *ensureProjectForOpenFiles*
592595
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/newFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
593-
DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/newFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
594-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
595-
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/newFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
596596
Running: /user/username/projects/myproject/tsconfig.json
597597
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/newFile.ts 500 undefined Project: WatchType: Closed Script info
598598
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
599599
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
600600
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
601+
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'.
602+
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'.
603+
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
601604
======== Resolving module './newFile' from '/user/username/projects/myproject/src/main.ts'. ========
602605
Module resolution kind is not specified, using 'Classic'.
603606
File '/user/username/projects/myproject/src/newFile.ts' exist - use it as a name resolution result.
604607
======== Module name './newFile' was successfully resolved to '/user/username/projects/myproject/src/newFile.ts'. ========
605-
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'.
606-
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 structureIsReused:: Not Elapsed:: *ms
608+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
608609
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
609610
Files (12)
610611
/a/lib/lib.d.ts
@@ -747,29 +748,20 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/fileNotF
747748
Scheduled: /user/username/projects/myproject/tsconfig.json
748749
Scheduled: *ensureProjectForOpenFiles*
749750
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/fileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
750-
DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/fileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
751-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
752-
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/fileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
753751
Running: /user/username/projects/myproject/tsconfig.json
754-
Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
755752
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileNotFound.ts 500 undefined Project: WatchType: Closed Script info
756753
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
757754
Reusing resolution of module './filePresent' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'.
758-
======== Resolving module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts'. ========
759-
Module resolution kind is not specified, using 'Classic'.
760-
File '/user/username/projects/myproject/src/fileNotFound.ts' exist - use it as a name resolution result.
761-
======== Module name './fileNotFound' was successfully resolved to '/user/username/projects/myproject/src/fileNotFound.ts'. ========
755+
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
762756
Reusing resolution of module './newFile' from '/user/username/projects/myproject/src/main.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/newFile.ts'.
763757
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'.
764-
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'.
765-
DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
766-
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 structureIsReused:: Not Elapsed:: *ms
758+
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'.
759+
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
760+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
768761
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
769762
Files (13)
770763
/a/lib/lib.d.ts
771764
/user/username/projects/myproject/src/filePresent.ts
772-
/user/username/projects/myproject/src/fileNotFound.ts
773765
/user/username/projects/myproject/src/anotherFileReusingResolution.ts
774766
/user/username/projects/myproject/src/types.ts
775767
/user/username/projects/myproject/src/fileWithRef.ts
@@ -780,6 +772,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured)
780772
/user/username/projects/myproject/src/globalMain.ts
781773
/user/username/projects/myproject/src/newFile.ts
782774
/user/username/projects/myproject/src/main.ts
775+
/user/username/projects/myproject/src/fileNotFound.ts
783776

784777

785778
../../../../a/lib/lib.d.ts
@@ -789,10 +782,6 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured)
789782
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
790783
Imported via "./filePresent" from file 'src/main.ts'
791784
Imported via "./filePresent" from file 'src/main.ts'
792-
src/fileNotFound.ts
793-
Imported via "./fileNotFound" from file 'src/anotherFileReusingResolution.ts'
794-
Imported via "./fileNotFound" from file 'src/main.ts'
795-
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
796785
src/anotherFileReusingResolution.ts
797786
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
798787
src/types.ts
@@ -820,6 +809,8 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured)
820809
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
821810
src/main.ts
822811
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
812+
src/fileNotFound.ts
813+
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
823814

824815
-----------------------------------------------
825816
Running: *ensureProjectForOpenFiles*
@@ -861,9 +852,6 @@ interface Array<T> { length: number; [n: number]: T; }
861852
{"fileName":"/user/username/projects/myproject/src/filePresent.ts","version":"11598859296-export function something() { return 10; }"}
862853
export function something() { return 10; }
863854

864-
{"fileName":"/user/username/projects/myproject/src/fileNotFound.ts","version":"-497034637-export function something2() { return 20; }"}
865-
export function something2() { return 20; }
866-
867855
{"fileName":"/user/username/projects/myproject/src/anotherFileReusingResolution.ts","version":"-18180953903-import { something } from \"./filePresent\";\nimport { something2 } from \"./fileNotFound\";"}
868856
import { something } from "./filePresent";
869857
import { something2 } from "./fileNotFound";
@@ -909,3 +897,6 @@ import { something2 } from "./fileNotFound";
909897
something();
910898

911899

900+
{"fileName":"/user/username/projects/myproject/src/fileNotFound.ts","version":"-497034637-export function something2() { return 20; }"}
901+
export function something2() { return 20; }
902+

0 commit comments

Comments
 (0)