File: upstream_2650a5e6_Automatically-highlight-symbol-under-cursor.patch

package info (click to toggle)
kate 4%3A25.04.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 53,220 kB
  • sloc: cpp: 103,394; xml: 88,828; javascript: 1,835; ansic: 1,762; python: 141; lisp: 82; sh: 79; perl: 39; php: 28; makefile: 23; f90: 19; ruby: 15; tcl: 10
file content (584 lines) | stat: -rw-r--r-- 21,879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
From 2650a5e6b02f9524e9c17c77fe7d7832f5acbb21 Mon Sep 17 00:00:00 2001
From: Yuri Timenkov <s.kde@timenkov.pro>
Date: Sat, 5 Jul 2025 08:21:13 +0000
Subject: [PATCH] Automatically highlight symbol under cursor

Instead of explicit command to get all highlights of the symbol under
the cursor this send these requests to LSP automatically in background.

Added Next/Previous actions simplify researching the code by allowing
quickly jump around symbol usages.

BUG: 503414
---
 addons/lspclient/CMakeLists.txt               |   1 +
 addons/lspclient/lspclientconfigpage.cpp      |   3 +
 addons/lspclient/lspclientplugin.cpp          |   3 +
 addons/lspclient/lspclientplugin.h            |   1 +
 addons/lspclient/lspclientpluginview.cpp      |  10 +-
 .../lspclient/lspclientsymbolhighlighter.cpp  | 157 ++++++++++++++++++
 addons/lspclient/lspclientsymbolhighlighter.h |  60 +++++++
 addons/lspclient/lspconfigwidget.ui           |  53 +++---
 8 files changed, 264 insertions(+), 24 deletions(-)
 create mode 100644 addons/lspclient/lspclientsymbolhighlighter.cpp
 create mode 100644 addons/lspclient/lspclientsymbolhighlighter.h

diff --git a/addons/lspclient/CMakeLists.txt b/addons/lspclient/CMakeLists.txt
index fcb26731fd..98ad02db99 100644
--- a/addons/lspclient/CMakeLists.txt
+++ b/addons/lspclient/CMakeLists.txt
@@ -27,6 +27,7 @@ target_sources(
     lspclientpluginview.cpp
     lspclientserver.cpp
     lspclientservermanager.cpp
+    lspclientsymbolhighlighter.cpp
     lspclientsymbolview.cpp
     lspclientutils.cpp
     lspsemantichighlighting.cpp
diff --git a/addons/lspclient/lspclientconfigpage.cpp b/addons/lspclient/lspclientconfigpage.cpp
index 83fa669dd3..6f90c5ebae 100644
--- a/addons/lspclient/lspclientconfigpage.cpp
+++ b/addons/lspclient/lspclientconfigpage.cpp
@@ -68,6 +68,7 @@ LSPClientConfigPage::LSPClientConfigPage(QWidget *parent, LSPClientPlugin *plugi
              ui->chkFmtOnSave,
              ui->chkInlayHint,
              ui->chkShowCompl,
+             ui->chkHighlightSymbol,
          }) {
         connect(cb, &QCheckBox::toggled, this, &LSPClientConfigPage::changed);
     }
@@ -133,6 +134,7 @@ void LSPClientConfigPage::apply()
     m_plugin->m_autoImport = ui->chkAutoImport->isChecked();
     m_plugin->m_fmtOnSave = ui->chkFmtOnSave->isChecked();
     m_plugin->m_inlayHints = ui->chkInlayHint->isChecked();
+    m_plugin->m_highLightSymbol = ui->chkHighlightSymbol->isChecked();
 
     m_plugin->m_diagnostics = ui->chkDiagnostics->isChecked();
     m_plugin->m_messages = ui->chkMessages->isChecked();
@@ -178,6 +180,7 @@ void LSPClientConfigPage::resetUiTo(const LSPClientPluginOptions &options)
     ui->chkAutoImport->setChecked(options.m_autoImport);
     ui->chkFmtOnSave->setChecked(options.m_fmtOnSave);
     ui->chkInlayHint->setChecked(options.m_inlayHints);
+    ui->chkHighlightSymbol->setChecked(options.m_highLightSymbol);
 
     ui->chkDiagnostics->setChecked(options.m_diagnostics);
     ui->chkMessages->setChecked(options.m_messages);
diff --git a/addons/lspclient/lspclientplugin.cpp b/addons/lspclient/lspclientplugin.cpp
index d1becb8dc1..3d608a569c 100644
--- a/addons/lspclient/lspclientplugin.cpp
+++ b/addons/lspclient/lspclientplugin.cpp
@@ -45,6 +45,7 @@ static constexpr char CONFIG_BLOCKED_COMMANDS[] = "BlockedServerCommandLines";
 static constexpr char CONFIG_FORMAT_ON_SAVE[] = "FormatOnSave";
 static constexpr char CONFIG_INLAY_HINT[] = "InlayHints";
 static constexpr char CONFIG_SHOW_COMPL[] = "ShowCompletions";
+static constexpr char CONFIG_HIGHLIGHT_SYMBOL[] = "HighlightSymbol";
 
 K_PLUGIN_FACTORY_WITH_JSON(LSPClientPluginFactory, "lspclientplugin.json", registerPlugin<LSPClientPlugin>();)
 
@@ -135,6 +136,7 @@ void LSPClientPlugin::readConfig()
     m_autoImport = config.readEntry(CONFIG_AUTO_IMPORT, defaults.m_autoImport);
     m_fmtOnSave = config.readEntry(CONFIG_FORMAT_ON_SAVE, defaults.m_fmtOnSave);
     m_inlayHints = config.readEntry(CONFIG_INLAY_HINT, defaults.m_inlayHints);
+    m_highLightSymbol = config.readEntry(CONFIG_HIGHLIGHT_SYMBOL, true);
 
     m_diagnostics = config.readEntry(CONFIG_DIAGNOSTICS, defaults.m_diagnostics);
     m_messages = config.readEntry(CONFIG_MESSAGES, defaults.m_messages);
@@ -178,6 +180,7 @@ void LSPClientPlugin::writeConfig() const
     config.writeEntry(CONFIG_FORMAT_ON_SAVE, m_fmtOnSave);
     config.writeEntry(CONFIG_INLAY_HINT, m_inlayHints);
     config.writeEntry(CONFIG_SHOW_COMPL, m_showCompl);
+    config.writeEntry(CONFIG_HIGHLIGHT_SYMBOL, m_highLightSymbol);
 
     // write allow + block lists as two separate keys
     QStringList allowed, blocked;
diff --git a/addons/lspclient/lspclientplugin.h b/addons/lspclient/lspclientplugin.h
index 8ede057f1f..6240bf2572 100644
--- a/addons/lspclient/lspclientplugin.h
+++ b/addons/lspclient/lspclientplugin.h
@@ -43,6 +43,7 @@ struct LSPClientPluginOptions {
     bool m_autoImport = true;
     bool m_fmtOnSave = false;
     bool m_inlayHints = false;
+    bool m_highLightSymbol = true;
 
     bool m_diagnostics = true;
     bool m_messages = true;
diff --git a/addons/lspclient/lspclientpluginview.cpp b/addons/lspclient/lspclientpluginview.cpp
index 72186e981a..0418559b70 100644
--- a/addons/lspclient/lspclientpluginview.cpp
+++ b/addons/lspclient/lspclientpluginview.cpp
@@ -12,6 +12,7 @@
 #include "lspclienthover.h"
 #include "lspclientplugin.h"
 #include "lspclientservermanager.h"
+#include "lspclientsymbolhighlighter.h"
 #include "lspclientsymbolview.h"
 #include "lspclientutils.h"
 #include "texthint/KateTextHintManager.h"
@@ -454,6 +455,7 @@ class LSPClientPluginViewImpl : public QObject, public KXMLGUIClient
     };
 
     LSPDiagnosticProvider m_diagnosticProvider;
+    LSPClientSymbolHighlighter m_symbolHighlighter;
 
 public:
     LSPClientPluginViewImpl(LSPClientPlugin *plugin, KTextEditor::MainWindow *mainWin, std::shared_ptr<LSPClientServerManager> serverManager)
@@ -468,6 +470,7 @@ public:
         , m_semHighlightingManager(m_serverManager)
         , m_inlayHintsHandler(m_serverManager, this)
         , m_diagnosticProvider(mainWin, this)
+        , m_symbolHighlighter(actionCollection())
     {
         KXMLGUIClient::setComponentName(QStringLiteral("lspclient"), i18n("LSP Client"));
         setXMLFile(QStringLiteral("ui.rc"));
@@ -661,7 +664,6 @@ public:
         connect(this, &self_type::ctrlClickDefRecieved, this, &self_type::onCtrlMouseMove);
 
         configUpdated();
-        updateState();
 
         m_mainWindow->guiFactory()->addClient(this);
     }
@@ -2297,6 +2299,12 @@ public:
         actionCollection()->action(QStringLiteral("lspclient_rename"))->setVisible(server != nullptr);
         actionCollection()->action(QStringLiteral("lspclient_other_menu"))->setVisible(server != nullptr);
 
+        if (m_plugin->m_highLightSymbol) {
+            m_symbolHighlighter.attach(activeView, server);
+        } else {
+            m_symbolHighlighter.attach(nullptr, nullptr);
+        }
+
         if (m_findDef) {
             m_findDef->setEnabled(defEnabled);
         }
diff --git a/addons/lspclient/lspclientsymbolhighlighter.cpp b/addons/lspclient/lspclientsymbolhighlighter.cpp
new file mode 100644
index 0000000000..0176675b68
--- /dev/null
+++ b/addons/lspclient/lspclientsymbolhighlighter.cpp
@@ -0,0 +1,157 @@
+/*
+ *    SPDX-FileCopyrightText: 2025 Yuri Timenkov <yuri@timenkov.pro>
+ *
+ *    SPDX-License-Identifier: MIT
+ */
+
+#include "lspclientsymbolhighlighter.h"
+
+#include "lspclientservermanager.h"
+
+#include <KActionCollection>
+#include <KLocalizedString>
+#include <KTextEditor/Document>
+#include <KTextEditor/Editor>
+#include <KTextEditor/MainWindow>
+#include <KTextEditor/View>
+
+LSPClientSymbolHighlighter::LSPClientSymbolHighlighter(KActionCollection *actions)
+    : m_highlightAttribute(new KTextEditor::Attribute())
+{
+    m_highlightDelayTimer.setSingleShot(true);
+    m_highlightDelayTimer.setInterval(100);
+    connect(&m_highlightDelayTimer, &QTimer::timeout, this, &LSPClientSymbolHighlighter::highlight);
+
+    m_requestTimeout.setSingleShot(true);
+    m_requestTimeout.setInterval(1000);
+    connect(&m_requestTimeout, &QTimer::timeout, this, &LSPClientSymbolHighlighter::cancelRequest);
+
+    m_nextSymbolHighlight = actions->addAction(QStringLiteral("lspclient_next_symbol_highlight"), this, &LSPClientSymbolHighlighter::gotoNextHighlight);
+    m_nextSymbolHighlight->setText(i18n("Go to next symbol highlight"));
+    m_prevSymbolHighlight = actions->addAction(QStringLiteral("lspclient_prev_symbol_highlight"), this, &LSPClientSymbolHighlighter::gotoPrevHighlight);
+    m_prevSymbolHighlight->setText(i18n("Go to previous symbol highlight"));
+
+    connect(KTextEditor::Editor::instance(), &KTextEditor::Editor::configChanged, this, &LSPClientSymbolHighlighter::themeChange);
+    themeChange(KTextEditor::Editor::instance());
+}
+
+void LSPClientSymbolHighlighter::attach(KTextEditor::View *view, std::shared_ptr<LSPClientServer> server)
+{
+    bool actionsEnabled;
+    if (!view || !server) {
+        m_currentView = nullptr;
+        m_currentServer = nullptr;
+        actionsEnabled = false;
+    } else {
+        m_currentView = view;
+        m_currentServer = std::move(server);
+        actionsEnabled = true;
+        connect(view, &KTextEditor::View::cursorPositionChanged, this, &LSPClientSymbolHighlighter::cursorPositionChanged, Qt::UniqueConnection);
+        connect(view, &KTextEditor::View::selectionChanged, this, &LSPClientSymbolHighlighter::rangesInvalidated, Qt::UniqueConnection);
+    }
+    m_nextSymbolHighlight->setEnabled(actionsEnabled);
+    m_prevSymbolHighlight->setEnabled(actionsEnabled);
+
+    rangesInvalidated();
+}
+
+void LSPClientSymbolHighlighter::cursorPositionChanged(KTextEditor::View *, const KTextEditor::Cursor &newPosition)
+{
+    if (!m_currentWord.contains(newPosition)) {
+        rangesInvalidated();
+    }
+}
+
+void LSPClientSymbolHighlighter::rangesInvalidated()
+{
+    m_ranges.clear();
+    m_currentWord = KTextEditor::Range::invalid();
+    cancelRequest();
+
+    if (m_currentView && !m_currentView->selection())
+        m_highlightDelayTimer.start();
+    else
+        m_highlightDelayTimer.stop();
+}
+
+void LSPClientSymbolHighlighter::themeChange(KTextEditor::Editor *e)
+{
+    const auto theme = e->theme();
+    m_highlightAttribute->setBackground(QBrush(theme.editorColor(KSyntaxHighlighting::Theme::SearchHighlight)));
+}
+
+void LSPClientSymbolHighlighter::cancelRequest()
+{
+    m_requestHandle.cancel() = {};
+}
+
+void LSPClientSymbolHighlighter::highlight()
+{
+    if (!m_currentView || !m_currentServer)
+        return;
+
+    m_requestTimeout.start();
+    m_requestHandle.cancel() = m_currentServer->documentHighlight(
+        m_currentView->document()->url(),
+        m_currentView->cursorPosition(),
+        this,
+        [this](const QList<LSPDocumentHighlight> &locations) {
+            // By the time we get response view may change.
+            if (!m_currentView)
+                return;
+
+            m_ranges.resize(locations.length());
+
+            std::ranges::transform(locations, m_ranges.begin(), [attr = m_highlightAttribute, document = m_currentView->document()](auto &loc) {
+                auto mr = std::unique_ptr<KTextEditor::MovingRange>(document->newMovingRange(loc.range));
+                mr->setZDepth(-90000.0); // Set the z-depth to slightly worse than the selection
+                mr->setAttribute(attr);
+                mr->setAttributeOnlyForViews(true);
+                return mr;
+            });
+
+            if (auto it = findRange(m_currentView->cursorPosition()); it != m_ranges.end()) {
+                m_currentWord = **it;
+            }
+        });
+}
+
+LSPClientSymbolHighlighter::MovingRangeList::iterator LSPClientSymbolHighlighter::findRange(const KTextEditor::Cursor &position)
+{
+    return std::find_if(m_ranges.begin(), m_ranges.end(), [&position](auto &range) {
+        return range->contains(position);
+    });
+}
+
+void LSPClientSymbolHighlighter::gotoNextHighlight()
+{
+    if (auto it = findRange(m_currentWord.start()); it != m_ranges.end()) {
+        if (++it == m_ranges.end()) {
+            it = m_ranges.begin();
+        }
+        goToRange(**it);
+    }
+}
+
+void LSPClientSymbolHighlighter::gotoPrevHighlight()
+{
+    if (auto it = findRange(m_currentWord.start()); it != m_ranges.end()) {
+        if (it == m_ranges.begin()) {
+            it = m_ranges.end();
+        }
+        --it;
+
+        goToRange(**it);
+    }
+}
+
+void LSPClientSymbolHighlighter::goToRange(const KTextEditor::MovingRange &range)
+{
+    if (!m_currentView)
+        return;
+
+    // Update the current word position to skip new query to LSP
+    // when signal is received.
+    m_currentWord = range;
+    m_currentView->setCursorPosition(range.start().toCursor());
+}
diff --git a/addons/lspclient/lspclientsymbolhighlighter.h b/addons/lspclient/lspclientsymbolhighlighter.h
new file mode 100644
index 0000000000..b426daefe8
--- /dev/null
+++ b/addons/lspclient/lspclientsymbolhighlighter.h
@@ -0,0 +1,60 @@
+/*
+ *    SPDX-FileCopyrightText: 2025 Yuri Timenkov <yuri@timenkov.pro>
+ *
+ *    SPDX-License-Identifier: MIT
+ */
+
+#pragma once
+
+#include "lspclientserver.h"
+
+#include <KTextEditor/Attribute>
+
+namespace KTextEditor
+{
+class Cursor;
+class Editor;
+class MovingRange;
+class View;
+}
+class KActionCollection;
+
+// Highlights all occurrences of symbol under the cursor
+class LSPClientSymbolHighlighter : public QObject
+{
+public:
+    explicit LSPClientSymbolHighlighter(KActionCollection *actions);
+
+    void attach(KTextEditor::View *view, std::shared_ptr<LSPClientServer> server);
+
+private:
+    using MovingRangeList = std::vector<std::unique_ptr<KTextEditor::MovingRange>>;
+
+    void cursorPositionChanged(KTextEditor::View *view, const KTextEditor::Cursor &newPosition);
+    void themeChange(KTextEditor::Editor *e);
+
+    void highlight();
+    void rangesInvalidated();
+    void cancelRequest();
+
+    void gotoNextHighlight();
+    void gotoPrevHighlight();
+
+    MovingRangeList::iterator findRange(const KTextEditor::Cursor &position);
+    void goToRange(const KTextEditor::MovingRange &range);
+
+private:
+    KTextEditor::Attribute::Ptr m_highlightAttribute;
+    QAction *m_nextSymbolHighlight;
+    QAction *m_prevSymbolHighlight;
+
+    QPointer<KTextEditor::View> m_currentView;
+    std::shared_ptr<LSPClientServer> m_currentServer;
+
+    KTextEditor::Range m_currentWord;
+    MovingRangeList m_ranges;
+
+    QTimer m_highlightDelayTimer;
+    QTimer m_requestTimeout;
+    LSPClientServer::RequestHandle m_requestHandle;
+};
diff --git a/addons/lspclient/lspconfigwidget.ui b/addons/lspclient/lspconfigwidget.ui
index 12f0a3a05c..ea5fa54917 100644
--- a/addons/lspclient/lspconfigwidget.ui
+++ b/addons/lspclient/lspconfigwidget.ui
@@ -36,7 +36,7 @@
        <item>
         <layout class="QFormLayout" name="formLayout">
          <property name="formAlignment">
-          <set>Qt::AlignHCenter|Qt::AlignTop</set>
+          <set>Qt::AlignmentFlag::AlignHCenter|Qt::AlignmentFlag::AlignTop</set>
          </property>
          <property name="bottomMargin">
           <number>0</number>
@@ -69,133 +69,133 @@
            </property>
           </widget>
          </item>
-         <item row="4" column="0">
+         <item row="5" column="0">
           <widget class="QLabel" name="label_2">
            <property name="text">
             <string>Completions:</string>
            </property>
           </widget>
          </item>
-         <item row="4" column="1">
+         <item row="5" column="1">
           <widget class="QCheckBox" name="chkShowCompl">
            <property name="text">
             <string>Show completions</string>
            </property>
           </widget>
          </item>
-         <item row="5" column="1">
+         <item row="6" column="1">
           <widget class="QCheckBox" name="chkComplDoc">
            <property name="text">
             <string>Show inline docs for selected completion</string>
            </property>
           </widget>
          </item>
-         <item row="6" column="1">
+         <item row="7" column="1">
           <widget class="QCheckBox" name="chkSignatureHelp">
            <property name="text">
             <string>Show function signature when typing a function call</string>
            </property>
           </widget>
          </item>
-         <item row="7" column="1">
+         <item row="8" column="1">
           <widget class="QCheckBox" name="chkComplParens">
            <property name="text">
             <string>Add parentheses upon function completion</string>
            </property>
           </widget>
          </item>
-         <item row="8" column="1">
+         <item row="9" column="1">
           <widget class="QCheckBox" name="chkAutoImport">
            <property name="text">
             <string>Add imports automatically if needed upon completion</string>
            </property>
           </widget>
          </item>
-         <item row="9" column="0">
+         <item row="10" column="0">
           <widget class="QLabel" name="label_5">
            <property name="text">
             <string>Navigation:</string>
            </property>
           </widget>
          </item>
-         <item row="9" column="1">
+         <item row="10" column="1">
           <widget class="QCheckBox" name="chkRefDeclaration">
            <property name="text">
             <string>Count declarations when searching for references to a symbol</string>
            </property>
           </widget>
          </item>
-         <item row="10" column="1">
+         <item row="11" column="1">
           <widget class="QCheckBox" name="chkAutoHover">
            <property name="text">
             <string>Show information about currently hovered symbol</string>
            </property>
           </widget>
          </item>
-         <item row="11" column="1">
+         <item row="12" column="1">
           <widget class="QCheckBox" name="chkHighlightGoto">
            <property name="text">
             <string>Highlight target line when hopping to it</string>
            </property>
           </widget>
          </item>
-         <item row="12" column="0">
+         <item row="14" column="0">
           <widget class="QLabel" name="label_3">
            <property name="text">
             <string>Server:</string>
            </property>
           </widget>
          </item>
-         <item row="12" column="1">
+         <item row="14" column="1">
           <widget class="QCheckBox" name="chkDiagnostics">
            <property name="text">
             <string>Show program diagnostics</string>
            </property>
           </widget>
          </item>
-         <item row="13" column="1">
+         <item row="15" column="1">
           <widget class="QCheckBox" name="chkMessages">
            <property name="text">
             <string>Show notifications from the LSP server</string>
            </property>
           </widget>
          </item>
-         <item row="14" column="1">
+         <item row="16" column="1">
           <widget class="QCheckBox" name="chkIncrementalSync">
            <property name="text">
             <string>Incrementally synchronize documents with the LSP server</string>
            </property>
           </widget>
          </item>
-         <item row="15" column="0">
+         <item row="17" column="0">
           <widget class="QLabel" name="label_6">
            <property name="text">
             <string>Document outline:</string>
            </property>
           </widget>
          </item>
-         <item row="15" column="1">
+         <item row="17" column="1">
           <widget class="QCheckBox" name="chkSymbolSort">
            <property name="text">
             <string>Sort symbols alphabetically</string>
            </property>
           </widget>
          </item>
-         <item row="16" column="1">
+         <item row="18" column="1">
           <widget class="QCheckBox" name="chkSymbolDetails">
            <property name="text">
             <string>Display additional details for symbols</string>
            </property>
           </widget>
          </item>
-         <item row="17" column="1">
+         <item row="19" column="1">
           <widget class="QCheckBox" name="chkSymbolTree">
            <property name="text">
             <string>Present symbols in a hierarchy instead of a flat list</string>
            </property>
           </widget>
          </item>
-         <item row="18" column="1">
+         <item row="20" column="1">
           <layout class="QHBoxLayout" name="horizontalLayout_4">
            <property name="leftMargin">
             <number>20</number>
@@ -212,12 +212,19 @@
            </item>
           </layout>
          </item>
+         <item row="13" column="1">
+          <widget class="QCheckBox" name="chkHighlightSymbol">
+           <property name="text">
+            <string>Highlight symbol under cursor</string>
+           </property>
+          </widget>
+         </item>
         </layout>
        </item>
        <item>
         <spacer name="verticalSpacer">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -254,8 +261,8 @@
           </widget>
          </item>
          <item>
-          <widget class="KUrlRequester" name="edtConfigPath">
-           <property name="text">
+          <widget class="KUrlRequester" name="edtConfigPath" native="true">
+           <property name="text" stdset="0">
             <string/>
            </property>
           </widget>
-- 
GitLab