forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -479,8 +479,24 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor)
|
||||
connect(widget, &TextEditorWidget::requestLinkAt, this,
|
||||
[document = textEditor->textDocument()]
|
||||
(const QTextCursor &cursor, const Utils::LinkHandler &callback, bool resolveTarget) {
|
||||
if (auto client = clientForDocument(document))
|
||||
client->findLinkAt(document, cursor, callback, resolveTarget);
|
||||
if (auto client = clientForDocument(document)) {
|
||||
client->findLinkAt(document,
|
||||
cursor,
|
||||
callback,
|
||||
resolveTarget,
|
||||
LinkTarget::SymbolDef);
|
||||
}
|
||||
});
|
||||
connect(widget, &TextEditorWidget::requestTypeAt, this,
|
||||
[document = textEditor->textDocument()]
|
||||
(const QTextCursor &cursor, const Utils::LinkHandler &callback, bool resolveTarget) {
|
||||
if (auto client = clientForDocument(document)) {
|
||||
client->findLinkAt(document,
|
||||
cursor,
|
||||
callback,
|
||||
resolveTarget,
|
||||
LinkTarget::SymbolTypeDef);
|
||||
}
|
||||
});
|
||||
connect(widget, &TextEditorWidget::requestUsages, this,
|
||||
[document = textEditor->textDocument()](const QTextCursor &cursor) {
|
||||
|
||||
Reference in New Issue
Block a user