forked from qt-creator/qt-creator
LanguageClient: fix restart check for stdio clients
Change-Id: I4acb61b48b7ac18423b2e106f1f9ea9b3f7ccb70 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -775,6 +775,11 @@ const DynamicCapabilities &Client::dynamicCapabilities() const
|
|||||||
return m_dynamicCapabilities;
|
return m_dynamicCapabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const BaseClientInterface *Client::clientInterface() const
|
||||||
|
{
|
||||||
|
return m_clientInterface.data();
|
||||||
|
}
|
||||||
|
|
||||||
void Client::log(const ShowMessageParams &message,
|
void Client::log(const ShowMessageParams &message,
|
||||||
Core::MessageManager::PrintToOutputPaneFlag flag)
|
Core::MessageManager::PrintToOutputPaneFlag flag)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ public:
|
|||||||
|
|
||||||
const LanguageServerProtocol::ServerCapabilities &capabilities() const;
|
const LanguageServerProtocol::ServerCapabilities &capabilities() const;
|
||||||
const DynamicCapabilities &dynamicCapabilities() const;
|
const DynamicCapabilities &dynamicCapabilities() const;
|
||||||
|
const BaseClientInterface *clientInterface() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void initialized(LanguageServerProtocol::ServerCapabilities capabilities);
|
void initialized(LanguageServerProtocol::ServerCapabilities capabilities);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ StdIOClientInterface::~StdIOClientInterface()
|
|||||||
Utils::SynchronousProcess::stopProcess(m_process);
|
Utils::SynchronousProcess::stopProcess(m_process);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StdIOClientInterface::needsRestart(const StdIOSettings *settings)
|
bool StdIOClientInterface::needsRestart(const StdIOSettings *settings) const
|
||||||
{
|
{
|
||||||
return m_executable != settings->m_executable || m_arguments != settings->m_arguments;
|
return m_executable != settings->m_executable || m_arguments != settings->m_arguments;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public:
|
|||||||
StdIOClientInterface &operator=(const StdIOClientInterface &) = delete;
|
StdIOClientInterface &operator=(const StdIOClientInterface &) = delete;
|
||||||
StdIOClientInterface &operator=(StdIOClientInterface &&) = delete;
|
StdIOClientInterface &operator=(StdIOClientInterface &&) = delete;
|
||||||
|
|
||||||
bool needsRestart(const StdIOSettings *settings);
|
bool needsRestart(const StdIOSettings *settings) const;
|
||||||
|
|
||||||
bool start() override;
|
bool start() override;
|
||||||
|
|
||||||
|
|||||||
@@ -473,7 +473,9 @@ bool StdIOSettings::needsRestart() const
|
|||||||
{
|
{
|
||||||
if (BaseSettings::needsRestart())
|
if (BaseSettings::needsRestart())
|
||||||
return true;
|
return true;
|
||||||
if (auto stdIOInterface = qobject_cast<StdIOClientInterface *>(m_client))
|
if (m_client.isNull())
|
||||||
|
return false;
|
||||||
|
if (auto stdIOInterface = qobject_cast<const StdIOClientInterface *>(m_client->clientInterface()))
|
||||||
return stdIOInterface->needsRestart(this);
|
return stdIOInterface->needsRestart(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user