aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditoractionhandler.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2023-09-05 11:14:10 +0200
committerDavid Schulz <david.schulz@qt.io>2023-09-29 09:10:14 +0000
commit80633a59aabca94e52e473837164203041e72c6e (patch)
tree2133c52fdf4b7d675d1d588c0b1b9a444a1093d9 /src/plugins/texteditor/texteditoractionhandler.cpp
parent23828a1d9c3b4b7cedec8c65a4797728a5d02505 (diff)
LanguageClient: support additional goto targets in symbol support
Allow to follow to the symbol definition as well as to the type definition for the symbol under the cursor position. Change-Id: I8ff50b33a1e739f81b0832b1b28ffc525e1f7177 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditoractionhandler.cpp')
-rw-r--r--src/plugins/texteditor/texteditoractionhandler.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp
index d8405d3346..80625cc42e 100644
--- a/src/plugins/texteditor/texteditoractionhandler.cpp
+++ b/src/plugins/texteditor/texteditoractionhandler.cpp
@@ -118,6 +118,8 @@ public:
QAction *m_unfoldAllAction = nullptr;
QAction *m_followSymbolAction = nullptr;
QAction *m_followSymbolInNextSplitAction = nullptr;
+ QAction *m_followToTypeAction = nullptr;
+ QAction *m_followToTypeInNextSplitAction = nullptr;
QAction *m_findUsageAction = nullptr;
QAction *m_openCallHierarchyAction = nullptr;
QAction *m_renameSymbolAction = nullptr;
@@ -224,6 +226,12 @@ void TextEditorActionHandlerPrivate::createActions()
m_followSymbolInNextSplitAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT,
[] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, Tr::tr("Follow Symbol Under Cursor in Next Split"),
QKeySequence(Utils::HostOsInfo::isMacHost() ? Tr::tr("Meta+E, F2") : Tr::tr("Ctrl+E, F2")));
+ m_followToTypeAction = registerAction(FOLLOW_SYMBOL_TO_TYPE,
+ [] (TextEditorWidget *w) { w->openTypeUnderCursor(); }, true, Tr::tr("Follow Type Under Cursor"),
+ QKeySequence(Tr::tr("Ctrl+Shift+F2")));
+ m_followToTypeInNextSplitAction = registerAction(FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT,
+ [] (TextEditorWidget *w) { w->openTypeUnderCursorInNextSplit(); }, true, Tr::tr("Follow Type Under Cursor in Next Split"),
+ QKeySequence(Utils::HostOsInfo::isMacHost() ? Tr::tr("Meta+E, Shift+F2") : Tr::tr("Ctrl+E, Ctrl+Shift+F2")));
m_findUsageAction = registerAction(FIND_USAGES,
[] (TextEditorWidget *w) { w->findUsages(); }, true, Tr::tr("Find References to Symbol Under Cursor"),
QKeySequence(Tr::tr("Ctrl+Shift+U")));
@@ -492,6 +500,10 @@ void TextEditorActionHandlerPrivate::updateOptionalActions()
optionalActions & TextEditorActionHandler::FollowSymbolUnderCursor);
m_followSymbolInNextSplitAction->setEnabled(
optionalActions & TextEditorActionHandler::FollowSymbolUnderCursor);
+ m_followToTypeAction->setEnabled(
+ optionalActions & TextEditorActionHandler::FollowTypeUnderCursor);
+ m_followToTypeInNextSplitAction->setEnabled(
+ optionalActions & TextEditorActionHandler::FollowTypeUnderCursor);
m_findUsageAction->setEnabled(
optionalActions & TextEditorActionHandler::FindUsage);
m_jumpToFileAction->setEnabled(