Fix wrong inlay hint positions in large documents - #993
Merged
DaelonSuzuka merged 1 commit intoMar 10, 2026
Conversation
Collaborator
|
I've definitely seen the inlay hints positioned correctly in large documents scrolled 2+ pages down. I wonder why it's been intermittent for me... Regardless, very simple fix, thank you for investigating! |
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.
Closes #980.
Fixes missing or misplaced inlay hints in GDScript and scene files, when scrolled down in a somewhat large document,
The extension respected the
rangeparameter ofprovideInlayHintsby extracting only that range substring for processing, but it didn't take the range into account when calculating positions for the LSP request or hint placement. So the position was incorrect any time the range start was non-zero.The range is relative to vertical scroll position but with some padding. From my quick scan of the relevant function in the VS Code source the document size needed to reproduce should be something like two viewport heights tall plus 30 lines, so the bug is probably dependent on window and font size too :)
The linked issue has a repro GDScript (at least for me when fitting ~60 lines in the viewport). The bug also exists in scene files -- if you have a decent number of nodes with resources in the tree you'll find that the resource path hints are missing when scrolled down. I've attached a MRP with both a script and scene for testing convenience: inlay-hints-test_2026-03-09_20-31-25.zip