Bump Salsa revision manually for non-Salsa updates#1315
Open
lionel- wants to merge 1 commit into
Open
Conversation
DavisVaughan
approved these changes
Jul 6, 2026
| /// completes and the newer batch is enqueued, any older pass has either unwound | ||
| /// with `Cancelled` or already produced its result. Changes to state that lives | ||
| /// outside oak (console inputs, diagnostics config) get the same barrier by | ||
| /// advancing the revision synthetically (see `WorldState::bump_revision`). |
Contributor
There was a problem hiding this comment.
Suggested change
| /// advancing the revision synthetically (see `WorldState::bump_revision`). | |
| /// advancing the revision synthetically (see [`WorldState::bump_revision`]). |
if you want to linkify the doc comments
Comment on lines
+509
to
+513
| // Refresh diagnostics if the configuration changed. The config lives | ||
| // outside Oak so we bump the revision manually. | ||
| if state.config.diagnostics != diagnostics_config { | ||
| tracing::info!("Refreshing diagnostics after configuration changed"); | ||
| lsp::main_loop::diagnostics_refresh_all(state); | ||
| state.bump_revision(); |
Contributor
There was a problem hiding this comment.
Suggested change
| // Refresh diagnostics if the configuration changed. The config lives | |
| // outside Oak so we bump the revision manually. | |
| if state.config.diagnostics != diagnostics_config { | |
| tracing::info!("Refreshing diagnostics after configuration changed"); | |
| lsp::main_loop::diagnostics_refresh_all(state); | |
| state.bump_revision(); | |
| // Refresh diagnostics if the configuration changed. The config lives | |
| // outside Oak so we bump the revision manually, causing diagnostics | |
| // to refresh on the next tick. | |
| if state.config.diagnostics != diagnostics_config { | |
| tracing::info!("Bumping salsa revision after configuration changed"); | |
| state.bump_revision(); |
idk, feels more precise to me this way?
Comment on lines
+530
to
+532
| // to refresh from here. The scopes live outside oak so we bump the revision | ||
| // manually. | ||
| state.bump_revision(); |
Contributor
There was a problem hiding this comment.
Suggested change
| // to refresh from here. The scopes live outside oak so we bump the revision | |
| // manually. | |
| state.bump_revision(); | |
| // to refresh from here. The scopes live outside oak so we bump the revision | |
| // manually, causing diagnostics to get refreshed on the next tick. | |
| state.bump_revision(); |
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.
Branched from #1314
Part of #1212
Removes a FIXME that I left for non-Salsa inputs, like console inputs and diagnostics config. These updates manually triggered diagnostics out-of-band, which had the issue that ongoing diagnostics did not get cancelled by a Salsa bump. The concurrent diagnostics could publish out of order, resulting in stale results.
It's actually easy to bump the revision manually, which both cancels in flight diagnostics and ensures ordering. That's because the synthetic write: