aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/copilot/copilotsettings.h
blob: cec44c43fed9441c5231f07decafc0d57adbfa4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <utils/aspects.h>

namespace ProjectExplorer {
class Project;
}

namespace Copilot {

class CopilotSettings : public Utils::AspectContainer
{
public:
    CopilotSettings();

    static CopilotSettings &instance();

    Utils::FilePathAspect nodeJsPath{this};
    Utils::FilePathAspect distPath{this};
    Utils::BoolAspect autoComplete{this};
    Utils::BoolAspect enableCopilot{this};
};

class CopilotProjectSettings : public Utils::AspectContainer
{
public:
    CopilotProjectSettings(ProjectExplorer::Project *project, QObject *parent = nullptr);

    void save(ProjectExplorer::Project *project);
    void setUseGlobalSettings(bool useGlobalSettings);

    bool isEnabled() const;

    Utils::BoolAspect enableCopilot{this};
    Utils::BoolAspect useGlobalSettings{this};
};

} // namespace Copilot