forked from qt-creator/qt-creator
Copilot: Add LSP plugin for Copilot
Fixes: QTCREATORBUG-27771 Change-Id: I1249b9a4492427208a70b3e21bf20ac668fc3c50 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
37
src/plugins/copilot/copilotplugin.cpp
Normal file
37
src/plugins/copilot/copilotplugin.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "copilotplugin.h"
|
||||
|
||||
#include "copilotclient.h"
|
||||
#include "copilotoptionspage.h"
|
||||
#include "copilotsettings.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Copilot {
|
||||
namespace Internal {
|
||||
|
||||
void CopilotPlugin::initialize()
|
||||
{
|
||||
CopilotSettings::instance().readSettings(Core::ICore::settings());
|
||||
|
||||
m_client = new CopilotClient();
|
||||
|
||||
connect(&CopilotSettings::instance(), &CopilotSettings::applied, this, [this]() {
|
||||
if (m_client)
|
||||
m_client->shutdown();
|
||||
m_client = nullptr;
|
||||
m_client = new CopilotClient();
|
||||
});
|
||||
}
|
||||
|
||||
void CopilotPlugin::extensionsInitialized()
|
||||
{
|
||||
CopilotOptionsPage::instance().init();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Copilot
|
||||
Reference in New Issue
Block a user