input: drop stale completion responses and allow refreshing the popup - #111
Open
feigeCode wants to merge 2 commits into
Open
input: drop stale completion responses and allow refreshing the popup#111feigeCode wants to merge 2 commits into
feigeCode wants to merge 2 commits into
Conversation
Editors can now show feature-owned markers in a reserved gutter lane, geometric Fill/Frame decorations over UTF-8 ranges, and non-document inline widgets at an offset. All three follow text edits and are exposed through InputBaseState setters plus an Editor builder for the marker renderer; markers report clicks through InputEvent::GutterMarkerMouseDown. Co-Authored-By: Claude <noreply@anthropic.com>
Editor documents now carry a monotonic revision and completion epoch, bumped on every content mutation through the model hook. Completion responses check both plus cursor, trigger offset and query when they land so a stale response can no longer overwrite a newer request. A public refresh_completion_popup re-requests popup completion without editing, for asynchronous metadata sources that become ready late. Co-Authored-By: Claude <noreply@anthropic.com>
feigeCode
force-pushed
the
input-gutter-markers-decorations
branch
from
September 11, 2026 23:11
0fae175 to
b74d954
Compare
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.
Problem
Two separate issues with async completion:
says it still matches the buffer it was requested for. Type fast — or let an LSP respond
slowly — and an older response can overwrite the popup produced by a newer request.
the document settles. There's no call to ask for the popup to be recomputed without
faking an edit.
What this adds
a new
InputModeKind::document_did_changehook that fires on any real content mutation(via the model hook, so masking and programmatic edits are covered too). The revision only
advances when the text actually differs — no-op edits don't invalidate anything.
before it is applied. If any of them moved, the response is dropped rather than applied.
refresh_completion_popup()— re-requests popup completion without touching the document,for sources that become ready late.
document_did_changeis a no-op default on the trait, so existing modes are unaffected.Depends on
Builds on the range-decoration / gutter work in longbridge#3040 — it shares the document-mutation
plumbing. I kept them as two PRs because they solve different problems; happy to squash them
if you'd rather review one diff.
Validation
Same set as that PR, on top of it:
cargo check --workspace --all-targetsclean.cargo clippy --workspace --all-targets -- --deny warningsclean.cargo fmt --all -- --checkclean.cargo test --workspace --exclude gpui-shell --features gpui-component-story/test-supportpasses.
Release Notes: