-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved notification logging functions to a separate file to avoid circ…
…ular imports
- Loading branch information
Showing
8 changed files
with
38 additions
and
36 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
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,30 @@ | ||
from __future__ import annotations | ||
import sublime | ||
from .settings import userprefs | ||
|
||
|
||
def notify(window: sublime.Window | None, message: str, status_message: str = 'LSP: see console log…') -> None: | ||
"""Pick either of the 2 ways to show a user notification message: | ||
- via a detailed console message and a short status message | ||
- via a blocking modal dialog""" | ||
if not window: | ||
return | ||
if userprefs().suppress_error_dialogs: | ||
window.status_message(status_message) | ||
print(message) | ||
else: | ||
sublime.message_dialog(message) | ||
|
||
|
||
def notify_error(window: sublime.Window | None, message: str, status_message: str = '❗LSP: see console log…') -> 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""" | ||
from .settings import userprefs | ||
if not window: | ||
return | ||
if userprefs().suppress_error_dialogs: | ||
window.status_message(status_message) | ||
print(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