| 564 | } |
| 565 | |
| 566 | void 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 | |
| 586 | void LanguageClientHandlerPrivate::showDiagnosticTip(int pos, const newlsp::Diagnostic diagnostic) |
| 587 | { |
nothing calls this directly
no test coverage detected