forked from qt-creator/qt-creator
Copilot: Do not try to start copilot without nodejs
Avoids the attempt to start the client if nodejs cannot be found. Change-Id: I3783280120ca754291a92b3308c1192906facd08 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -93,7 +93,7 @@ void AuthWidget::updateClient(const Utils::FilePath &nodeJs, const Utils::FilePa
|
|||||||
m_client = nullptr;
|
m_client = nullptr;
|
||||||
setState(Tr::tr("Sign in"), false);
|
setState(Tr::tr("Sign in"), false);
|
||||||
m_button->setEnabled(false);
|
m_button->setEnabled(false);
|
||||||
if (!nodeJs.exists() || !agent.exists()) {
|
if (!nodeJs.isExecutableFile() || !agent.exists()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,9 @@ void CopilotPlugin::extensionsInitialized()
|
|||||||
void CopilotPlugin::restartClient()
|
void CopilotPlugin::restartClient()
|
||||||
{
|
{
|
||||||
LanguageClient::LanguageClientManager::shutdownClient(m_client);
|
LanguageClient::LanguageClientManager::shutdownClient(m_client);
|
||||||
|
|
||||||
|
if (!CopilotSettings::instance().nodeJsPath().isExecutableFile())
|
||||||
|
return;
|
||||||
m_client = new CopilotClient(CopilotSettings::instance().nodeJsPath(),
|
m_client = new CopilotClient(CopilotSettings::instance().nodeJsPath(),
|
||||||
CopilotSettings::instance().distPath());
|
CopilotSettings::instance().distPath());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user