From 933481ae75cc07c796cd2dd9e5af7db9ddf193ca Mon Sep 17 00:00:00 2001 From: eugenesvk Date: Wed, 27 Nov 2024 14:18:43 +0700 Subject: [PATCH] ui: respect the silence as defined in user LSP settings do not show a blocking UI window, instead auto-skipping download with a custom console log message LSP will notify via statusbar that the server failed, so no need for an extra status notification here --- st4_py38/lsp_utils/node_runtime.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/st4_py38/lsp_utils/node_runtime.py b/st4_py38/lsp_utils/node_runtime.py index 134d755..7880ebc 100755 --- a/st4_py38/lsp_utils/node_runtime.py +++ b/st4_py38/lsp_utils/node_runtime.py @@ -94,6 +94,11 @@ def _resolve_node_runtime( except Exception as ex: log_lines.append(' * Binaries check failed: {}'.format(ex)) if selected_runtimes[0] != 'local': + lsp_cfg = sublime.load_settings('LSP.sublime-settings') + suppress_error_dialogs = cast(bool, lsp_cfg.get('suppress_error_dialogs') or False) + if suppress_error_dialogs: + log_lines.append(' * Download auto-skipped due to "suppress_error_dialogs" setting') + continue if not sublime.ok_cancel_dialog( NO_NODE_FOUND_MESSAGE.format(package_name=package_name), 'Download Node.js'): log_lines.append(' * Download skipped')