| 1 |
#pragma once |
| 2 |
#include "LibLsp/lsp/method_type.h" |
| 3 |
|
| 4 |
#include <stdexcept> |
| 5 |
#include "LibLsp/JsonRpc/message.h" |
| 6 |
#include "LibLsp/lsp/lsDocumentUri.h" |
| 7 |
#include "LibLsp/lsp/lsAny.h" |
| 8 |
#include "LibLsp/lsp/extention/jdtls/searchSymbols.h" |
| 9 |
#include "lsWorkspaceClientCapabilites.h" |
| 10 |
#include "LibLsp/lsp/lsp_completion.h" |
| 11 |
#include "LibLsp/lsp/lsp_diagnostic.h" |
| 12 |
|
| 13 |
struct WorkDoneProgressOptions |
| 14 |
{ |
| 15 |
optional<bool> workDoneProgress; |
| 16 |
MAKE_SWAP_METHOD(WorkDoneProgressOptions, workDoneProgress); |
| 17 |
}; |
| 18 |
MAKE_REFLECT_STRUCT(WorkDoneProgressOptions, workDoneProgress); |
| 19 |
|
| 20 |
// Completion options. |
| 21 |
struct lsCompletionOptions : WorkDoneProgressOptions |
| 22 |
{ |
| 23 |
// The server provides support to resolve additional |
| 24 |
// information for a completion item. |
| 25 |
optional<bool> resolveProvider = false; |
| 26 |
|
| 27 |
// |
| 28 |
// Most tools trigger completion request automatically without explicitly requesting |
| 29 |
// it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user |
| 30 |
// starts to type an identifier. For example if the user types `c` in a JavaScript file |
| 31 |
// code complete will automatically pop up present `console` besides others as a |
| 32 |
// completion item. Characters that make up identifiers don't need to be listed here. |
| 33 |
// |
| 34 |
// If code complete should automatically be trigger on characters not being valid inside |
| 35 |
// an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. |
| 36 |
// |
| 37 |
// https://github.com/Microsoft/language-server-protocol/issues/138. |
| 38 |
optional<std::vector<std::string>> triggerCharacters; |
| 39 |
|
| 40 |
// |
| 41 |
// The list of all possible characters that commit a completion. This field can be used |
| 42 |
// if clients don't support individual commmit characters per completion item. See |
| 43 |
// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` |
| 44 |
// |
| 45 |
optional<std::vector<std::string>> allCommitCharacters; |
| 46 |
|
| 47 |
MAKE_SWAP_METHOD(lsCompletionOptions, workDoneProgress, resolveProvider, triggerCharacters, allCommitCharacters); |
| 48 |
}; |
| 49 |
MAKE_REFLECT_STRUCT(lsCompletionOptions, workDoneProgress, resolveProvider, triggerCharacters, allCommitCharacters); |
| 50 |
|
| 51 |
// Save options. |
| 52 |
struct lsSaveOptions |
| 53 |
{ |
| 54 |
// The client is supposed to include the content on save. |
| 55 |
bool includeText = false; |
| 56 |
void swap(lsSaveOptions& arg) noexcept |
| 57 |
{ |
| 58 |
auto temp = includeText; |
| 59 |
includeText = arg.includeText; |
| 60 |
arg.includeText = temp; |
| 61 |
} |
| 62 |
}; |
| 63 |
MAKE_REFLECT_STRUCT(lsSaveOptions, includeText); |
| 64 |
|
| 65 |
// Signature help options. |
| 66 |
struct lsSignatureHelpOptions : WorkDoneProgressOptions |
| 67 |
{ |
| 68 |
// The characters that trigger signature help automatically. |
| 69 |
// NOTE: If updating signature help tokens make sure to also update |
| 70 |
// WorkingFile::FindClosestCallNameInBuffer. |
| 71 |
std::vector<std::string> triggerCharacters; |
| 72 |
MAKE_SWAP_METHOD(lsSignatureHelpOptions, workDoneProgress, triggerCharacters); |
| 73 |
}; |
| 74 |
MAKE_REFLECT_STRUCT(lsSignatureHelpOptions, workDoneProgress, triggerCharacters); |
| 75 |
|
| 76 |
// Defines how the host (editor) should sync document changes to the language |
| 77 |
// server. |
| 78 |
enum class lsTextDocumentSyncKind |
| 79 |
{ |
| 80 |
// Documents should not be synced at all. |
| 81 |
None = 0, |
| 82 |
|
| 83 |
// Documents are synced by always sending the full content |
| 84 |
// of the document. |
| 85 |
Full = 1, |
| 86 |
|
| 87 |
// Documents are synced by sending the full content on open. |
| 88 |
// After that only incremental updates to the document are |
| 89 |
// send. |
| 90 |
Incremental = 2 |
| 91 |
}; |
| 92 |
|
| 93 |
#if _WIN32 |
| 94 |
MAKE_REFLECT_TYPE_PROXY(lsTextDocumentSyncKind) |
| 95 |
#else |
| 96 |
//#pragma clang diagnostic push |
| 97 |
//#pragma clang diagnostic ignored "-Wunused-function" |
| 98 |
MAKE_REFLECT_TYPE_PROXY(lsTextDocumentSyncKind) |
| 99 |
//#pragma clang diagnostic pop |
| 100 |
#endif |
| 101 |
|
| 102 |
struct lsTextDocumentSyncOptions |
| 103 |
{ |
| 104 |
// Open and close notifications are sent to the server. |
| 105 |
optional<bool> openClose; |
| 106 |
// Change notificatins are sent to the server. See TextDocumentSyncKind.None, |
| 107 |
// TextDocumentSyncKind.Full and TextDocumentSyncKindIncremental. |
| 108 |
optional<lsTextDocumentSyncKind> change; |
| 109 |
// Will save notifications are sent to the server. |
| 110 |
optional<bool> willSave; |
| 111 |
// Will save wait until requests are sent to the server. |
| 112 |
optional<bool> willSaveWaitUntil; |
| 113 |
// Save notifications are sent to the server. |
| 114 |
optional<lsSaveOptions> save; |
| 115 |
|
| 116 |
MAKE_SWAP_METHOD(lsTextDocumentSyncOptions, openClose, change, willSave, willSaveWaitUntil, save); |
| 117 |
}; |
| 118 |
MAKE_REFLECT_STRUCT(lsTextDocumentSyncOptions, openClose, change, willSave, willSaveWaitUntil, save); |
| 119 |
|
| 120 |
struct SynchronizationCapabilities |
| 121 |
{ |
| 122 |
// Whether text document synchronization supports dynamic registration. |
| 123 |
optional<bool> dynamicRegistration; |
| 124 |
|
| 125 |
// The client supports sending will save notifications. |
| 126 |
optional<bool> willSave; |
| 127 |
|
| 128 |
// The client supports sending a will save request and |
| 129 |
// waits for a response providing text edits which will |
| 130 |
// be applied to the document before it is saved. |
| 131 |
optional<bool> willSaveWaitUntil; |
| 132 |
|
| 133 |
// The client supports did save notifications. |
| 134 |
optional<bool> didSave; |
| 135 |
|
| 136 |
MAKE_SWAP_METHOD(SynchronizationCapabilities, dynamicRegistration, willSave, willSaveWaitUntil, didSave); |
| 137 |
}; |
| 138 |
MAKE_REFLECT_STRUCT(SynchronizationCapabilities, dynamicRegistration, willSave, willSaveWaitUntil, didSave); |
| 139 |
|
| 140 |
struct CompletionItemKindCapabilities |
| 141 |
{ |
| 142 |
optional<std::vector<lsCompletionItemKind>> valueSet; |
| 143 |
MAKE_SWAP_METHOD(CompletionItemKindCapabilities, valueSet); |
| 144 |
}; |
| 145 |
MAKE_REFLECT_STRUCT(CompletionItemKindCapabilities, valueSet); |
| 146 |
|
| 147 |
struct CompletionItemCapabilities |
| 148 |
{ |
| 149 |
// Client supports snippets as insert text. |
| 150 |
// |
| 151 |
// A snippet can define tab stops and placeholders with `$1`, `$2` |
| 152 |
// and `${3:foo}`. `$0` defines the final tab stop, it defaults to |
| 153 |
// the end of the snippet. Placeholders with equal identifiers are linked, |
| 154 |
// that is typing in one will update others too. |
| 155 |
optional<bool> snippetSupport; |
| 156 |
|
| 157 |
// Client supports commit characters on a completion item. |
| 158 |
|
| 159 |
optional<bool> commitCharactersSupport; |
| 160 |
|
| 161 |
// Client supports the following content formats for the documentation |
| 162 |
// property. The order describes the preferred format of the client. |
| 163 |
|
| 164 |
optional<std::vector<std::string>> documentationFormat; |
| 165 |
|
| 166 |
// Client supports the deprecated property on a completion item. |
| 167 |
|
| 168 |
optional<bool> deprecatedSupport; |
| 169 |
|
| 170 |
// |
| 171 |
// Client supports the preselect property on a completion item. |
| 172 |
// |
| 173 |
optional<bool> preselectSupport; |
| 174 |
|
| 175 |
MAKE_SWAP_METHOD( |
| 176 |
CompletionItemCapabilities, snippetSupport, commitCharactersSupport, documentationFormat, deprecatedSupport, |
| 177 |
preselectSupport |
| 178 |
); |
| 179 |
}; |
| 180 |
MAKE_REFLECT_STRUCT( |
| 181 |
CompletionItemCapabilities, snippetSupport, commitCharactersSupport, documentationFormat, deprecatedSupport, |
| 182 |
preselectSupport |
| 183 |
); |
| 184 |
|
| 185 |
// |
| 186 |
// Capabilities specific to the `textDocument/completion` |
| 187 |
// |
| 188 |
struct CompletionCapabilities |
| 189 |
{ |
| 190 |
// Whether completion supports dynamic registration. |
| 191 |
optional<bool> dynamicRegistration; |
| 192 |
|
| 193 |
// The client supports the following `CompletionItem` specific |
| 194 |
// capabilities. |
| 195 |
optional<CompletionItemCapabilities> completionItem; |
| 196 |
|
| 197 |
// |
| 198 |
// The client supports the following `CompletionItemKind` specific |
| 199 |
// capabilities. |
| 200 |
// |
| 201 |
optional<CompletionItemKindCapabilities> completionItemKind; |
| 202 |
|
| 203 |
// |
| 204 |
// The client supports sending additional context information for a |
| 205 |
// `textDocument/completion` request. |
| 206 |
// |
| 207 |
optional<bool> contextSupport; |
| 208 |
|
| 209 |
MAKE_SWAP_METHOD(CompletionCapabilities, dynamicRegistration, completionItem, completionItemKind); |
| 210 |
}; |
| 211 |
|
| 212 |
MAKE_REFLECT_STRUCT(CompletionCapabilities, dynamicRegistration, completionItem, completionItemKind); |
| 213 |
|
| 214 |
struct HoverCapabilities : public DynamicRegistrationCapabilities |
| 215 |
{ |
| 216 |
// |
| 217 |
// Client supports the following content formats for the content |
| 218 |
// property. The order describes the preferred format of the client. |
| 219 |
// |
| 220 |
// See {@link MarkupKind} for allowed values. |
| 221 |
// |
| 222 |
optional<std::vector<std::string>> contentFormat; |
| 223 |
|
| 224 |
MAKE_SWAP_METHOD(HoverCapabilities, dynamicRegistration, contentFormat); |
| 225 |
}; |
| 226 |
MAKE_REFLECT_STRUCT(HoverCapabilities, dynamicRegistration, contentFormat); |
| 227 |
|
| 228 |
// |
| 229 |
// Client capabilities specific to parameter information. |
| 230 |
// |
| 231 |
struct ParameterInformationCapabilities |
| 232 |
{ |
| 233 |
// |
| 234 |
// The client supports processing label offsets instead of a |
| 235 |
// simple label string. |
| 236 |
// |
| 237 |
// Since 3.14.0 |
| 238 |
// |
| 239 |
optional<bool> labelOffsetSupport; |
| 240 |
|
| 241 |
MAKE_SWAP_METHOD(ParameterInformationCapabilities, labelOffsetSupport); |
| 242 |
}; |
| 243 |
MAKE_REFLECT_STRUCT(ParameterInformationCapabilities, labelOffsetSupport) |
| 244 |
|
| 245 |
struct SignatureInformationCapabilities |
| 246 |
{ |
| 247 |
// |
| 248 |
// Client supports the following content formats for the documentation |
| 249 |
// property. The order describes the preferred format of the client. |
| 250 |
// |
| 251 |
// See {@link MarkupKind} for allowed values. |
| 252 |
// |
| 253 |
std::vector<std::string> documentationFormat; |
| 254 |
|
| 255 |
// |
| 256 |
// Client capabilities specific to parameter information. |
| 257 |
// |
| 258 |
ParameterInformationCapabilities parameterInformation; |
| 259 |
|
| 260 |
MAKE_SWAP_METHOD(SignatureInformationCapabilities, documentationFormat, parameterInformation) |
| 261 |
}; |
| 262 |
MAKE_REFLECT_STRUCT(SignatureInformationCapabilities, documentationFormat, parameterInformation) |
| 263 |
|
| 264 |
struct SignatureHelpCapabilities : public DynamicRegistrationCapabilities |
| 265 |
{ |
| 266 |
// |
| 267 |
// The client supports the following `SignatureInformation` |
| 268 |
// specific properties. |
| 269 |
// |
| 270 |
optional<SignatureInformationCapabilities> signatureInformation; |
| 271 |
|
| 272 |
MAKE_SWAP_METHOD(SignatureHelpCapabilities, dynamicRegistration, signatureInformation) |
| 273 |
}; |
| 274 |
MAKE_REFLECT_STRUCT(SignatureHelpCapabilities, dynamicRegistration, signatureInformation) |
| 275 |
|
| 276 |
struct DocumentSymbolCapabilities : public DynamicRegistrationCapabilities |
| 277 |
{ |
| 278 |
// |
| 279 |
// Specific capabilities for the `SymbolKind`. |
| 280 |
// |
| 281 |
optional<SymbolKindCapabilities> symbolKind; |
| 282 |
|
| 283 |
// |
| 284 |
// The client support hierarchical document symbols. |
| 285 |
// |
| 286 |
optional<bool> hierarchicalDocumentSymbolSupport; |
| 287 |
|
| 288 |
MAKE_SWAP_METHOD(DocumentSymbolCapabilities, dynamicRegistration, symbolKind, hierarchicalDocumentSymbolSupport) |
| 289 |
}; |
| 290 |
MAKE_REFLECT_STRUCT(DocumentSymbolCapabilities, dynamicRegistration, symbolKind, hierarchicalDocumentSymbolSupport) |
| 291 |
|
| 292 |
struct DeclarationCapabilities : public DynamicRegistrationCapabilities |
| 293 |
{ |
| 294 |
// |
| 295 |
// The client supports additional metadata in the form of declaration links. |
| 296 |
// |
| 297 |
optional<bool> linkSupport; |
| 298 |
|
| 299 |
MAKE_SWAP_METHOD(DeclarationCapabilities, dynamicRegistration, linkSupport); |
| 300 |
}; |
| 301 |
MAKE_REFLECT_STRUCT(DeclarationCapabilities, dynamicRegistration, linkSupport) |
| 302 |
|
| 303 |
struct CodeActionKindCapabilities |
| 304 |
{ |
| 305 |
// |
| 306 |
// The code action kind values the client supports. When this |
| 307 |
// property exists the client also guarantees that it will |
| 308 |
// handle values outside its set gracefully and falls back |
| 309 |
// to a default value when unknown. |
| 310 |
// |
| 311 |
// See {@link CodeActionKind} for allowed values. |
| 312 |
// |
| 313 |
optional<std::vector<std::string>> valueSet; |
| 314 |
|
| 315 |
MAKE_SWAP_METHOD(CodeActionKindCapabilities, valueSet) |
| 316 |
}; |
| 317 |
MAKE_REFLECT_STRUCT(CodeActionKindCapabilities, valueSet) |
| 318 |
|
| 319 |
struct CodeActionLiteralSupportCapabilities |
| 320 |
{ |
| 321 |
optional<CodeActionKindCapabilities> codeActionKind; |
| 322 |
|
| 323 |
MAKE_SWAP_METHOD(CodeActionLiteralSupportCapabilities, codeActionKind) |
| 324 |
}; |
| 325 |
MAKE_REFLECT_STRUCT(CodeActionLiteralSupportCapabilities, codeActionKind) |
| 326 |
|
| 327 |
struct CodeActionCapabilities : public DynamicRegistrationCapabilities |
| 328 |
{ |
| 329 |
// |
| 330 |
// The client support code action literals as a valid |
| 331 |
// response of the `textDocument/codeAction` request. |
| 332 |
// |
| 333 |
optional<CodeActionLiteralSupportCapabilities> codeActionLiteralSupport; |
| 334 |
|
| 335 |
MAKE_SWAP_METHOD(CodeActionCapabilities, dynamicRegistration, codeActionLiteralSupport) |
| 336 |
}; |
| 337 |
MAKE_REFLECT_STRUCT(CodeActionCapabilities, dynamicRegistration, codeActionLiteralSupport) |
| 338 |
|
| 339 |
struct RenameCapabilities : public DynamicRegistrationCapabilities |
| 340 |
{ |
| 341 |
// |
| 342 |
// The client support code action literals as a valid |
| 343 |
// response of the `textDocument/codeAction` request. |
| 344 |
// |
| 345 |
optional<bool> prepareSupport; |
| 346 |
|
| 347 |
MAKE_SWAP_METHOD(RenameCapabilities, dynamicRegistration, prepareSupport) |
| 348 |
}; |
| 349 |
MAKE_REFLECT_STRUCT(RenameCapabilities, dynamicRegistration, prepareSupport) |
| 350 |
|
| 351 |
struct DiagnosticsTagSupport |
| 352 |
{ |
| 353 |
/** |
| 354 |
* The tags supported by the client. |
| 355 |
*/ |
| 356 |
std::vector<DiagnosticTag> valueSet; |
| 357 |
MAKE_SWAP_METHOD(DiagnosticsTagSupport, valueSet) |
| 358 |
}; |
| 359 |
MAKE_REFLECT_STRUCT(DiagnosticsTagSupport, valueSet) |
| 360 |
|
| 361 |
struct PublishDiagnosticsClientCapabilities : public DynamicRegistrationCapabilities |
| 362 |
{ |
| 363 |
/** |
| 364 |
* The client support code action literals as a valid |
| 365 |
* response of the `textDocument/codeAction` request. |
| 366 |
*/ |
| 367 |
optional<bool> relatedInformation; |
| 368 |
|
| 369 |
/** |
| 370 |
* Client supports the tag property to provide meta data about a diagnostic. |
| 371 |
* Clients supporting tags have to handle unknown tags gracefully. |
| 372 |
* |
| 373 |
* This property had been added and implemented as boolean before it was |
| 374 |
* added to the specification as {@link DiagnosticsTagSupport}. In order to |
| 375 |
* keep this implementation compatible with intermediate clients (including |
| 376 |
* vscode-language-client < 6.0.0) we add an either type here. |
| 377 |
* |
| 378 |
* Since 3.15 |
| 379 |
*/ |
| 380 |
optional<std::pair<optional<bool>, optional<DiagnosticsTagSupport>>> tagSupport; |
| 381 |
|
| 382 |
/** |
| 383 |
* Whether the client interprets the version property of the |
| 384 |
* `textDocument/publishDiagnostics` notification's parameter. |
| 385 |
* |
| 386 |
* Since 3.15.0 |
| 387 |
*/ |
| 388 |
optional<bool> versionSupport; |
| 389 |
|
| 390 |
/** |
| 391 |
* Client supports a codeDescription property |
| 392 |
* |
| 393 |
* @since 3.16.0 |
| 394 |
*/ |
| 395 |
optional<bool> codeDescriptionSupport; |
| 396 |
|
| 397 |
/** |
| 398 |
* Whether code action supports the `data` property which is |
| 399 |
* preserved between a `textDocument/publishDiagnostics` and |
| 400 |
* `textDocument/codeAction` request. |
| 401 |
* |
| 402 |
* @since 3.16.0 |
| 403 |
*/ |
| 404 |
optional<bool> dataSupport; |
| 405 |
|
| 406 |
MAKE_SWAP_METHOD( |
| 407 |
PublishDiagnosticsClientCapabilities, dynamicRegistration, relatedInformation, tagSupport, versionSupport, |
| 408 |
codeDescriptionSupport, dataSupport |
| 409 |
) |
| 410 |
}; |
| 411 |
MAKE_REFLECT_STRUCT( |
| 412 |
PublishDiagnosticsClientCapabilities, dynamicRegistration, relatedInformation, tagSupport, versionSupport, |
| 413 |
codeDescriptionSupport, dataSupport |
| 414 |
) |
| 415 |
|
| 416 |
struct FoldingRangeCapabilities : public DynamicRegistrationCapabilities |
| 417 |
{ |
| 418 |
// |
| 419 |
// The maximum number of folding ranges that the client prefers to receive per document. The value serves as a |
| 420 |
// hint, servers are free to follow the limit. |
| 421 |
// |
| 422 |
optional<int> rangeLimit; |
| 423 |
|
| 424 |
// |
| 425 |
// If set, the client signals that it only supports folding complete lines. If set, client will |
| 426 |
// ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange. |
| 427 |
// |
| 428 |
optional<bool> lineFoldingOnly; |
| 429 |
MAKE_SWAP_METHOD(FoldingRangeCapabilities, dynamicRegistration, rangeLimit, lineFoldingOnly) |
| 430 |
}; |
| 431 |
MAKE_REFLECT_STRUCT(FoldingRangeCapabilities, dynamicRegistration, rangeLimit, lineFoldingOnly) |
| 432 |
|
| 433 |
struct SemanticHighlightingCapabilities : public DynamicRegistrationCapabilities |
| 434 |
{ |
| 435 |
// |
| 436 |
// The client support code action literals as a valid |
| 437 |
// response of the `textDocument/codeAction` request. |
| 438 |
// |
| 439 |
optional<bool> semanticHighlighting; |
| 440 |
|
| 441 |
MAKE_SWAP_METHOD(SemanticHighlightingCapabilities, dynamicRegistration, semanticHighlighting) |
| 442 |
}; |
| 443 |
MAKE_REFLECT_STRUCT(SemanticHighlightingCapabilities, dynamicRegistration, semanticHighlighting) |
| 444 |
|
| 445 |
struct SemanticTokensClientCapabilitiesRequestsFull |
| 446 |
{ |
| 447 |
|
| 448 |
// |
| 449 |
// The client will send the `textDocument/semanticTokens/full/delta` request if |
| 450 |
// the server provides a corresponding handler. |
| 451 |
// |
| 452 |
bool delta = false; |
| 453 |
MAKE_SWAP_METHOD(SemanticTokensClientCapabilitiesRequestsFull, delta) |
| 454 |
}; |
| 455 |
MAKE_REFLECT_STRUCT(SemanticTokensClientCapabilitiesRequestsFull, delta) |
| 456 |
|
| 457 |
struct SemanticTokensClientCapabilities : public DynamicRegistrationCapabilities |
| 458 |
{ |
| 459 |
//export TokenFormat = 'relative'; |
| 460 |
struct lsRequests |
| 461 |
{ |
| 462 |
// |
| 463 |
// The client will send the `textDocument/semanticTokens/range` request |
| 464 |
// if the server provides a corresponding handler. |
| 465 |
// |
| 466 |
optional<std::pair<optional<bool>, optional<SemanticTokensClientCapabilitiesRequestsFull>>> range; |
| 467 |
// |
| 468 |
// The client will send the `textDocument/semanticTokens/full` request |
| 469 |
// if the server provides a corresponding handler. |
| 470 |
// |
| 471 |
optional<std::pair<optional<bool>, optional<lsp::Any>>> full; |
| 472 |
MAKE_SWAP_METHOD(lsRequests, range, full) |
| 473 |
}; |
| 474 |
|
| 475 |
lsRequests requests; |
| 476 |
// |
| 477 |
// The token types that the client supports. |
| 478 |
// |
| 479 |
std::vector<std::string> tokenTypes; |
| 480 |
|
| 481 |
// |
| 482 |
// The token modifiers that the client supports. |
| 483 |
// |
| 484 |
std::vector<std::string> tokenModifiers; |
| 485 |
// |
| 486 |
// The formats the clients supports. |
| 487 |
// |
| 488 |
std::vector<std::string> formats; |
| 489 |
// |
| 490 |
// Whether the client supports tokens that can overlap each other. |
| 491 |
// |
| 492 |
optional<bool> overlappingTokenSupport; |
| 493 |
|
| 494 |
// |
| 495 |
// Whether the client supports tokens that can span multiple lines. |
| 496 |
// |
| 497 |
optional<bool> multilineTokenSupport; |
| 498 |
|
| 499 |
MAKE_SWAP_METHOD( |
| 500 |
SemanticTokensClientCapabilities, dynamicRegistration, requests, tokenTypes, tokenModifiers, formats, |
| 501 |
overlappingTokenSupport, multilineTokenSupport |
| 502 |
) |
| 503 |
}; |
| 504 |
MAKE_REFLECT_STRUCT(SemanticTokensClientCapabilities::lsRequests, range, full) |
| 505 |
MAKE_REFLECT_STRUCT( |
| 506 |
SemanticTokensClientCapabilities, dynamicRegistration, requests, tokenTypes, tokenModifiers, formats, |
| 507 |
overlappingTokenSupport, multilineTokenSupport |
| 508 |
) |
| 509 |
|
| 510 |
// Text document specific client capabilities. |
| 511 |
struct lsTextDocumentClientCapabilities |
| 512 |
{ |
| 513 |
|
| 514 |
SynchronizationCapabilities synchronization; |
| 515 |
|
| 516 |
// Capabilities specific to the `textDocument/completion` |
| 517 |
optional<CompletionCapabilities> completion; |
| 518 |
|
| 519 |
// Capabilities specific to the `textDocument/hover` |
| 520 |
optional<HoverCapabilities> hover; |
| 521 |
|
| 522 |
// Capabilities specific to the `textDocument/signatureHelp` |
| 523 |
optional<SignatureHelpCapabilities> signatureHelp; |
| 524 |
|
| 525 |
// Capabilities specific to the `textDocument/references` |
| 526 |
optional<DynamicRegistrationCapabilities> references; |
| 527 |
|
| 528 |
// Capabilities specific to the `textDocument/documentHighlight` |
| 529 |
optional<DynamicRegistrationCapabilities> documentHighlight; |
| 530 |
|
| 531 |
// Capabilities specific to the `textDocument/documentSymbol` |
| 532 |
optional<DocumentSymbolCapabilities> documentSymbol; |
| 533 |
|
| 534 |
// Capabilities specific to the `textDocument/formatting` |
| 535 |
optional<DynamicRegistrationCapabilities> formatting; |
| 536 |
|
| 537 |
// Capabilities specific to the `textDocument/rangeFormatting` |
| 538 |
optional<DynamicRegistrationCapabilities> rangeFormatting; |
| 539 |
|
| 540 |
// Capabilities specific to the `textDocument/onTypeFormatting` |
| 541 |
optional<DynamicRegistrationCapabilities> onTypeFormatting; |
| 542 |
|
| 543 |
// |
| 544 |
// Capabilities specific to the `textDocument/declaration` |
| 545 |
// |
| 546 |
// Since 3.14.0 |
| 547 |
// |
| 548 |
optional<DeclarationCapabilities> declaration; |
| 549 |
|
| 550 |
typedef DeclarationCapabilities DefinitionCapabilities; |
| 551 |
// Capabilities specific to the `textDocument/definition` |
| 552 |
optional<DefinitionCapabilities> definition; |
| 553 |
|
| 554 |
// |
| 555 |
// Capabilities specific to the `textDocument/typeDefinition` |
| 556 |
// |
| 557 |
// Since 3.6.0 |
| 558 |
// |
| 559 |
typedef DeclarationCapabilities TypeDefinitionCapabilities; |
| 560 |
optional<TypeDefinitionCapabilities> typeDefinition; |
| 561 |
|
| 562 |
typedef DeclarationCapabilities ImplementationCapabilities; |
| 563 |
// Capabilities specific to the `textDocument/implementation` |
| 564 |
optional<ImplementationCapabilities> implementation; |
| 565 |
|
| 566 |
// Capabilities specific to the `textDocument/codeAction` |
| 567 |
optional<CodeActionCapabilities> codeAction; |
| 568 |
|
| 569 |
// Capabilities specific to the `textDocument/codeLens` |
| 570 |
optional<DynamicRegistrationCapabilities> codeLens; |
| 571 |
|
| 572 |
// Capabilities specific to the `textDocument/documentLink` |
| 573 |
optional<DynamicRegistrationCapabilities> documentLink; |
| 574 |
|
| 575 |
// |
| 576 |
// Capabilities specific to the `textDocument/documentColor` and the |
| 577 |
// `textDocument/colorPresentation` request. |
| 578 |
// |
| 579 |
// Since 3.6.0 |
| 580 |
// |
| 581 |
optional<DynamicRegistrationCapabilities> colorProvider; |
| 582 |
|
| 583 |
// Capabilities specific to the `textDocument/rename` |
| 584 |
optional<RenameCapabilities> rename; |
| 585 |
|
| 586 |
// |
| 587 |
// Capabilities specific to `textDocument/publishDiagnostics`. |
| 588 |
// |
| 589 |
optional<PublishDiagnosticsClientCapabilities> publishDiagnostics; |
| 590 |
|
| 591 |
// |
| 592 |
// Capabilities specific to `textDocument/foldingRange` requests. |
| 593 |
// |
| 594 |
// Since 3.10.0 |
| 595 |
// |
| 596 |
optional<FoldingRangeCapabilities> foldingRange; |
| 597 |
|
| 598 |
// |
| 599 |
// Capabilities specific to {@code textDocument/semanticHighlighting}. |
| 600 |
// |
| 601 |
optional<SemanticHighlightingCapabilities> semanticHighlightingCapabilities; |
| 602 |
|
| 603 |
// |
| 604 |
// Capabilities specific to {@code textDocument/typeHierarchy}. |
| 605 |
// |
| 606 |
optional<DynamicRegistrationCapabilities> typeHierarchyCapabilities; |
| 607 |
|
| 608 |
// |
| 609 |
// Capabilities specific to `textDocument/selectionRange` requests |
| 610 |
// |
| 611 |
|
| 612 |
optional<DynamicRegistrationCapabilities> selectionRange; |
| 613 |
|
| 614 |
// |
| 615 |
// Capabilities specific to the `textDocument/linkedEditingRange` request. |
| 616 |
// |
| 617 |
// @since 3.16.0 |
| 618 |
// |
| 619 |
optional<DynamicRegistrationCapabilities> linkedEditingRange; |
| 620 |
|
| 621 |
// |
| 622 |
// Capabilities specific to the various call hierarchy requests. |
| 623 |
// |
| 624 |
// @since 3.16.0 |
| 625 |
// |
| 626 |
optional<DynamicRegistrationCapabilities> callHierarchy; |
| 627 |
|
| 628 |
// |
| 629 |
// Capabilities specific to the various semantic token requests. |
| 630 |
// |
| 631 |
// @since 3.16.0 |
| 632 |
// |
| 633 |
optional<SemanticTokensClientCapabilities> semanticTokens; |
| 634 |
|
| 635 |
// |
| 636 |
// Capabilities specific to the `textDocument/moniker` request. |
| 637 |
// |
| 638 |
// @since 3.16.0 |
| 639 |
// |
| 640 |
optional<DynamicRegistrationCapabilities> moniker; |
| 641 |
|
| 642 |
// |
| 643 |
// Capabilities specific to the `textDocument/inlayHint` request. |
| 644 |
// |
| 645 |
// @since 3.17.0 |
| 646 |
// |
| 647 |
optional<InlayHintClientCapabilities> inlayHint; |
| 648 |
|
| 649 |
MAKE_SWAP_METHOD( |
| 650 |
lsTextDocumentClientCapabilities, synchronization, completion, hover, signatureHelp, implementation, references, |
| 651 |
documentHighlight, documentSymbol, formatting, rangeFormatting, onTypeFormatting, declaration, definition, |
| 652 |
typeDefinition, implementation, codeAction, codeLens, documentLink, colorProvider, rename, publishDiagnostics, |
| 653 |
foldingRange, semanticHighlightingCapabilities, typeHierarchyCapabilities, callHierarchy, selectionRange, |
| 654 |
linkedEditingRange, semanticTokens, moniker, inlayHint |
| 655 |
) |
| 656 |
}; |
| 657 |
|
| 658 |
MAKE_REFLECT_STRUCT( |
| 659 |
lsTextDocumentClientCapabilities, synchronization, completion, hover, signatureHelp, implementation, references, |
| 660 |
documentHighlight, documentSymbol, formatting, rangeFormatting, onTypeFormatting, declaration, definition, |
| 661 |
typeDefinition, implementation, codeAction, codeLens, documentLink, colorProvider, rename, publishDiagnostics, |
| 662 |
foldingRange, semanticHighlightingCapabilities, typeHierarchyCapabilities, callHierarchy, selectionRange, |
| 663 |
linkedEditingRange, semanticTokens, moniker, inlayHint |
| 664 |
) |