forked from qt-creator/qt-creator
LanguageClient: add action to open call hierarchy
Fixes: QTCREATORBUG-28839 Fixes: QTCREATORBUG-28842 Change-Id: Icb70412282c0c2c36241559d942a58ffddab5664 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/find/searchresultwindow.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/navigationwidget.h>
|
||||
|
||||
#include <languageserverprotocol/messages.h>
|
||||
#include <languageserverprotocol/progresssupport.h>
|
||||
@@ -448,6 +449,8 @@ QList<Client *> LanguageClientManager::reachableClients()
|
||||
void LanguageClientManager::editorOpened(Core::IEditor *editor)
|
||||
{
|
||||
using namespace TextEditor;
|
||||
using namespace Core;
|
||||
|
||||
if (auto *textEditor = qobject_cast<BaseTextEditor *>(editor)) {
|
||||
if (TextEditorWidget *widget = textEditor->editorWidget()) {
|
||||
connect(widget, &TextEditorWidget::requestLinkAt, this,
|
||||
@@ -466,6 +469,14 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor)
|
||||
if (auto client = clientForDocument(document))
|
||||
client->symbolSupport().renameSymbol(document, cursor);
|
||||
});
|
||||
connect(widget, &TextEditorWidget::requestCallHierarchy, this,
|
||||
[this, textEditor](const QTextCursor &cursor) {
|
||||
if (auto client = clientForDocument(textEditor->textDocument())) {
|
||||
emit openCallHierarchy();
|
||||
NavigationWidget::activateSubWidget(Constants::CALL_HIERARCHY_FACTORY_ID,
|
||||
Side::Left);
|
||||
}
|
||||
});
|
||||
connect(widget, &TextEditorWidget::cursorPositionChanged, this, [widget]() {
|
||||
if (Client *client = clientForDocument(widget->textDocument()))
|
||||
if (client->reachable())
|
||||
|
||||
Reference in New Issue
Block a user