Repository navigation
Prevent LSP position-conversion panic after content mapper failure - #65554
Draft
Daniel Rosenwasser (DanielRosenwasser) wants to merge 4 commits into
Draft
Daniel Rosenwasser (DanielRosenwasser) wants to merge 4 commits into
Daniel Rosenwasser (DanielRosenwasser) wants to merge 4 commits into
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
| assert.Equal(t, positions[1].Position, core.TextPos(2)) | ||
| } | ||
|
|
||
| func TestConvertersFailedContentMapperPosition(t *testing.T) { |
Member
Author
There was a problem hiding this comment.
This need a better explanation. What is failing? Why is it failing? What does this test prove?
Member
Author
|
Copilot fix |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
Added an explanation above the regression test: failed mapping leaves empty virtual text with the original non-ASCII line map, so the second line's byte-3 start previously caused an out-of-bounds scan. The test verifies hover and inlay-hint conversions clamp to offset 0. Addressed in |
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.
When a content mapper fails, its empty virtual file retains the original document’s line map. In a non-ASCII document, hover and inlay-hint requests can then scan beyond the virtual text and panic.