Skip to content

Don't send progress reports for very short spans#3282

Open
jakebailey wants to merge 3 commits intomainfrom
jabaile/no-progress-flashing
Open

Don't send progress reports for very short spans#3282
jakebailey wants to merge 3 commits intomainfrom
jabaile/no-progress-flashing

Conversation

@jakebailey
Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings March 28, 2026 17:55
"context"
"sync"
"testing"
"testing/synctest"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First use of synctest in the repo 😄

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ProgressDelay to the LSP server options and wires it into project-loading progress reporting.
  • Refactors progress reporting behind a progressReporter interface and implements delayed token creation (timer-based).
  • Adds a new internal/lsp/progress_test.go test suite and sets a default 250ms delay in tsgo 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants