Skip to content

Add reload command to pick up externally modified analysis files - #3044

Open
jozanek wants to merge 1 commit into
scalacenter:mainfrom
jozanek:feature/1091-reload-analysis
Open

Add reload command to pick up externally modified analysis files#3044
jozanek wants to merge 1 commit into
scalacenter:mainfrom
jozanek:feature/1091-reload-analysis

Conversation

@jozanek

@jozanek jozanek commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Bloop reads each project's persisted compilation state once and keeps it in memory, so state replaced on disk — restoring a cache saved from an earlier run, say — is invisible until a restart.

Adds a way to re-read it:

  • CLI: bloop reload, all projects or --project
  • BSP: bloop/reloadAnalysis, given targets or all

A reload replaces every requested project or nothing. It fails, untouched, while a project compiles or is cleaned, if state changes mid-read, or if what's on disk can't be used; BSP errors carry a stable reason and retryable flag. Persisted state is only adopted when the output directory it names is one Bloop manages for that project — compilation later deletes that directory, so an unvalidated path would eventually be removed recursively.

workspace/reload is implemented as configuration-only (Bloop already reloads config per request) and never imports state, so it can't fail for unrelated reasons.

Closes #1091. The remaining half of that discussion — sharing state across machines or checkouts — is blocked by absolute paths in the persisted state and is tracked in #1351.

Known issue: after a reload, an earlier-started request can leave a stale latest result, affecting BSP diagnostic carry-over only — the successful result compilation builds on is authoritative.

Tests: ReloadAnalysisSpec (12) and BspReloadSpec (3 per transport).

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.

Reload analysis files when they change

1 participant