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:
@@ -936,6 +936,10 @@ void Client::activateEditor(Core::IEditor *editor)
|
||||
optionalActions |= TextEditor::TextEditorActionHandler::FindUsage;
|
||||
if (symbolSupport().supportsRename(widget->textDocument()))
|
||||
optionalActions |= TextEditor::TextEditorActionHandler::RenameSymbol;
|
||||
if (symbolSupport().supportsFindLink(widget->textDocument(), LinkTarget::SymbolDef))
|
||||
optionalActions |= TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor;
|
||||
if (symbolSupport().supportsFindLink(widget->textDocument(), LinkTarget::SymbolTypeDef))
|
||||
optionalActions |= TextEditor::TextEditorActionHandler::FollowTypeUnderCursor;
|
||||
if (CallHierarchyFactory::supportsCallHierarchy(this, textEditor->document()))
|
||||
optionalActions |= TextEditor::TextEditorActionHandler::CallHierarchy;
|
||||
widget->setOptionalActions(optionalActions);
|
||||
@@ -1306,7 +1310,8 @@ SymbolSupport &Client::symbolSupport()
|
||||
void Client::findLinkAt(TextEditor::TextDocument *document,
|
||||
const QTextCursor &cursor,
|
||||
Utils::LinkHandler callback,
|
||||
const bool resolveTarget)
|
||||
const bool resolveTarget,
|
||||
LinkTarget target)
|
||||
{
|
||||
if (d->m_runningFindLinkRequest.isValid())
|
||||
cancelRequest(d->m_runningFindLinkRequest);
|
||||
@@ -1317,7 +1322,8 @@ void Client::findLinkAt(TextEditor::TextDocument *document,
|
||||
d->m_runningFindLinkRequest = {};
|
||||
callback(link);
|
||||
},
|
||||
resolveTarget);
|
||||
resolveTarget,
|
||||
target);
|
||||
}
|
||||
|
||||
void Client::requestCodeActions(const LanguageServerProtocol::DocumentUri &uri,
|
||||
|
||||
Reference in New Issue
Block a user