From 55e3169c4bd732f9d8305a75ec76158beb0b7d31 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 7 Dec 2020 14:33:46 +0100 Subject: [PATCH 1/4] Use the system font for header elements in popups --- popups.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/popups.css b/popups.css index f7df04f5d..cde76316c 100644 --- a/popups.css +++ b/popups.css @@ -13,6 +13,12 @@ .lsp_popup li { font-family: system; } +.lsp_popup h1, +.lsp_popup h2, +.lsp_popup h3, +.lsp_popup h4 { + font-family: system; +} .lsp_popup .diagnostics { margin-bottom: 0.5rem; } From f83fdb34f08fa26c380e049e3fd1e742c199de6d Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 7 Dec 2020 20:31:48 +0100 Subject: [PATCH 2/4] Compactify --- popups.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/popups.css b/popups.css index cde76316c..5c9d901dd 100644 --- a/popups.css +++ b/popups.css @@ -10,9 +10,7 @@ padding: 0 0.5rem; font-family: system; } -.lsp_popup li { - font-family: system; -} +.lsp_popup li, .lsp_popup h1, .lsp_popup h2, .lsp_popup h3, From 7c977ebcf4519857a5ffa2922602025a9d99c491 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 7 Dec 2020 20:56:07 +0100 Subject: [PATCH 3/4] Compactify more --- popups.css | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/popups.css b/popups.css index 5c9d901dd..116f027a2 100644 --- a/popups.css +++ b/popups.css @@ -1,5 +1,6 @@ .lsp_popup { margin: 0.5rem 0.5rem 0 0.5rem; + font-family: system; } .lsp_popup .highlight { border-width: 0; @@ -8,14 +9,6 @@ .lsp_popup p { margin-bottom: 0.5rem; padding: 0 0.5rem; - font-family: system; -} -.lsp_popup li, -.lsp_popup h1, -.lsp_popup h2, -.lsp_popup h3, -.lsp_popup h4 { - font-family: system; } .lsp_popup .diagnostics { margin-bottom: 0.5rem; From 6cb007f2c02d8f7b441b3fc7d59c615cc2ede482 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 7 Dec 2020 21:35:03 +0100 Subject: [PATCH 4/4] Remove extraneous
, and use
for actions instead of

--- plugin/hover.py | 10 ++-------- popups.css | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/plugin/hover.py b/plugin/hover.py index bb8754868..3abb95f92 100644 --- a/plugin/hover.py +++ b/plugin/hover.py @@ -109,7 +109,7 @@ def symbol_actions_content(self, point: int) -> str: if userprefs().show_symbol_action_links: actions = [lk.link(point, self.view) for lk in link_kinds if self.provider_exists(lk)] if actions: - return '

' + " | ".join(actions) + "

" + return '
' + " | ".join(actions) + "
" return "" def diagnostics_content(self) -> str: @@ -120,21 +120,15 @@ def diagnostics_content(self) -> str: for diagnostic in self._diagnostics_by_config[config_name]: by_severity.setdefault(diagnostic.severity, []).append( format_diagnostic_for_html(diagnostic, self._base_dir)) - - for severity, items in by_severity.items(): - formatted.append("
") + for items in by_severity.values(): formatted.extend(items) - formatted.append("
") - if config_name in self._actions_by_config: action_count = len(self._actions_by_config[config_name]) if action_count > 0: href = "{}:{}".format('code-actions', config_name) text = "choose code action ({} available)".format(action_count) formatted.append('
{}
'.format(make_link(href, text))) - formatted.append("
") - return "".join(formatted) def hover_content(self) -> str: diff --git a/popups.css b/popups.css index 116f027a2..6377440bc 100644 --- a/popups.css +++ b/popups.css @@ -1,49 +1,47 @@ .lsp_popup { - margin: 0.5rem 0.5rem 0 0.5rem; + margin: 0.5rem; font-family: system; } -.lsp_popup .highlight { +.highlight { border-width: 0; border-radius: 0; } -.lsp_popup p { +.diagnostics { margin-bottom: 0.5rem; - padding: 0 0.5rem; + font-family: monospace; } -.lsp_popup .diagnostics { - margin-bottom: 0.5rem; -} -.lsp_popup .errors { +.errors { border-width: 0; background-color: color(var(--redish) alpha(0.25)); color: var(--foreground); padding: 0.5rem; } -.lsp_popup .warnings { +.warnings { border-width: 0; background-color: color(var(--yellowish) alpha(0.25)); color: var(--foreground); padding: 0.5rem; } -.lsp_popup .info { +.info { border-width: 0; background-color: color(var(--bluish) alpha(0.25)); color: var(--foreground); padding: 0.5rem; } -.lsp_popup .hints { +.hints { border-width: 0; background-color: color(var(--bluish) alpha(0.25)); color: var(--foreground); padding: 0.5rem; } -.lsp_popup .actions { +.actions { + font-family: system; border-width: 0; background-color: color(var(--foreground) alpha(0.1)); color: var(--foreground); padding: 0.5rem; } -.lsp_popup .actions a.icon { +.actions a.icon { text-decoration: none; } pre.related_info {