Debian Codegraph @

LspCpp/include/LibLsp/lsp/textDocument/selectionRange.h

raw
1 #pragma once
2
3 #include "LibLsp/JsonRpc/RequestInMessage.h"
4 #include "LibLsp/JsonRpc/lsResponseMessage.h"
5
6 #include "LibLsp/lsp/lsPosition.h"
7 #include "LibLsp/lsp/lsTextDocumentIdentifier.h"
8
9 struct SelectionRangeParams
10 {
11 /**
12 * The text document.
13 */
14
15 lsTextDocumentIdentifier textDocument;
16
17 /**
18 * The positions inside the text document.
19 */
20
21 std::vector<lsPosition> positions;
22
23 MAKE_SWAP_METHOD(SelectionRangeParams, textDocument, positions)
24 };
25 MAKE_REFLECT_STRUCT(SelectionRangeParams, textDocument, positions)
26
27 struct SelectionRange
28 {
29 /**
30 * The [range](#Range) of this selection range.
31 */
32
33 lsRange range;
34
35 /**
36 * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
37 */
38 optional<SelectionRange*> parent;
39 MAKE_SWAP_METHOD(SelectionRange, range, parent)
40 };
41
42 extern void Reflect(Reader& visitor, optional<SelectionRange*>& value);
43 extern void Reflect(Writer& visitor, SelectionRange* value);
44
45 MAKE_REFLECT_STRUCT(SelectionRange, range, parent)
46 /**
47 * The {@code textDocument/selectionRange} request is sent from the client to the server to return
48 * suggested selection ranges at an array of given positions. A selection range is a range around
49 * the cursor position which the user might be interested in selecting.
50 */
51 DEFINE_REQUEST_RESPONSE_TYPE(
52 td_selectionRange, SelectionRangeParams, std::vector<SelectionRange>, "textDocument/selectionRange"
53 );