Skip to content

Adds missing methods from checker api - #65037

Open
Isabel Duan (iisaduan) wants to merge 3 commits into
microsoft:mainfrom
iisaduan:checkerApi
Open

Isabel Duan (iisaduan) wants to merge 3 commits into
microsoft:mainfrom
iisaduan:checkerApi

Conversation

@iisaduan

Copy link
Copy Markdown
Member

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 thread packages/typescript/test/sync/api-generators.test.ts
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)) : [];
Comment thread tsc/internal/api/proto.go
type GetNumberLiteralTypeParams struct {
Snapshot SnapshotID `json:"snapshot"`
Project project.Handle `json:"project"`
Value float64 `json:"value"`
Comment thread tsc/internal/api/session.go
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants