https://bugs.kde.org/show_bug.cgi?id=525918
Bug ID: 525918
Summary: Clicking an external (http or https) link in the LSP
hover tooltip or the pinned Symbol Info tooltip does
nothing.
Classification: Applications
Product: kate
Version First 26.08.1
Reported In:
Platform: CachyOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: application
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 196336
--> https://bugs.kde.org/attachment.cgi?id=196336&action=edit
Reproduces the issue in stand alone code
DESCRIPTION
Clicking an external (http or https) link in the LSP hover tooltip or the
pinned Symbol Info tooltip does nothing.
The flag added by the fix for bug 413751 ("Open links in LSP tooltips"),
`setOpenExternalLinks(true)`, can never open a link while `openLinks(false)` is
set.
STEPS TO REPRODUCE
1. Open any document and trigger an LSP hover that carries a markdown link.
Any LSP server whose hover returns `kind:"markdown"` with
`[label](https://...)`
works.
2. Move the mouse onto the link and click it.
OBSERVED RESULT
Nothing happens. The same configuration reproduces in a standalone Qt 6
program (attached). The click emits `QTextBrowser::anchorClicked` and returns.
`QDesktopServices::openUrl` is never called.
EXPECTED RESULT
`https://` and `http://` links open in the default browser
SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window):
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
ADDITIONAL INFORMATION
LLM produced patch:
```
>From a3f5c2d8e7b6a5c4d3e2f1b0a9c8d7e6f5a4b3c2 Mon Sep 17 00:00:00 2026
From: Ebben Feagan <[email protected]>
Date: Wed, 17 Sep 2026 00:00:00 +0000
Subject: [PATCH] texthint: open external http and https links in link hints
TooltipPrivate sets openLinks(false), so 'action:' links arrive at Kate's
anchorClicked handler and never enter the browser's navigation code. The same
flag makes QTextBrowserPrivate::activateAnchor() emit anchorClicked() and
return early for every link, before openExternalLinks is consulted. As a
result, clicking an external https or http link in a hover or Calltips
tooltip does nothing: no browser starts, no URL reaches the desktop.
Handle https and http links in the existing anchorClicked handler by opening
them with QDesktopServices::openUrl().
---
--- a/apps/lib/texthint/tooltip.cpp 2026-09-16 21:58:52.872026687 -0500
+++ b/apps/lib/texthint/tooltip.cpp 2026-09-16 22:13:30.880287793 -0500
@@ -6,6 +6,7 @@
#include "hintstate.h"
#include <QApplication>
+#include <QDesktopServices>
#include <QEvent>
#include <QFontMetrics>
#include <QMenu>
@@ -396,6 +397,13 @@
hideTooltip();
actions[idx].m_callback();
}
+ } else if (url.scheme() == QStringLiteral("https") ||
url.scheme() == QStringLiteral("http")) {
+ // openLinks(false) above makes
QTextBrowserPrivate::activateAnchor() emit
+ // anchorClicked() and return before openExternalLinks is
consulted, so
+ // external links never open. Handle them here.
+ hideTooltip();
+ QDesktopServices::openUrl(url);
}
});
```
--
You are receiving this mail because:
You are watching all bug changes.