LSP: Set client working directory to project directory

If the server settings specify that a server is to be started "per
project".

This fixes e.g. running the haskell-language-server

Fixes: QTCREATORBUG-26115
Change-Id: If10af71d60786826a9218b4b98818df8d9710adf
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2021-08-25 12:48:39 +02:00
parent 1d5ddbf8f8
commit 940a203d93
3 changed files with 18 additions and 5 deletions

View File

@@ -166,9 +166,8 @@ Client *LanguageClientManager::startClient(BaseSettings *setting, ProjectExplore
QTC_ASSERT(managerInstance, return nullptr);
QTC_ASSERT(setting, return nullptr);
QTC_ASSERT(setting->isValid(), return nullptr);
Client *client = setting->createClient();
Client *client = setting->createClient(project);
QTC_ASSERT(client, return nullptr);
client->setCurrentProject(project);
client->start();
managerInstance->m_clientsForSetting[setting->m_id].append(client);
return client;