Skip to content

Commit ee87890

Browse files
committed
Actually make the tsserver tests with persistResolutions
1 parent 0e5cc65 commit ee87890

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
@@ -17,6 +17,7 @@ Config: /user/username/projects/myproject/tsconfig.json : {
1717
"options": {
1818
"module": 2,
1919
"composite": true,
20+
"persistResolutions": true,
2021
"traceResolution": true,
2122
"configFilePath": "/user/username/projects/myproject/tsconfig.json"
2223
}
@@ -44,10 +45,15 @@ File '/user/username/projects/myproject/src/fileNotFound.d.ts' does not exist.
4445
File '/user/username/projects/myproject/src/fileNotFound.js' does not exist.
4546
File '/user/username/projects/myproject/src/fileNotFound.jsx' does not exist.
4647
======== Module name './fileNotFound' was not resolved. ========
47-
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
48-
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
49-
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'.
50-
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.
48+
======== Resolving module './filePresent' from '/user/username/projects/myproject/src/main.ts'. ========
49+
Resolution for module './filePresent' was found in cache from location '/user/username/projects/myproject/src'.
50+
======== Module name './filePresent' was successfully resolved to '/user/username/projects/myproject/src/filePresent.ts'. ========
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 './fileNotFound' from '/user/username/projects/myproject/src/main.ts'. ========
55+
Resolution for module './fileNotFound' was found in cache from location '/user/username/projects/myproject/src'.
56+
======== Module name './fileNotFound' was not resolved. ========
5157
FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info
5258
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Missing file
5359
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots
@@ -225,17 +231,15 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalNe
225231
Scheduled: /user/username/projects/myproject/tsconfig.json
226232
Scheduled: *ensureProjectForOpenFiles*
227233
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalNewFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
228-
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
229-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
230-
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
231234
Running: /user/username/projects/myproject/tsconfig.json
232235
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalNewFile.ts 500 undefined WatchType: Closed Script info
233236
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
234237
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'.
235238
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
236239
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'.
240+
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'.
237241
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 structureIsReused:: Not Elapsed:: *ms
242+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
239243
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
240244
Files (10)
241245
/a/lib/lib.d.ts
@@ -366,17 +370,15 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalFi
366370
Scheduled: /user/username/projects/myproject/tsconfig.json, Cancelled earlier one
367371
Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
368372
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/globalFileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
369-
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
370-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
371-
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
372373
Running: /user/username/projects/myproject/tsconfig.json
373374
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/globalFileNotFound.ts 500 undefined WatchType: Closed Script info
374375
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
375376
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'.
376377
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
377378
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'.
379+
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'.
378380
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 structureIsReused:: Not Elapsed:: *ms
381+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
380382
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
381383
Files (11)
382384
/a/lib/lib.d.ts
@@ -508,6 +510,7 @@ import { something2 } from "./fileNotFound";
508510
Modify main file::
509511
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
510512
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'.
513+
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'.
511514
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
512515
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 5 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
513516
Different program with same set of files
@@ -576,21 +579,19 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/newFile.
576579
Scheduled: /user/username/projects/myproject/tsconfig.json
577580
Scheduled: *ensureProjectForOpenFiles*
578581
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/newFile.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
579-
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
580-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
581-
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
582582
Running: /user/username/projects/myproject/tsconfig.json
583583
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/newFile.ts 500 undefined WatchType: Closed Script info
584584
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
585585
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'.
586586
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
587+
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'.
588+
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'.
589+
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
587590
======== Resolving module './newFile' from '/user/username/projects/myproject/src/main.ts'. ========
588591
Module resolution kind is not specified, using 'Classic'.
589592
File '/user/username/projects/myproject/src/newFile.ts' exist - use it as a name resolution result.
590593
======== Module name './newFile' was successfully resolved to '/user/username/projects/myproject/src/newFile.ts'. ========
591-
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'.
592-
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 structureIsReused:: Not Elapsed:: *ms
594+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 6 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
594595
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
595596
Files (12)
596597
/a/lib/lib.d.ts
@@ -733,29 +734,20 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/fileNotF
733734
Scheduled: /user/username/projects/myproject/tsconfig.json
734735
Scheduled: *ensureProjectForOpenFiles*
735736
Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/src/fileNotFound.ts :: WatchInfo: /user/username/projects/myproject/src 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory
736-
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
737-
Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation
738-
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
739737
Running: /user/username/projects/myproject/tsconfig.json
740-
Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
741738
FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileNotFound.ts 500 undefined WatchType: Closed Script info
742739
Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json
743740
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'.
744-
======== Resolving module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts'. ========
745-
Module resolution kind is not specified, using 'Classic'.
746-
File '/user/username/projects/myproject/src/fileNotFound.ts' exist - use it as a name resolution result.
747-
======== Module name './fileNotFound' was successfully resolved to '/user/username/projects/myproject/src/fileNotFound.ts'. ========
741+
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/anotherFileReusingResolution.ts' of old program, it was not resolved.
748742
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'.
749743
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'.
750-
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'.
751-
DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations
752-
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 structureIsReused:: Not Elapsed:: *ms
744+
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'.
745+
Reusing resolution of module './fileNotFound' from '/user/username/projects/myproject/src/main.ts' of old program, it was not resolved.
746+
Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 7 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms
754747
Project '/user/username/projects/myproject/tsconfig.json' (Configured)
755748
Files (13)
756749
/a/lib/lib.d.ts
757750
/user/username/projects/myproject/src/filePresent.ts
758-
/user/username/projects/myproject/src/fileNotFound.ts
759751
/user/username/projects/myproject/src/anotherFileReusingResolution.ts
760752
/user/username/projects/myproject/src/types.ts
761753
/user/username/projects/myproject/src/fileWithRef.ts
@@ -766,6 +758,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured)
766758
/user/username/projects/myproject/src/globalMain.ts
767759
/user/username/projects/myproject/src/newFile.ts
768760
/user/username/projects/myproject/src/main.ts
761+
/user/username/projects/myproject/src/fileNotFound.ts
769762

770763

771764
../../../../a/lib/lib.d.ts
@@ -775,10 +768,6 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured)
775768
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
776769
Imported via "./filePresent" from file 'src/main.ts'
777770
Imported via "./filePresent" from file 'src/main.ts'
778-
src/fileNotFound.ts
779-
Imported via "./fileNotFound" from file 'src/anotherFileReusingResolution.ts'
780-
Imported via "./fileNotFound" from file 'src/main.ts'
781-
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
782771
src/anotherFileReusingResolution.ts
783772
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
784773
src/types.ts
@@ -806,6 +795,8 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured)
806795
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
807796
src/main.ts
808797
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
798+
src/fileNotFound.ts
799+
Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'
809800

810801
-----------------------------------------------
811802
Running: *ensureProjectForOpenFiles*
@@ -847,9 +838,6 @@ interface Array<T> { length: number; [n: number]: T; }
847838
{"fileName":"/user/username/projects/myproject/src/filePresent.ts","version":"11598859296-export function something() { return 10; }"}
848839
export function something() { return 10; }
849840

850-
{"fileName":"/user/username/projects/myproject/src/fileNotFound.ts","version":"-497034637-export function something2() { return 20; }"}
851-
export function something2() { return 20; }
852-
853841
{"fileName":"/user/username/projects/myproject/src/anotherFileReusingResolution.ts","version":"-18180953903-import { something } from \"./filePresent\";\nimport { something2 } from \"./fileNotFound\";"}
854842
import { something } from "./filePresent";
855843
import { something2 } from "./fileNotFound";
@@ -895,3 +883,6 @@ import { something2 } from "./fileNotFound";
895883
something();
896884

897885

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

0 commit comments

Comments
 (0)