Allow export map entries to remap back to input files for a program (#47925)

* Allow export map entries to remap back to input files for a program

* Fix file casing issues on windows

* Implement abiguity error, doesnt quite work

* Refine selection logic in error case to use getCommonSourceDirectory, add more tests
This commit is contained in:
Wesley Wigham authored and GitHub committed 2022-05-05 12:53:56 -07:00
1 parent 1e157ef1b2
commit 8e433cda3d
55 files changed
+1035 -13

No files matched your search

@@ -215,6 +215,7 @@ namespace ts {
extension: Extension.Ts,
},
failedLookupLocations: [],
resolutionDiagnostics: [],
});
assert.isDefined(cache.get("/sub"));
assert.isUndefined(cache.get("/"));
@@ -228,6 +229,7 @@ namespace ts {
extension: Extension.Ts,
},
failedLookupLocations: [],
resolutionDiagnostics: [],
});
assert.isDefined(cache.get("/sub/dir/foo"));
assert.isDefined(cache.get("/sub/dir"));
@@ -243,6 +245,7 @@ namespace ts {
extension: Extension.Ts,
},
failedLookupLocations: [],
resolutionDiagnostics: [],
});
assert.isDefined(cache.get("/foo/bar"));
assert.isDefined(cache.get("/foo"));
@@ -257,6 +260,7 @@ namespace ts {
extension: Extension.Ts,
},
failedLookupLocations: [],
resolutionDiagnostics: [],
});
assert.isDefined(cache.get("/foo"));
assert.isUndefined(cache.get("/"));
@@ -270,6 +274,7 @@ namespace ts {
extension: Extension.Ts,
},
failedLookupLocations: [],
resolutionDiagnostics: [],
});
assert.isDefined(cache.get("c:/foo"));
assert.isDefined(cache.get("c:/"));
@@ -279,6 +284,7 @@ namespace ts {
cache.set("/foo/bar/baz", {
resolvedModule: undefined,
failedLookupLocations: [],
resolutionDiagnostics: [],
});
assert.isDefined(cache.get("/foo/bar/baz"));
assert.isDefined(cache.get("/foo/bar"));