Skip to content

Auto restart files with stale dependencies#776

Open
samuela wants to merge 1 commit intoleanprover:masterfrom
samuela:auto-restart-stale-dependencies
Open

Auto restart files with stale dependencies#776
samuela wants to merge 1 commit intoleanprover:masterfrom
samuela:auto-restart-stale-dependencies

Conversation

@samuela
Copy link
Copy Markdown

@samuela samuela commented Apr 25, 2026

When working in multi-file projects, I frequently find myself facing "Imports are out of date. Need to restart the file." errors. These are common enough to be quite annoying, esp. considering vscode-lean4 knows the solution and yet does not handle it automatically.

This PR adds a new setting that automatically detects import-out-of-date errors and automatically restarts the file. The flag defaults off in the interest of maintaining backwards compatibility.

@samuela samuela marked this pull request as ready for review April 25, 2026 15:50
this.diagnosticsEmitter.fire(e.accumulatedParams())
const params = e.accumulatedParams()
this.diagnosticsEmitter.fire(params)
void this.maybeAutoRestartFileWithStaleDependencies(params)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this void necessary? Is there a lint for unused return value?

return
}

if (!automaticallyRestartFileOnDependencyChange() || this.autoRestartedStaleDependencyUris.has(uri)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think the setting check should be at the top of this function, otherwise we're doing work for nothing

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