MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / gotoDefinition

Method gotoDefinition

src/plugins/codeeditor/lsp/languageclienthandler.cpp:566–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566void LanguageClientHandlerPrivate::gotoDefinition()
567{
568 if (definitionCache.getLocations().size() > 0) {
569 Q_EMIT editor->cursorRecordChanged(editor->cursorLastPosition());
570 auto one = definitionCache.getLocations().front();
571 EditorCallProxy::instance()->reqGotoPosition(QUrl(QString::fromStdString(one.uri)).toLocalFile(),
572 one.range.start.line, one.range.start.character);
573 } else if (definitionCache.getLocationLinks().size() > 0) {
574 Q_EMIT editor->cursorRecordChanged(editor->cursorLastPosition());
575 auto one = definitionCache.getLocationLinks().front();
576 EditorCallProxy::instance()->reqGotoPosition(QUrl(QString::fromStdString(one.targetUri)).toLocalFile(),
577 one.targetRange.end.line, one.targetRange.end.character);
578 } else {
579 Q_EMIT editor->cursorRecordChanged(editor->cursorLastPosition());
580 auto one = definitionCache.getLocation();
581 EditorCallProxy::instance()->reqGotoPosition(QUrl(QString::fromStdString(one.uri)).toLocalFile(),
582 one.range.start.line, one.range.start.character);
583 }
584}
585
586void LanguageClientHandlerPrivate::showDiagnosticTip(int pos, const newlsp::Diagnostic diagnostic)
587{

Callers

nothing calls this directly

Calls 7

getLocationsMethod · 0.80
cursorLastPositionMethod · 0.80
frontMethod · 0.80
getLocationLinksMethod · 0.80
getLocationMethod · 0.80
QUrlClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected