From c37b8c5765ab753cde80f80fec5721a4f3601d64 Mon Sep 17 00:00:00 2001 From: HJX-001 <116998733+HJX-001@users.noreply.github.com> Date: Sat, 1 Jun 2024 00:23:18 +0530 Subject: [PATCH] fix: fix lsp next/prev diagnostics command was not working after addition of setting 'show diagnostics in hover' --- plugin/hover.py | 4 +++- sublime-package.json | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin/hover.py b/plugin/hover.py index c9584d4a0..e62096c54 100644 --- a/plugin/hover.py +++ b/plugin/hover.py @@ -279,7 +279,9 @@ def show_hover(self, listener: AbstractViewListener, point: int, only_diagnostic def _show_hover(self, listener: AbstractViewListener, point: int, only_diagnostics: bool) -> None: hover_content = self.hover_content() prefs = userprefs() - diagnostics_content = "" if not prefs.show_diagnostics_in_hover else self.diagnostics_content() + diagnostics_content = "" + if only_diagnostics or prefs.show_diagnostics_in_hover: + diagnostics_content = self.diagnostics_content() contents = diagnostics_content + hover_content + code_actions_content(self._actions_by_config) link_content, link_range = self.link_content_and_range() only_link_content = not bool(contents) and link_range is not None diff --git a/sublime-package.json b/sublime-package.json index 81c687770..023541fe8 100644 --- a/sublime-package.json +++ b/sublime-package.json @@ -621,6 +621,11 @@ "default": "annotation", "markdownDescription": "Where to show `\"code lens\"`." }, + "show_diagnostics_in_hover": { + "type": "boolean", + "default": true, + "markdownDescription": "Show diagnostics in hover popup if available." + }, "show_code_actions_in_hover": { "type": "boolean", "default": true,