| 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 | |
| 11 | namespace newlsp |
| 12 | { |
| 13 | |
| 14 | inline const std::string Cxx{"C/C++"}; |
| 15 | inline const std::string Java{"Java"}; |
| 16 | inline const std::string Python{"Python"}; |
| 17 | inline const std::string JS{"JS"}; |
| 18 | |
| 19 | inline const std::string language{"language"}; |
| 20 | inline const std::string workspace{"workspace"}; |
| 21 | |
| 22 | inline const std::string lauchLspServer{"lanuchLspServer"}; |
| 23 | inline const std::string selectLspServer{"selectLspServer"}; |
| 24 | |
| 25 | struct 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 | |
| 39 | uint qHash(const ProjectKey &key, uint seed = 0); |
| 40 | bool operator == (const ProjectKey &t1, const ProjectKey &t2); |
| 41 | std::string toJsonValueStr(const ProjectKey &val); |
| 42 | QJsonObject toQJsonObject(const ProjectKey &val); |
| 43 | |
| 44 | /* request */ |
| 45 | struct LanuchLspServerParams |
| 46 | { |
| 47 | ProjectKey projectKey; |
| 48 | }; |
| 49 | std::string toJsonValueStr(const LanuchLspServerParams &val); |
| 50 | |
| 51 | /* notification */ |
| 52 | struct SelectLspServerParams |
| 53 | { |
| 54 | ProjectKey projectKey; |
| 55 | }; |
| 56 | std::string toJsonValueStr(const SelectLspServerParams &val); |
| 57 | |
| 58 | } // namesapce newlsp |
| 59 | |
| 60 | #endif // EXTENDEDPROJECT_H |
| 61 |