Skip to content

Fix JSDoc node types - #65499

Merged
Jake Bailey (jakebailey) merged 2 commits into
microsoft:mainfrom
jakebailey:compiler-fixes/ast-schema-contracts
Nov 17, 2026
Merged

Jake Bailey (jakebailey) merged 2 commits into
microsoft:mainfrom
jakebailey:compiler-fixes/ast-schema-contracts

Conversation

@jakebailey

Copy link
Copy Markdown
Member

These are all mistakes in the AST types.

ModuleBody is the most spooky of them. But in fact, ModuleBody could be Identifier in Strada and was declared that way! So, I guess bring that back so the types are truthful.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 04:16
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 14, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 14, 2026

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

The new tsExtends property is missing from the referenced schema’s node definition, so additionalProperties: false causes JSON Schema validation to reject it.

1 open issue
1 file not reviewed
  • tsc/internal/ast/ast_generated.go: Generated file
What changed in this PR

This PR aligns JSDoc AST types with parser output across the native compiler and TypeScript API.

Changes:

  • Corrects JSDoc signature children to use tag types rather than declaration types.
  • Adds Identifier to ModuleBody for qualified JSDoc names.
  • Updates generation support and adds API regression tests.
File Description
tsc/​internal/​ast/​ast_generated.go Updates generated JSDoc factory signatures and the ModuleBody comment.
tools/​scripts/​tsc/​schema.ts Adds public-base overrides and parenthesizes union array elements.
tools/​scripts/​tsc/​generate-ts-ast.ts Handles public-base overrides and parenthesized factory types.
tools/​scripts/​tsc/​ast.json Corrects JSDoc signature members and expands ModuleBody.
packages/​typescript/​test/​sync/​ast.test.ts Tests JSDoc types, traversal, and cloning.
packages/​typescript/​src/​ast/​visitor.generated.ts Validates signature return children as JSDoc return tags.
packages/​typescript/​src/​ast/​is.generated.ts Recognizes identifiers as module bodies.
packages/​typescript/​src/​ast/​factory.generated.ts Corrects JSDoc signature factory parameter types.
packages/​typescript/​src/​ast/​ast.generated.ts Updates public JSDoc signature and module-body types.

Review effort: Balanced

Comment thread tools/scripts/tsc/ast.json Resolved
JSDoc signatures contain documentation tags rather than ordinary
declaration children. Qualified JSDoc names also use namespace bodies
that can end in an identifier.

Describe these forms in the schema and generated public contracts.
Keep native storage inheritance separate from public inheritance,
and preserve union element types when generating readonly arrays.

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.

🟢 Approval recommended

The review identifies no active issues with the JSDoc AST contract changes.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • tsc/internal/ast/ast_generated.go: Generated file

Review effort: Balanced

Comment thread tools/scripts/tsc/ast.json Resolved
JSDoc signatures borrowed function-like storage, so their tag children
were reachable through accessors typed for parameter and type-parameter
declarations. The public API then needed separate TypeScript bases to
describe the real children.

Nothing binds or checks these signatures as functions; the reparser
converts them into real signature nodes. Declaring the tag fields
directly lets the native and public shapes agree, so the separate
TypeScript bases go away.
@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 17, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 17, 2026
Merged via the queue into microsoft:main with commit 10eae76 Nov 17, 2026
34 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the compiler-fixes/ast-schema-contracts branch November 17, 2026 21:36
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 17, 2026
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: Done

Development

Successfully merging this pull request may close these issues.

3 participants