Fix panic in inlay hints for tuple types #2040
Draft
+73
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix crash in VSCode:
Unhandled case in Node.ElementList: KindTupleTypeSummary
Fixed a crash that occurred when using TypeScript inlay hints with tuple types. The crash happened when the language server tried to display type information for parameters with tuple types like
[string][].Plan
ElementList()method doesn't handleKindTupleTypeKindTupleTypecase toElementList()method ininternal/ast/ast.goChanges Made
ElementList()ininternal/ast/ast.go: Added handling forKindTupleTypeby returning the Elements field from TupleTypeNodeTestInlayHintsTupleTypeCrash: Reproduces the original issue with tuple types in inlay hints (now ininternal/fourslash/tests/)Testing & Validation
✅ Test passes in new location
✅ All existing tests pass
✅ Linting passes - 0 issues
✅ Formatting check passes
✅ CodeQL security check - no issues found
Original prompt
This section details on the original issue you should resolve
<issue_title>Crash in VSCode:
Unhandled case in Node.ElementList: KindTupleType</issue_title><issue_description>## Stack trace