-
Notifications
You must be signed in to change notification settings - Fork 193
Allow suppressing UI blocking dialogs #2546
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
base: main
Are you sure you want to change the base?
Changes from 23 commits
76420cc
2a92fc6
81e3567
f552660
1bbcef4
c0c9ded
3747b46
74c0af3
d78e139
96884ff
a2743ce
39f6429
9d40852
987ce91
5b99040
33ab71f
27aa180
d61affa
726a781
8595bf2
5ab0e73
546a8df
6bdb715
76a222e
52d5ee7
89c4bd9
ac0c301
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from __future__ import annotations | ||
| import sublime | ||
| from .settings import userprefs | ||
|
|
||
|
|
||
| def notify_error(window: sublime.Window | None, message: str, status_message: str = 'LSP: see console log…', | ||
| severe: bool = True) -> 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 (with severe=false non-error modal dialog)""" | ||
| if not window: | ||
| return | ||
| if userprefs().suppress_error_dialogs: | ||
| window.status_message(status_message) | ||
| print(message) | ||
| else: | ||
| if severe: | ||
| sublime.error_message(message) | ||
| else: | ||
| sublime.message_dialog(message) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -449,6 +449,11 @@ | |
| "default": false, | ||
| "markdownDescription": "Show errors and warnings count in the status bar." | ||
| }, | ||
| "suppress_error_dialogs": { | ||
| "type": "boolean", | ||
| "default": false, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| "markdownDescription": "Show UI blocking error modals or the full console message and short status notification." | ||
| }, | ||
| "lsp_format_on_paste": { | ||
| "$ref": "sublime://settings/LSP#/definitions/lsp_format_on_paste" | ||
| }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.