TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

fix(formatting): recover from token spans outside property children

Open ahfoysal opened this issue 4 months ago • 2 comments

Summary

  • Fix formatting recursion guard in processChildNode to handle scanner tokens that overrun the current child node boundary in recovery scenarios.
  • Add regression fourslash test for the invalid type-literal property syntax (type X = { prop: = \${abc}`xyz }) that triggered Debug Failure. False expression: Token end is child end`.

Validation

  • npx hereby runtests --tests formattingTokenEndChildEnd --light=false
    • ✅ 1 passing (fourslash regression)

Fixes #63598.

ahfoysal avatar Jul 07 '26 08:07 ahfoysal

@microsoft-github-policy-service agree

ahfoysal avatar Jul 07 '26 08:07 ahfoysal

@ahfoysal You should read this: https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md

MartinJohns avatar Jul 07 '26 11:07 MartinJohns

The TypeScript repo is closed for development; PR should be in the typescript-go repo. Please see the top section of CONTRIBUTING.md and pinned issue #62963.

RyanCavanaugh avatar Jul 10 '26 19:07 RyanCavanaugh