| 220 | } |
| 221 | |
| 222 | QJsonObject initialize(const QString &workspaceFolder, const QString &language, const QString &compile) |
| 223 | { |
| 224 | QJsonObject params; |
| 225 | if (language == C_CPP) { |
| 226 | QJsonObject capabilitiesSemanticTokens { { { "dynamicRegistration", true }, |
| 227 | { "formats", QJsonArray { "relative" } }, |
| 228 | { "multilineTokenSupport", false }, |
| 229 | { "overlappingTokenSupport", false }, |
| 230 | { "requests", QJsonArray { "full", QJsonObject { { "delta", true } }, QJsonObject { { "range", true } } } }, |
| 231 | { "tokenModifiers", tokenModifiers() }, |
| 232 | { "tokenTypes", tokenTypes() } } }; |
| 233 | |
| 234 | QJsonObject capabilities { |
| 235 | { K_TEXTDOCUMENT, QJsonObject { { "documentLink", QJsonObject { { "dynamicRegistration", true } } }, { "documentHighlight", QJsonObject { { "dynamicRegistration", true } } }, { |
| 236 | K_DOCUMENTSYMBOL, |
| 237 | QJsonObject { { K_HIERARCHICALDOCUMENTSYMBOLSUPPORT, true } }, |
| 238 | }, |
| 239 | { K_PUBLISHDIAGNOSTICS, QJsonObject { { K_CATEGORYSUPPORT, true }, { K_CODEACTIONSINLINE, true } } }, |
| 240 | { "inactiveRegionsCapabilities", QJsonObject { { "inactiveRegions", true } } }, |
| 241 | { "definition", QJsonObject { { { "dynamicRegistration", true }, { "linkSupport", true } } } }, |
| 242 | { "colorProvider", QJsonObject { { "dynamicRegistration", true } } }, |
| 243 | { "declaration", QJsonObject { { "dynamicRegistration", true }, { "linkSupport", true } } }, |
| 244 | { "semanticHighlightingCapabilities", QJsonObject { { "semanticHighlighting", true } } }, |
| 245 | { "semanticTokens", capabilitiesSemanticTokens }, |
| 246 | { "hover", QJsonObject { { "contentFormat", QJsonArray { "markdown", "plaintext" } } } }, |
| 247 | { "completion", QJsonObject { { "editsNearCursor", true } } } } }, |
| 248 | { "workspace", workspace() }, |
| 249 | { |
| 250 | "foldingRangeProvider", |
| 251 | true, |
| 252 | } |
| 253 | }; |
| 254 | |
| 255 | QJsonObject highlight { |
| 256 | { "largeFileSize", 2097152 }, |
| 257 | { "lsRanges", false }, |
| 258 | { "blacklist", QJsonArray() }, |
| 259 | { "whitelist", QJsonArray() } |
| 260 | }; |
| 261 | |
| 262 | QJsonObject client { |
| 263 | { "diagnosticsRelatedInformation", true }, |
| 264 | { "hierarchicalDocumentSymbolSupport", true }, |
| 265 | { "linkSupport", true }, |
| 266 | { "snippetSupport", true }, |
| 267 | }; |
| 268 | |
| 269 | QJsonObject workspace { |
| 270 | { "name", QFileInfo(workspaceFolder).fileName() }, |
| 271 | { K_URI, QUrl::fromLocalFile(workspaceFolder).toString() } |
| 272 | }; |
| 273 | |
| 274 | QJsonArray workspaceFolders { workspace }; |
| 275 | |
| 276 | QJsonObject initializationOptions { |
| 277 | { "compilationDatabasePath", compile } |
| 278 | }; |
| 279 |
no test coverage detected