1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef ENVIRONMENT_H
6#define ENVIRONMENT_H
7
8#include <common/type/menuext.h>
9#include <QProcessEnvironment>
10#include <optional>
11
12namespace environment {
13namespace language {
14
15enum Category{User,System};
16enum Kit{Python};
17
18struct Version final
19{
20 std::optional<int> major;
21 std::optional<int> minor;
22 std::optional<int> revision;
23 std::optional<int> build;
24 Version();
25 Version(int major);
26 Version(const Version &version);
27 Version &operator = (const Version &version);
28};
29
30struct Program final
31{
32 std::optional<QString> path;
33 Version version;
34 std::optional<QString> binsPath;
35 std::optional<QString> pkgsPath;
36};
37
38Version completion(Category category, Kit kit, const Version &version);
39Program search(Category category, Kit kit, const Version& version);
40QProcessEnvironment get(Category category, Kit kit, const Version& version);
41}namespace lang = language;
42
43namespace package {
44enum_def(Category, QString)
45{
46 enum_exp clangd = "clangd";
47 enum_exp jdtls = "jdt-language-server";
48};
49namespace native {
50QString path(const Category::type_value &category = "");
51bool installed();
52} // native
53} namespace pkg = package;
54
55}namespace env = environment;
56
57
58#endif // ENVIRONMENT_H
59