Copilot: improve client handling

- centralize starting client
 - allow to start copilot with alternative settings
 - do not reset the client on finished.

A finish might be followed by a restart attempt, so untracking the
client in the plugin can result in having multiple running clients. Use
a QPointer instead to safely reset once the client is deleted.

Change-Id: Ifab8b04287d84bbdd4a0e936f4684b8d4391da2b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2023-03-09 11:08:57 +01:00
parent 2fc801e153
commit 301a3cb34f
4 changed files with 23 additions and 27 deletions

View File

@@ -23,7 +23,7 @@ class DocumentWatcher;
class CopilotClient : public LanguageClient::Client
{
public:
explicit CopilotClient();
explicit CopilotClient(const Utils::FilePath &nodePath, const Utils::FilePath &distPath);
static CopilotClient *instance();