Repository navigation
Adds missing methods from checker api - #65037
Open
Isabel Duan (iisaduan) wants to merge 3 commits into
Open
Isabel Duan (iisaduan) wants to merge 3 commits into
Isabel Duan (iisaduan) wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Nine new Checker getters are neither tested nor exempted, causing the coverage assertion to fail, with additional unresolved non-finite-number serialization, nullable protocol typing, and cache-reuse issues.
4 open issues
What changed in this PR
Expands the JavaScript Checker API with twelve methods, exposing more native compiler functionality through async, sync, and generator-based clients.
Changes:
- Adds literal and nullable type getters, plus overload, ambient-module, destructuring, JSX, and private-property queries.
- Connects the new methods through Go handlers and generated protocol declarations.
- Adds API tests and generator parity cases.
| File | Description |
|---|---|
tsc/internal/checker/exports.go |
Exposes native checker helpers. |
tsc/internal/api/session.go |
Dispatches and handles the new requests. |
tsc/internal/api/proto.go |
Defines method names and request parameters. |
packages/typescript/test/sync/api.test.ts |
Adds generated synchronous API tests. |
packages/typescript/test/sync/api-generators.test.ts |
Adds generator parity cases. |
packages/typescript/test/async/api.test.ts |
Tests the new Checker methods. |
packages/typescript/src/api/sync/api.ts |
Adds generated sync and generator methods. |
packages/typescript/src/api/proto.ts |
Registers boolean literal getters as intrinsic methods. |
packages/typescript/src/api/proto.generated.ts |
Adds generated protocol and batch declarations. |
packages/typescript/src/api/async/api.ts |
Exposes the new async Checker methods. |
Review effort: Balanced
Comment on lines
+2810
to
+2815
| const data = await this.client.apiRequest("getAugmentedPropertiesOfType", { | ||
| snapshot: this.snapshotId, | ||
| project: this.project.handle, | ||
| objectId: type.id, | ||
| }); | ||
| return data ? data.map(d => this.objectRegistry.getOrCreateSymbol(d)) : []; |
| type GetNumberLiteralTypeParams struct { | ||
| Snapshot SnapshotID `json:"snapshot"` | ||
| Project project.Handle `json:"project"` | ||
| Value float64 `json:"value"` |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds ~half the methods missing in Checker: https://github.com/microsoft/TypeScript/pull/64749/changes#diff-4776036ff539c2fa009621dc13a9f2c8fd15d50e9302e8a361614ab640659a2eR72
•
isImplementationOfOverload(node: Node): Promise<boolean>•
getAmbientModules(): Promise<readonly Symbol[]>•
getPropertySymbolOfDestructuringAssignment(location: Identifier): Promise<Symbol | undefined>•
getNullableType(type: Type, flags: TypeFlags): Promise<Type>•
getStringLiteralType(value: string): Promise<Type>•
getNumberLiteralType(value: number): Promise<Type>•
getBigIntLiteralType(value: bigint): Promise<Type>•
getFalseType(): Promise<Type>•
getTrueType(): Promise<Type>•
getAugmentedPropertiesOfType(type: Type): Promise<readonly Symbol[]>•
getJsxIntrinsicTagNamesAt(location: Node): Promise<readonly Symbol[]>•
getPrivateIdentifierPropertyOfType(type: Type, name: string, location: Node): Promise<Symbol | undefined>