Skip to content

Expose labeled tuple element declarations in the TypeScript 7 API - #64109

Merged
Andrew Branch (andrewbranch) merged 3 commits into
mainfrom
copilot/fix-labeled-element-declarations
Aug 31, 2026
Merged

Expose labeled tuple element declarations in the TypeScript 7 API#64109
Andrew Branch (andrewbranch) merged 3 commits into
mainfrom
copilot/fix-labeled-element-declarations

Conversation

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

TypeScript 7 did not expose tuple element labels through TupleType, preventing API consumers from recovering foo and bar from:

function gh1449<T extends [foo: any, bar?: any]>(a: T): T;
  • API

    • Adds TupleType.labeledElementDeclarations.
    • Represents declarations as project-scoped NodeHandle<NamedTupleMember | ParameterDeclaration> values.
  • Protocol

    • Serializes labeled declarations only on tuple targets.
    • Preserves undefined entries for partially labeled tuples.
  • Coverage

    • Exercises label retrieval and node resolution through both async and sync APIs.

@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 31, 2026
Copilot AI linked an issue Aug 31, 2026 that may be closed by this pull request
1 task
Copilot AI and others added 2 commits August 31, 2026 18:20
Co-authored-by: andrewbranch <3277153+andrewbranch@users.noreply.github.com>
Co-authored-by: andrewbranch <3277153+andrewbranch@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing labeledElementDeclarations in TypeScript 7 Expose labeled tuple element declarations in the TypeScript 7 API Aug 31, 2026
@andrewbranch
Andrew Branch (andrewbranch) marked this pull request as ready for review August 31, 2026 22:57
Copilot AI balanced review requested due to automatic review settings August 31, 2026 22:57

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.

Pull request overview

Exposes tuple label declarations through the TypeScript 7 API.

Changes:

  • Serializes tuple-label node handles, preserving sparse entries.
  • Adds async and sync API properties and hydration.
  • Tests named tuple-member resolution.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsc/internal/api/session.go Creates label node handles.
tsc/internal/api/proto.go Adds protocol field.
packages/typescript/src/api/proto.generated.ts Updates generated protocol types.
packages/typescript/src/api/sync/types.ts Adds sync public property.
packages/typescript/src/api/sync/api.ts Hydrates sync node handles.
packages/typescript/test/sync/api.test.ts Tests sync label resolution.
packages/typescript/src/api/async/types.ts Adds async public property.
packages/typescript/src/api/async/api.ts Hydrates async node handles.
packages/typescript/test/async/api.test.ts Tests async label resolution.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +220 to +223
if resp.LabeledElementDeclarations == nil {
resp.LabeledElementDeclarations = make([]NodeHandle, len(elementInfos))
}
resp.LabeledElementDeclarations[i] = sd.nodeHandleFrom(declaration)
@andrewbranch
Andrew Branch (andrewbranch) added this pull request to the merge queue Aug 31, 2026
Merged via the queue into main with commit f52473a Aug 31, 2026
27 checks passed
@andrewbranch
Andrew Branch (andrewbranch) deleted the copilot/fix-labeled-element-declarations branch August 31, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API] labeledElementDeclarations is missing in TypeScript 7

4 participants