Repository navigation
[api] Resolution utility APIs - #65591
Andrew Branch (andrewbranch) wants to merge 3 commits into
Conversation
Andrew Branch (andrewbranch)
commented
Nov 19, 2026
- API.getEffectiveTypeRoots
- API.getTsBuildInfoEmitOutputFilePath
- ModuleResolver.resolveTypeReferenceDirective
There was a problem hiding this comment.
🟡 Changes recommended
Omitting containingFile can cause a panic, while the compiler-option utilities mishandle ${configDir} and empty config paths.
2 open issues
What changed in this PR
Exposes compiler resolution and output-path helpers through the Go-backed TypeScript API, with asynchronous, synchronous, and generator-based support.
Changes:
- Add effective type-root and build-info output-path queries.
- Expose type-reference directive resolution with resolution modes, traces, and snapshot support.
- Extend protocol definitions and tests for validation, disposal, filesystem state, and generator parity.
| File | Description |
|---|---|
tsc/internal/api/session.go |
Dispatches new requests and implements path utility handlers. |
tsc/internal/api/session_module_resolution_test.go |
Tests invalid type-reference resolution requests. |
tsc/internal/api/proto.go |
Defines new protocol methods, parameters, and results. |
tsc/internal/api/module_resolution.go |
Adds type-reference resolution and shares resolver-context selection. |
packages/typescript/test/sync/api.test.ts |
Adds generated synchronous utility and resolution tests. |
packages/typescript/test/sync/api-generators.test.ts |
Checks generator parity for the new methods. |
packages/typescript/test/async/api.test.ts |
Tests utilities, resolution modes, snapshots, and disposal. |
packages/typescript/src/api/sync/api.ts |
Adds generated synchronous methods and generator variants. |
packages/typescript/src/api/proto.generated.ts |
Updates generated protocol types and batch method unions. |
packages/typescript/src/api/async/api.ts |
Exposes asynchronous utility and type-reference resolution methods. |
Review effort: Balanced
3d7d300 to
dcd7000
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Templated type roots are treated as literal paths during module resolution, and option finalization drops the build flag needed to calculate build-info paths.
2 open issues
2 resolved since last review
Review effort: Balanced
dcd7000 to
3a4c28d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Finalization drops the internal noDtsResolution option, and ${configDir} paths can resolve against the working directory instead of the config file directory.
2 open issues
2 resolved since last review
Review effort: Balanced
3a4c28d to
b72deea
Compare
b72deea to
f585bed
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Invalid enum inputs can panic or be truncated, malformed resolver options can silently change resolution, and case variants of ${configDir} are expanded incorrectly.
4 open issues
1 resolved since last review
Review effort: Balanced
f585bed to
4d7e1d3
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Resolving an existing mapped .box file with typeRoots: [] panics during type-reference lookup; mapped source extensions must be excluded while preserving declaration-shim fallback.
2 open issues
3 resolved since last review
Review effort: Balanced
4d7e1d3 to
2664a74
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2664a74 to
0b7bf2a
Compare
| return continueSearching() | ||
| default: | ||
| isExtraExtension := slices.Contains(r.resolver.extraExtensions, originalExtension) | ||
| isExtraExtension := r.extensions&extensionsTypeScript != 0 && slices.Contains(r.resolver.extraExtensions, originalExtension) |
There was a problem hiding this comment.
Drive-by fix related to content mappers found during Copilot review

