Skip to content

fix(nextflow): don't mark workspace scan flushed when both probes fail - #1872

Open
AmirF194 wants to merge 1 commit into
oraios:mainfrom
AmirF194:fix/1871-nextflow-scan-flush-flag
Open

fix(nextflow): don't mark workspace scan flushed when both probes fail#1872
AmirF194 wants to merge 1 commit into
oraios:mainfrom
AmirF194:fix/1871-nextflow-scan-flush-flag

Conversation

@AmirF194

Copy link
Copy Markdown
Contributor

_flush_deferred_workspace_scan sends two completion requests to force the server's debounced workspace scan, then sets self._workspace_scan_flushed = True unconditionally after the loop, even when both requests raised. _send_references_request uses that flag to skip flushing on later calls, so if the scan was never actually forced, every later find_referencing_symbols for the rest of the session silently answers from a possibly-incomplete workspace AST cache, with no retry.

Fix: only set the flag when at least one completion call did not raise; a total failure leaves it clear so the next call retries.

Verification:

  • test/solidlsp/test_nextflow_workspace_scan_flush.py (new): drives _flush_deferred_workspace_scan against a fake server.send with no real language server process. Fails on main (flag flips True after two failures) and passes on this branch; a second regression test pins the existing success path.
  • ruff check/ruff format --check and codespell clean on the changed files.
  • Not verified against a real Nextflow JAR: the repro isolates the flag-setting logic itself, which doesn't depend on why the two completion calls would fail on a live server.

Fixes #1871

_flush_deferred_workspace_scan sets _workspace_scan_flushed unconditionally after its
two completion() flush attempts, even when both raised. A later find_referencing_symbols
call then silently skips the flush and answers from a possibly-incomplete workspace AST
cache for the rest of the session, with no exception and no retry.

Fixes oraios#1871
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.

Nextflow LS: _flush_deferred_workspace_scan marks the scan flushed even when both flush attempts fail

1 participant