forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/7.0'
Conflicts: src/plugins/mcusupport/mcupackage.cpp src/plugins/mcusupport/mcusupportoptions.cpp src/plugins/mcusupport/mcusupportoptions.h src/plugins/mcusupport/mcusupportoptionspage.cpp src/plugins/mcusupport/mcusupportplugin.cpp src/plugins/mcusupport/mcusupportsdk.cpp Change-Id: Ib423e9f23877176f01b188104b0a179ed32c4770
This commit is contained in:
@@ -112,6 +112,11 @@ Client::Client(BaseClientInterface *clientInterface)
|
||||
|
||||
m_tokenSupport.setTokenTypesMap(SemanticTokens::defaultTokenTypesMap());
|
||||
m_tokenSupport.setTokenModifiersMap(SemanticTokens::defaultTokenModifiersMap());
|
||||
|
||||
m_shutdownTimer.setInterval(20 /*seconds*/ * 1000);
|
||||
connect(&m_shutdownTimer, &QTimer::timeout, this, [this] {
|
||||
LanguageClientManager::deleteClient(this);
|
||||
});
|
||||
}
|
||||
|
||||
QString Client::name() const
|
||||
@@ -317,7 +322,6 @@ void Client::initialize()
|
||||
|
||||
// directly send message otherwise the state check of sendContent would fail
|
||||
sendMessage(initRequest.toBaseMessage());
|
||||
m_clientInterface->sendMessage(initRequest.toBaseMessage());
|
||||
m_state = InitializeRequested;
|
||||
}
|
||||
|
||||
@@ -331,6 +335,7 @@ void Client::shutdown()
|
||||
});
|
||||
sendContent(shutdown);
|
||||
m_state = ShutdownRequested;
|
||||
m_shutdownTimer.start();
|
||||
}
|
||||
|
||||
Client::State Client::state() const
|
||||
@@ -364,7 +369,7 @@ void Client::setClientCapabilities(const LanguageServerProtocol::ClientCapabilit
|
||||
void Client::openDocument(TextEditor::TextDocument *document)
|
||||
{
|
||||
using namespace TextEditor;
|
||||
if (!isSupportedDocument(document))
|
||||
if (m_openedDocument.contains(document) || !isSupportedDocument(document))
|
||||
return;
|
||||
|
||||
if (m_state != Initialized) {
|
||||
@@ -372,8 +377,6 @@ void Client::openDocument(TextEditor::TextDocument *document)
|
||||
return;
|
||||
}
|
||||
|
||||
QTC_ASSERT(!m_openedDocument.contains(document), return);
|
||||
|
||||
const FilePath &filePath = document->filePath();
|
||||
const QString method(DidOpenTextDocumentNotification::methodName);
|
||||
if (Utils::optional<bool> registered = m_dynamicCapabilities.isRegistered(method)) {
|
||||
@@ -1622,6 +1625,7 @@ void Client::initializeCallback(const InitializeRequest::Response &initResponse)
|
||||
|
||||
void Client::shutDownCallback(const ShutdownRequest::Response &shutdownResponse)
|
||||
{
|
||||
m_shutdownTimer.stop();
|
||||
QTC_ASSERT(m_state == ShutdownRequested, return);
|
||||
QTC_ASSERT(m_clientInterface, return);
|
||||
optional<ShutdownRequest::Response::Error> errorValue = shutdownResponse.error();
|
||||
@@ -1634,6 +1638,7 @@ void Client::shutDownCallback(const ShutdownRequest::Response &shutdownResponse)
|
||||
sendMessage(ExitNotification().toBaseMessage());
|
||||
qCDebug(LOGLSPCLIENT) << "language server " << m_displayName << " shutdown";
|
||||
m_state = Shutdown;
|
||||
m_shutdownTimer.start();
|
||||
}
|
||||
|
||||
bool Client::sendWorkspceFolderChanges() const
|
||||
|
||||
Reference in New Issue
Block a user