| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Recover an attribute assignment after a trailing JSX tag dot without consuming the attribute name as a property. Cover matching ranges, JSX/TSX attributes, valid spaced property names, and mismatched tags. Fixes microsoft#56669
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Sorry, something went wrong.
There was a problem hiding this comment.
The focused parser recovery is well-scoped and covered by comprehensive regression cases.
Review effort: Balanced
Findings: None
Recovers incomplete JSX property tags so linked editing remains available when followed by assigned attributes.
Changes:
| File | Description |
|---|---|
| tsc/internal/parser/parser.go | Adds JSX parser recovery for incomplete property tags. |
| tsc/internal/fourslash/tests/linkedEditingJsxTagIncompleteProperty_test.go | Tests linked editing and parser recovery scenarios. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
|
@microsoft-github-policy-service agree |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #56669.
Deleting B from <A.B foo="bar"></A.B> leaves <A. foo="bar"></A.>. The parser currently consumes foo as part of the opening tag name, losing the matching JSX element and its linked editing ranges.
When whitespace after a JSX tag's dot is followed by an attribute assignment, recover with a missing property identifier and leave the attribute for the JSX attribute parser. Valid property names separated by whitespace continue to parse normally. This also handles hyphenated and namespaced attribute names.
Adds linked-editing regression coverage for TSX and JSX, string and expression attributes, keyword/hyphenated/namespaced attributes, nested property names, multiline and spread attributes, valid spaced property names, and mismatched tags. The original reproduction fails on the unmodified main commit.
Validation on Linux with Go 1.27.0, Node 24.21.0, and npm 11.19.1:
AI assistance: Codex was used to investigate this issue, implement the parser change, and prepare and run the tests.