-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid awaiting VS Code popup notifications (#557)
## Summary This PR fixes a bug to avoid awaiting the VS Code popup notifications. ### How to reproduce this? For posterity, this is how to reproduce this bug: 1. Keep the extension setting to only contain: ```json { "ruff.nativeServer": true } ``` 2. Add the following additional setting which is incompatible with the native server: ```json { "ruff.nativeServer": true, "ruff.format.args": ["--line-length=10"] } ``` 3. Saving the new settings will trigger a restart and a notification will popup which warns you about this incompatible setting (**Do NOT dismiss the notification window**) 4. Remove the `ruff.format.args` and save the settings which should then trigger a restart again But, the restart triggered by (3) never completed because the notification was awaited and the user never dismissed it. This is where the extension hangs. ### Solution I've updated all `vscode.window.show(Error|Warning)Message` calls to not be awaited and instead use the callback mechanism if there's a need to respond to user's selection. ## Test Plan Follow the same steps as above and make sure that the restart happens. https://github.com/user-attachments/assets/28781673-9472-4ad7-9da8-d15302877307
- Loading branch information
1 parent
51f5a57
commit 4060b01
Showing
2 changed files
with
20 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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