summaryrefslogtreecommitdiff
path: root/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/foldingRange.h
blob: 27977a4517ba3b385be1d926757ed8ca57c256f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once


#include "LibLsp/JsonRpc/RequestInMessage.h"
#include "LibLsp/JsonRpc/lsResponseMessage.h"

#include "document_symbol.h"
#include "LibLsp/lsp/lsTextDocumentIdentifier.h"


struct FoldingRangeRequestParams {
	/**
	 * The text document.
	 */

	lsTextDocumentIdentifier textDocument;
	MAKE_SWAP_METHOD(FoldingRangeRequestParams, textDocument)
};
MAKE_REFLECT_STRUCT(FoldingRangeRequestParams, textDocument)


struct FoldingRange {
	/**
	 * The zero-based line number from where the folded range starts.
	 */
	 int startLine;

	/**
	 * The zero-based line number where the folded range ends.
	 */
	 int endLine;

	/**
	 * The zero-based character offset from where the folded range starts. If not defined, defaults
	 * to the length of the start line.
	 */
	 int startCharacter;

	/**
	 * The zero-based character offset before the folded range ends. If not defined, defaults to the
	 * length of the end line.
	 */
	 int endCharacter;

	/**
	 * Describes the kind of the folding range such as `comment' or 'region'. The kind
	 * is used to categorize folding ranges and used by commands like 'Fold all comments'. See
	 * FoldingRangeKind for an enumeration of standardized kinds.
	 */
	std::string kind;

	MAKE_SWAP_METHOD(FoldingRange, startLine, endLine, startCharacter, endCharacter, kind)
};
MAKE_REFLECT_STRUCT(FoldingRange,startLine,endLine,startCharacter,endCharacter,kind)


/**
 * The folding range request is sent from the client to the server to return all folding
 * ranges found in a given text document.
 */
DEFINE_REQUEST_RESPONSE_TYPE(td_foldingRange, FoldingRangeRequestParams, std::vector<FoldingRange>, "textDocument/foldingRange");