| 51 | } |
| 52 | |
| 53 | QString JavaParam::getLSPInitParam(const int requestId, |
| 54 | const int pid, |
| 55 | const QString &workspace, |
| 56 | const QString &jdkHome, |
| 57 | const QString &debugJar) |
| 58 | { |
| 59 | QString workspaceUrl = QUrl::fromLocalFile(workspace).toEncoded(); |
| 60 | QString param = R"({ |
| 61 | "jsonrpc": "2.0", |
| 62 | "id": )" + QString::number(requestId) + R"(, |
| 63 | "method": "initialize", |
| 64 | "params": { |
| 65 | "processId": )" + QString::number(pid) + R"(, |
| 66 | "clientInfo": { |
| 67 | "name": "Union Code", |
| 68 | "version": "1.0.0" |
| 69 | }, |
| 70 | "locale": "zh-cn", |
| 71 | "rootPath": ")" + workspaceUrl + R"(", |
| 72 | "rootUri": ")" + workspaceUrl + R"(", |
| 73 | "capabilities": { |
| 74 | |
| 75 | }, |
| 76 | "initializationOptions": { |
| 77 | "bundles": [ |
| 78 | ")" + debugJar + R"(" |
| 79 | ], |
| 80 | "workspaceFolders": [ |
| 81 | ")" + workspaceUrl + R"(" |
| 82 | ], |
| 83 | "settings": { |
| 84 | "java": { |
| 85 | "home": ")" + jdkHome + R"(", |
| 86 | "sources": { |
| 87 | "organizeImports": { |
| 88 | "starThreshold": 99, |
| 89 | "staticStarThreshold": 99 |
| 90 | } |
| 91 | }, |
| 92 | "import": { |
| 93 | "maven": { |
| 94 | "enabled": true, |
| 95 | "offline": { |
| 96 | "enabled": false |
| 97 | } |
| 98 | }, |
| 99 | "gradle": { |
| 100 | "enabled": true, |
| 101 | "wrapper": { |
| 102 | "enabled": true |
| 103 | }, |
| 104 | "version": null, |
| 105 | "home": null, |
| 106 | "java": { |
| 107 | "home": null |
| 108 | }, |
| 109 | "offline": { |
| 110 | "enabled": false |
no test coverage detected