Skip to content

LSP ensure check diagnostics are always published#3709

Merged
emcfarlane merged 3 commits intomainfrom
ed/lspRunChecksWorker
Mar 25, 2025
Merged

LSP ensure check diagnostics are always published#3709
emcfarlane merged 3 commits intomainfrom
ed/lspRunChecksWorker

Conversation

@emcfarlane
Copy link
Contributor

This ensures checks diagnostics are always published to the LSP client. We adopt a worker model that runs checks in the background. On updates, the caller invalidates the previous checks. Checks are then re-evaluated and published. This ensures checks are eventually consistent.

Thanks to #3706 for finding the issue for missing check diagnostics. This fixes that issue and solves the error case where the checks are never run due to try locking.

This ensures checks diagnostics are always published to the LSP
client. We adopt a worker model that runs checks in the background. On
updates, the caller invalidates the previous checks. Checks are then
re-evaluated and published. This ensures checks are eventually
consistent.
@emcfarlane emcfarlane requested review from doriable and mcy March 24, 2025 19:20
@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 24, 2025, 10:20 PM

@emcfarlane emcfarlane changed the title LSP ensure checks diagnostics are always published LSP ensure check diagnostics are always published Mar 24, 2025
Copy link
Member

@doriable doriable left a comment

Choose a reason for hiding this comment

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

Overall, I think the benefits of this change is that it publishes diagnostics from checks more aggressively, but I think it reintroduces some of the concerns around blocking on checks, which we are currently mitigating with a very long checkRefreshPeriod of 3s. I guess I'm somewhat okay with merging this, only because we want to fix this more generally in our upcoming LSP work.

@emcfarlane emcfarlane merged commit d891bd2 into main Mar 25, 2025
10 checks passed
@emcfarlane emcfarlane deleted the ed/lspRunChecksWorker branch March 25, 2025 15:07
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