| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "LibLsp/JsonRpc/RequestInMessage.h" |
| 4 |
#include "LibLsp/JsonRpc/lsResponseMessage.h" |
| 5 |
|
| 6 |
#include "document_symbol.h" |
| 7 |
#include "LibLsp/lsp/lsTextDocumentIdentifier.h" |
| 8 |
|
| 9 |
struct FoldingRangeRequestParams |
| 10 |
{ |
| 11 |
/** |
| 12 |
* The text document. |
| 13 |
*/ |
| 14 |
|
| 15 |
lsTextDocumentIdentifier textDocument; |
| 16 |
MAKE_SWAP_METHOD(FoldingRangeRequestParams, textDocument) |
| 17 |
}; |
| 18 |
MAKE_REFLECT_STRUCT(FoldingRangeRequestParams, textDocument) |
| 19 |
|
| 20 |
struct FoldingRange |
| 21 |
{ |
| 22 |
/** |
| 23 |
* The zero-based line number from where the folded range starts. |
| 24 |
*/ |
| 25 |
int startLine; |
| 26 |
|
| 27 |
/** |
| 28 |
* The zero-based line number where the folded range ends. |
| 29 |
*/ |
| 30 |
int endLine; |
| 31 |
|
| 32 |
/** |
| 33 |
* The zero-based character offset from where the folded range starts. If not defined, defaults |
| 34 |
* to the length of the start line. |
| 35 |
*/ |
| 36 |
int startCharacter; |
| 37 |
|
| 38 |
/** |
| 39 |
* The zero-based character offset before the folded range ends. If not defined, defaults to the |
| 40 |
* length of the end line. |
| 41 |
*/ |
| 42 |
int endCharacter; |
| 43 |
|
| 44 |
/** |
| 45 |
* Describes the kind of the folding range such as `comment' or 'region'. The kind |
| 46 |
* is used to categorize folding ranges and used by commands like 'Fold all comments'. See |
| 47 |
* FoldingRangeKind for an enumeration of standardized kinds. |
| 48 |
*/ |
| 49 |
std::string kind; |
| 50 |
|
| 51 |
MAKE_SWAP_METHOD(FoldingRange, startLine, endLine, startCharacter, endCharacter, kind) |
| 52 |
}; |
| 53 |
MAKE_REFLECT_STRUCT(FoldingRange, startLine, endLine, startCharacter, endCharacter, kind) |
| 54 |
|
| 55 |
/** |
| 56 |
* The folding range request is sent from the client to the server to return all folding |
| 57 |
* ranges found in a given text document. |
| 58 |
*/ |
| 59 |
DEFINE_REQUEST_RESPONSE_TYPE( |
| 60 |
td_foldingRange, FoldingRangeRequestParams, std::vector<FoldingRange>, "textDocument/foldingRange" |
| 61 |
); |