Repository navigation
Fix LS crashes found in checker order fuzz - #65390
Open
Jake Bailey (jakebailey) wants to merge 2 commits into
Open
Jake Bailey (jakebailey) wants to merge 2 commits into
Jake Bailey (jakebailey) wants to merge 2 commits into
Conversation
A type whose get and set accessors have different types prints them as accessors, which the inlay hint for it did not expect, so asking for the inlay hints of a variable of such a type crashed.
A type declared inside a generic function or method is printed as a member of that function or method, with its type arguments. A name with type arguments before its last part is an expression with type arguments, which appending the next member to it did not expect, so printing such a type, as hovering over a variable of it does, crashed.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the changes addressing Quick Info and inlay hint crashes.
No open issues 🎉
What changed in this PR
Fixes two native TypeScript language server crashes found through checker-order fuzzing, affecting Quick Info and inlay hints.
Changes:
- Handles nested references with intermediate type arguments when building types for display.
- Adds getter and setter rendering to inlay hint labels.
- Adds regression tests and expected output baselines for both crashes.
| File | Description |
|---|---|
tsc/testdata/baselines/reference/fourslash/quickInfo/quickInfoLocalTypeInGenericFunctionCrash.baseline |
Records expected hover output for nested local generic types. |
tsc/testdata/baselines/reference/fourslash/inlayHints/inlayHintsAccessorTypeCrash.baseline |
Records accessor inlay hints with differing getter and setter types. |
tsc/internal/ls/inlay_hints.go |
Renders getter and setter declarations in inlay hint labels. |
tsc/internal/fourslash/tests/quickInfoLocalTypeInGenericFunctionCrash_test.go |
Adds hover regression coverage for local types in generic functions. |
tsc/internal/fourslash/tests/inlayHintsAccessorTypeCrash_test.go |
Adds inlay hint regression coverage for accessor types. |
tsc/internal/checker/nodebuilderimpl.go |
Composes nested references as expressions when intermediate type arguments require it. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two things found while working on the checker ordering, where now LS operations are fuzzed.