Auto restart files with stale dependencies#776
Open
samuela wants to merge 1 commit intoleanprover:masterfrom
Open
Auto restart files with stale dependencies#776samuela wants to merge 1 commit intoleanprover:masterfrom
samuela wants to merge 1 commit intoleanprover:masterfrom
Conversation
SnirBroshi
reviewed
Apr 25, 2026
| this.diagnosticsEmitter.fire(e.accumulatedParams()) | ||
| const params = e.accumulatedParams() | ||
| this.diagnosticsEmitter.fire(params) | ||
| void this.maybeAutoRestartFileWithStaleDependencies(params) |
There was a problem hiding this comment.
Is this void necessary? Is there a lint for unused return value?
SnirBroshi
reviewed
Apr 25, 2026
| return | ||
| } | ||
|
|
||
| if (!automaticallyRestartFileOnDependencyChange() || this.autoRestartedStaleDependencyUris.has(uri)) { |
There was a problem hiding this comment.
I think the setting check should be at the top of this function, otherwise we're doing work for nothing
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.
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.