LanguageClient: Show outline after server start

If the server was started by opening a document the outline factory and
client was not properly initialized in the time the outline was
requested. Update the outline after the client is fully initialized.

Fixes: QTCREATORBUG-22695
Change-Id: I84dc56eead9774d80ed6baf7792daff930a7cb8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2019-07-16 12:29:20 +02:00
parent 3ae169f8ac
commit 3fbb5ddba8
4 changed files with 31 additions and 3 deletions

View File

@@ -43,6 +43,7 @@
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
#include <texteditor/textmark.h>
#include <texteditor/ioutlinewidget.h>
#include <utils/mimetypes/mimedatabase.h>
#include <utils/qtcprocess.h>
#include <utils/synchronousprocess.h>
@@ -1139,6 +1140,10 @@ void Client::intializeCallback(const InitializeRequest::Response &initResponse)
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor))
textEditor->editorWidget()->addHoverHandler(&m_hoverHandler);
}
if (m_dynamicCapabilities.isRegistered(DocumentSymbolsRequest::methodName)
.value_or(capabilities().documentSymbolProvider().value_or(false))) {
TextEditor::IOutlineWidgetFactory::updateOutline();
}
emit initialized(m_serverCapabilities);
}