Don't send progress reports for very short spans#3282
Open
jakebailey wants to merge 3 commits intomainfrom
Open
Don't send progress reports for very short spans#3282jakebailey wants to merge 3 commits intomainfrom
jakebailey wants to merge 3 commits intomainfrom
Conversation
jakebailey
commented
Mar 28, 2026
| "context" | ||
| "sync" | ||
| "testing" | ||
| "testing/synctest" |
Member
Author
There was a problem hiding this comment.
First use of synctest in the repo 😄
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces LSP progress-notification chatter by delaying creation of work-done progress tokens, so short operations complete without ever showing progress UI.
Changes:
- Adds a configurable
ProgressDelayto the LSP server options and wires it into project-loading progress reporting. - Refactors progress reporting behind a
progressReporterinterface and implements delayed token creation (timer-based). - Adds a new
internal/lsp/progress_test.gotest suite and sets a default250msdelay intsgo lsp.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/lsp/server.go | Plumbs a new ProgressDelay option into server initialization and progress setup. |
| internal/lsp/progress.go | Implements delayed progress token creation and introduces a reporter abstraction for testability. |
| internal/lsp/progress_test.go | Adds tests for delayed progress behavior and shutdown interactions. |
| cmd/tsgo/lsp.go | Sets ProgressDelay to 250ms for the CLI LSP server. |
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.
The progress reporting code I added in #3235 sends progress tokens for any span length. The client does fine with this, but it's very spammy over the wire while typing.
We can be more clever on the server by delaying the creation of progress tokens by a fixed interval (250ms in this PR), thus avoiding a spinner and its messages for very small cases.