Conversation
The symbol map a file's hints are read from is rebuilt on a background task, so a request arriving between a keystroke and that rebuild was answered with offsets describing the previous text: labels landed inside the arguments they name, and because the visible range was measured against the newer text while the hints were not, the following call's hints were pulled onto the edited line and drawn twice. `handle_inlay_hints` now declines that request. Returning `Ok(None)` for it is not enough on its own -- a null result is indistinguishable from "no hints here", so a client replaces the labels it is showing with an empty set and the line stays bare until something re-pulls it. Answering `ContentModified` says what actually happened, and a client that understands it keeps what it has and re-pulls on the `inlayHint/refresh` sent once the rebuild commits. No content to work from, or a blocking task that died, still answer `Ok(None)`: neither is a document-version problem, and re-requesting would not change either one.
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.
I recently found your project and was interested in its features in lieu of a few other LSPs, the list of features was impressive, and e.g. you can trust Rust not to go crazy.
In using the LSP I have run into a specific issue, wherein when a buffer is modified the flow control of type-hints gets pretty weird.
This small patch has fixed my issue, and may be beneficial to your project, feel free to review the changes and comments.
I ran the stuff listed in your contribution guidelines and it ends with:
[ERROR] Found 1434 errors... I assume this is expected?Anyways, excited to see your project grow!
--
The symbol map a file's hints are read from is rebuilt on a background task, so a request arriving between a keystroke and that rebuild was answered with offsets describing the previous text: labels landed inside the arguments they name, and because the visible range was measured against the newer text while the hints were not, the following call's hints were pulled onto the edited line and drawn twice.
handle_inlay_hintsnow declines that request. ReturningOk(None)for it is not enough on its own -- a null result is indistinguishable from "no hints here", so a client replaces the labels it is showing with an empty set and the line stays bare until something re-pulls it. AnsweringContentModifiedsays what actually happened, and a client that understands it keeps what it has and re-pulls on theinlayHint/refreshsent once the rebuild commits.No content to work from, or a blocking task that died, still answer
Ok(None): neither is a document-version problem, and re-requesting would not change either one.Checklist
If applicable:
CHANGELOG.mdREADME.md,docs/,examples/)config-schema.json)how it works, how it's organized), including any code drafted by an LLM.
an eye towards deleting anything that is irrelevant, clarifying anything
that is confusing, and adding details that are relevant. This includes,
for example, commit descriptions, PR descriptions, and code comments.