Conversation
When BufferEdited fires, refresh_inlay_hints filters visible_excerpts to only same-language buffers but calls clear() globally, wiping added_hints and hint_chunk_fetching for all buffers including other languages. Those other-language hints remain displayed but their tracking state is gone, so the next NewLinesShown re-fetches and inserts them alongside the still-displayed copies, producing duplicates. Replace the global clear() with a targeted clear_for_buffers() that only wipes tracking for the buffers actually being re-processed. Other-language buffers keep their tracking intact, preventing re-fetch and duplication.
When a BufferEdited task completes with should_invalidate()=true, apply_fetched_hints removes ALL visible hints for the buffer but only adds back hints for the chunks this task fetched. Chunks fetched by other concurrent tasks (e.g., a scroll task that completed during the edit debounce) have their hints removed but remain marked as "already fetched" in hint_chunk_fetching, permanently preventing re-fetch. Fix: when invalidating, prune hint_chunk_fetching to retain only the chunk ranges that this task has results for, so orphaned chunks become eligible for re-fetch on the next NewLinesShown event.
Two bugs caused inlay hints to permanently disappear until the next edit: Bug 1 — Race between invalidating and appending tasks: When a buffer edit (long debounce) was followed by a scroll (short debounce), the edit task's apply_fetched_hints removed ALL visible hints but only added back its own chunks. The scroll chunk remained in hint_chunk_fetching as "already fetched", preventing re-query. Fixed by pruning hint_chunk_fetching to only retain chunks this task has results for when should_invalidate() is true. Bug 2 — RefreshRequested dropping other servers' hints: When one LSP server sent workspace/inlayHint/refresh, clear() wiped all tracking, then the LspStore only returned the requesting server's hints (other servers' cached hints were excluded). apply_fetched_hints removed all visible hints but only added back the one server's. Fixed by capturing other servers' cached hints before spawning the fetch task and merging them into the result.
tahayvr
pushed a commit
to tahayvr/zed
that referenced
this pull request
Mar 4, 2026
Release Notes: - Fixed multiple language servers applying to the same buffer overwriting each others inlay hints - Fixed multiple language servers applying to the same multibuffer discarding each others inlay hints - Fixed a bug that caused some inlay hints to sometimes duplicate
naaiyy
pushed a commit
to Glass-HQ/Glass
that referenced
this pull request
Mar 11, 2026
Release Notes: - Fixed multiple language servers applying to the same buffer overwriting each others inlay hints - Fixed multiple language servers applying to the same multibuffer discarding each others inlay hints - Fixed a bug that caused some inlay hints to sometimes duplicate
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.
Release Notes: