Repository navigation
fix(client): direct CLI queries warn when the server was still indexing (#1520) - #1626
Merged
Merged
Conversation
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
The direct-query loop in
commands/query/lsp_client.rsaccepts only a method-less payload withid == 2and drops everything else (#1520). Aprod-code/indexingnote, which the gateway sends just before an answer given while the server was still loading or indexing, was discarded. A directprod-code impls FILE LINE COLthen printed a possibly partial list, or "No implementations found", with no hint why.Change
New
busy_note(payload)recognises theprod-code/indexingnotification and parses itsBusyparams. The loop prints it to stderr as "warning: the language server was still indexing (…); the answer below may be incomplete". It does not wait for a complete index, and response matching is unchanged.Reproduce and verify
New
commands::query::lsp_client::tests::an_indexing_note_becomes_a_warning: a note becomes the warning, while an answer and an unrelated notification do not.Break-check, with the method test inverted so no note is recognised:
No live query against a still-indexing server was run.
Measurements
None.
Checks
On a Linux build node, default stable toolchain, one gate on the tree holding #1517, #1519, #1520, #1521 and #1522 (merged one after another):
cargo test -p prod-code-client --no-fail-fast: first run exit 101, two targets failed, both asserting behaviour these changes replace on purpose:--test cli:lsp_tells_the_editor_when_a_save_did_not_reach_the_nodeexpected the save to reach the server despite the failed sync (Editor bridge forwards didSave after its filesystem sync failed #1517);--test client_ops_2_benchmark:persistent_workers_account_for_churn_and_failed_queriesexpected 4 verifications in the all-failing case; it now also gets 4 per-copy failures (Divergent benchmark can omit requested worktrees and truncate origin seed names #1522).Both were updated, and those two targets were rerun: 115/115 and 2/2.
cargo clippy -p prod-code-client --all-targets: exit 0. The warnings in touchedlsp_bridgefiles are pre-existing (collapsible_ifon the unchanged$/cancelRequestbranch, and inreconnect.rs,state.rs,transport.rs).cargo fmt --all -- --check: exit 0, after the test edits too.Closes #1520