1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef EXTENDEDPROJECT_H
6#define EXTENDEDPROJECT_H
7
8#include <QJsonObject>
9#include <string>
10
11namespace newlsp
12{
13
14inline const std::string Cxx{"C/C++"};
15inline const std::string Java{"Java"};
16inline const std::string Python{"Python"};
17inline const std::string JS{"JS"};
18
19inline const std::string language{"language"};
20inline const std::string workspace{"workspace"};
21
22inline const std::string lauchLspServer{"lanuchLspServer"};
23inline const std::string selectLspServer{"selectLspServer"};
24
25struct ProjectKey
26{
27 std::string language;
28 std::string workspace;
29 ProjectKey();
30 ProjectKey(const std::string &language, const std::string &workspace);
31 ProjectKey(const ProjectKey &other);
32 bool isValid() const { return !workspace.empty() && !language.empty();}
33 bool operator == (const ProjectKey &other) {
34 return language == other.language
35 && workspace == other.workspace;
36 }
37};
38
39uint qHash(const ProjectKey &key, uint seed = 0);
40bool operator == (const ProjectKey &t1, const ProjectKey &t2);
41std::string toJsonValueStr(const ProjectKey &val);
42QJsonObject toQJsonObject(const ProjectKey &val);
43
44/* request */
45struct LanuchLspServerParams
46{
47 ProjectKey projectKey;
48};
49std::string toJsonValueStr(const LanuchLspServerParams &val);
50
51/* notification */
52struct SelectLspServerParams
53{
54 ProjectKey projectKey;
55};
56std::string toJsonValueStr(const SelectLspServerParams &val);
57
58} // namesapce newlsp
59
60#endif // EXTENDEDPROJECT_H
61