Skip to content

Fix JSDoc node types - #65499

Open
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/ast-schema-contracts
Open

Jake Bailey (jakebailey) wants to merge 1 commit 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

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