Commit 4bd67163 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

lspclient: add symbol goto to menu

parent 9d01bae0
...@@ -374,6 +374,7 @@ class LSPClientActionView : public QObject ...@@ -374,6 +374,7 @@ class LSPClientActionView : public QObject
QPointer<QAction> m_findImpl; QPointer<QAction> m_findImpl;
QPointer<QAction> m_triggerHighlight; QPointer<QAction> m_triggerHighlight;
QPointer<QAction> m_triggerSymbolInfo; QPointer<QAction> m_triggerSymbolInfo;
QPointer<QAction> m_triggerGotoSymbol;
QPointer<QAction> m_triggerFormat; QPointer<QAction> m_triggerFormat;
QPointer<QAction> m_triggerRename; QPointer<QAction> m_triggerRename;
QPointer<QAction> m_complDocOn; QPointer<QAction> m_complDocOn;
...@@ -516,6 +517,9 @@ public: ...@@ -516,6 +517,9 @@ public:
m_triggerHighlight->setText(i18n("Highlight")); m_triggerHighlight->setText(i18n("Highlight"));
m_triggerSymbolInfo = actionCollection()->addAction(QStringLiteral("lspclient_symbol_info"), this, &self_type::symbolInfo); m_triggerSymbolInfo = actionCollection()->addAction(QStringLiteral("lspclient_symbol_info"), this, &self_type::symbolInfo);
m_triggerSymbolInfo->setText(i18n("Symbol Info")); m_triggerSymbolInfo->setText(i18n("Symbol Info"));
m_triggerGotoSymbol = actionCollection()->addAction(QStringLiteral("lspclient_goto_workspace_symbol"), this, &self_type::gotoWorkSpaceSymbol);
m_triggerGotoSymbol->setText(i18n("Search and Go to Symbol"));
actionCollection()->setDefaultShortcut(m_triggerGotoSymbol, Qt::ALT | Qt::CTRL | Qt::Key_P);
m_triggerFormat = actionCollection()->addAction(QStringLiteral("lspclient_format"), this, &self_type::format); m_triggerFormat = actionCollection()->addAction(QStringLiteral("lspclient_format"), this, &self_type::format);
m_triggerFormat->setText(i18n("Format")); m_triggerFormat->setText(i18n("Format"));
m_triggerRename = actionCollection()->addAction(QStringLiteral("lspclient_rename"), this, &self_type::rename); m_triggerRename = actionCollection()->addAction(QStringLiteral("lspclient_rename"), this, &self_type::rename);
...@@ -584,9 +588,6 @@ public: ...@@ -584,9 +588,6 @@ public:
m_restartAll = actionCollection()->addAction(QStringLiteral("lspclient_restart_all"), this, &self_type::restartAll); m_restartAll = actionCollection()->addAction(QStringLiteral("lspclient_restart_all"), this, &self_type::restartAll);
m_restartAll->setText(i18n("Restart All LSP Servers")); m_restartAll->setText(i18n("Restart All LSP Servers"));
auto act = actionCollection()->addAction(QStringLiteral("lspclient_goto_workspace_symbol"), this, &self_type::gotoWorkSpaceSymbol);
act->setShortcut(Qt::ALT | Qt::CTRL | Qt::Key_P);
// popup menu // popup menu
auto menu = new KActionMenu(i18n("LSP Client"), this); auto menu = new KActionMenu(i18n("LSP Client"), this);
actionCollection()->addAction(QStringLiteral("popup_lspclient"), menu); actionCollection()->addAction(QStringLiteral("popup_lspclient"), menu);
...@@ -598,6 +599,7 @@ public: ...@@ -598,6 +599,7 @@ public:
menu->addAction(m_switchSourceHeader); menu->addAction(m_switchSourceHeader);
menu->addAction(m_triggerHighlight); menu->addAction(m_triggerHighlight);
menu->addAction(m_triggerSymbolInfo); menu->addAction(m_triggerSymbolInfo);
menu->addAction(m_triggerGotoSymbol);
menu->addAction(m_triggerFormat); menu->addAction(m_triggerFormat);
menu->addAction(m_triggerRename); menu->addAction(m_triggerRename);
menu->addAction(m_quickFix); menu->addAction(m_quickFix);
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd"> <!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui name="lspclient" library="lspclient" version="17" translationDomain="lspclient"> <gui name="lspclient" library="lspclient" version="18" translationDomain="lspclient">
<MenuBar> <MenuBar>
<Menu name="LSPClient Menubar"> <Menu name="LSPClient Menubar">
<text>LSP Client</text> <text>LSP Client</text>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<Action name="lspclient_clangd_switchheader"/> <Action name="lspclient_clangd_switchheader"/>
<Action name="lspclient_highlight"/> <Action name="lspclient_highlight"/>
<Action name="lspclient_symbol_info"/> <Action name="lspclient_symbol_info"/>
<Action name="lspclient_goto_workspace_symbol"/>
<Action name="lspclient_format"/> <Action name="lspclient_format"/>
<Action name="lspclient_rename"/> <Action name="lspclient_rename"/>
<Action name="lspclient_quick_fix"/> <Action name="lspclient_quick_fix"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment