Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sticky notifications for extension startup errors #547

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

mhuisi
Copy link
Collaborator

@mhuisi mhuisi commented Nov 15, 2024

This PR changes the notifications for extension startup errors to a new "sticky" notification mechanism.

Before this PR, when one of the precondition checks of the extension failed (e.g. because Lean was not installed), we would issue a small non-modal notification in the bottom right and then rely on users to figure out that after fixing their setup, they need to open a new Lean document to restart the check. If users closed this notification, there would also be no further indication for why the extension is not activating.
This is quite unintuitive, so we now instead issue a modal notification when the error first occurs and then a sticky notification that re-appears whenever a new Lean text editor is made visible. Clicking the retry button on this notification will re-try the check. This way, it's much harder to miss the error and how to restart the check.

Since these new sticky notifications invert the control flow, this PR required a broad refactoring of the notification architecture.

This PR also fixes a bug where starting VS Code on an untitled Lean 4 file would not start the language server and introduces a new Lean 4 specific abstraction layer for VS Code API event handlers. This abstraction layer is currently only in use in the code that had to be refactored for this PR, but it will be introduced more broadly in further PRs.

@mhuisi mhuisi marked this pull request as ready for review November 18, 2024 13:16
@mhuisi mhuisi merged commit 24f2edd into master Nov 18, 2024
2 checks passed
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.

1 participant