-
Notifications
You must be signed in to change notification settings - Fork 184
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
Allow suppressing UI blocking dialogs #2546
Open
eugenesvk
wants to merge
27
commits into
sublimelsp:main
Choose a base branch
from
eugenesvk:fr-no-modal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
76420cc
add 'show_ui_blocking_message' config
eugenesvk 2a92fc6
allow replacing blocking dialog modals with a status+console message
eugenesvk 81e3567
add 'show_ui_blocking_err_message' config
eugenesvk f552660
allow replacing blocking error dialog modals with a status+console me…
eugenesvk 1bbcef4
add "see console"
eugenesvk c0c9ded
use window instead of sublime for message dialogs
eugenesvk 3747b46
use window instead of sublime for error dialogs
eugenesvk 74c0af3
remove ⚠️ for messages (leave ❗ for errors)
eugenesvk d78e139
combine two blocking options into one suppress_error_dialogs
eugenesvk 96884ff
suppress dialogs by default
eugenesvk a2743ce
swap logging logick to reflect the settings change
eugenesvk 39f6429
move setting to other
eugenesvk 9d40852
use longer names
eugenesvk 987ce91
add missing window arg
eugenesvk 5b99040
accept optional sublime Window in notify functions
eugenesvk 33ab71f
fix style
eugenesvk 27aa180
remove comments
eugenesvk d61affa
update type/var name
eugenesvk 726a781
return if no window
eugenesvk 8595bf2
shorten status message to remove LSP
eugenesvk 5ab0e73
moved notification logging functions to a separate file to avoid circ…
eugenesvk 546a8df
consolidate error notification into 1 function
eugenesvk 6bdb715
fix flake8 style
eugenesvk 76a222e
add LSP prefix to console log messages
eugenesvk 52d5ee7
make status message optional
eugenesvk 89c4bd9
remove severity level from log messages
eugenesvk ac0c301
update default config
eugenesvk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
import sublime | ||
from .settings import userprefs | ||
|
||
|
||
def notify_error(window: sublime.Window | None, message: str, status_message: str | None = None) -> None: | ||
"""Pick either of the 2 ways to show a user error notification message: | ||
- via a detailed console message and a short status message | ||
- via a blocking error modal dialog""" | ||
if not window: | ||
return | ||
if status_message is None: | ||
status_message = message | ||
if userprefs().suppress_error_dialogs: | ||
window.status_message(status_message) | ||
print("LSP: " + message) | ||
else: | ||
sublime.error_message(message) |
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is
true
in the settings file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So let's revert it back to true then here and in the settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah my intention was to fix this line, and not to change the value in the settings. But then I would think that probably nobody will change this setting anyway, so I would just leave it out. We can't add a new setting for each tiny aspect of this package's behavior. I don't expect that people will care very much when the error dialogs went away and I don't think they will complain about that. I recently also removed another of these dialogs in #2528 (which is not covered in this PR) and I think it is the right thing to do. Though if the other contributors think differently, I'd be okay if my opinion gets overruled. And I would let @rchl decide whether the error messages in
tooling.py
should keep their dialog windows or not, because iirc he implemented that (and as I already wrote, this troubleshooting command is not a common action during editing anyway).