aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/languageclient
diff options
context:
space:
mode:
authorAlexis Murzeau <amubtdx@gmail.com>2020-04-26 21:23:03 +0200
committerAlexis Murzeau <amubtdx@gmail.com>2020-04-29 19:36:24 +0000
commit9ca930554fa8b185d5990b7a00489f010689b584 (patch)
treeb10d167b05692ee6d4ed32c6197441e132a4726b /src/plugins/languageclient
parent15419cb1454d7691c3b093c4ca3692c6dfe1be47 (diff)
LSP: fix outline's selected item when writing
When receiving textDocument/documentSymbol or textDocument/symbolInformation, the outline widget and the outline combobox is cleared and updated with received symbols. This causes the selected index to become the first item of the list when writing text. Fix the issue by updating the selected index after having updated the outline widget and outline combobox. Change-Id: I52541940f8a979cbf130da4383db48c470fc94e1 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/languageclient')
-rw-r--r--src/plugins/languageclient/languageclientoutline.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/languageclient/languageclientoutline.cpp b/src/plugins/languageclient/languageclientoutline.cpp
index 9655509229..89f19b04a5 100644
--- a/src/plugins/languageclient/languageclientoutline.cpp
+++ b/src/plugins/languageclient/languageclientoutline.cpp
@@ -187,6 +187,9 @@ void LanguageClientOutlineWidget::handleResponse(const DocumentUri &uri,
m_model.setInfo(Utils::get<QList<DocumentSymbol>>(result));
else
m_model.clear();
+
+ // The list has changed, update the current items
+ updateSelectionInTree(m_editor->textCursor());
}
void LanguageClientOutlineWidget::updateTextCursor(const QModelIndex &proxyIndex)
@@ -313,6 +316,9 @@ void OutlineComboBox::updateModel(const DocumentUri &resultUri, const DocumentSy
m_model.setInfo(Utils::get<QList<DocumentSymbol>>(result));
else
m_model.clear();
+
+ // The list has changed, update the current item
+ updateEntry();
}
void OutlineComboBox::updateEntry()