Debian Codegraph @

LspCpp/include/LibLsp/lsp/lsFormattingOptions.h

raw
1 #pragma once
2
3 #include "LibLsp/JsonRpc/serializer.h"
4
5 struct lsFormattingOptions
6 {
7 struct KeyData
8 {
9 optional<bool> _boolean;
10 optional<int32_t> _integer;
11 optional<std::string> _string;
12 };
13
14 // Size of a tab in spaces.
15 int tabSize = 4;
16 // Prefer spaces over tabs.
17 bool insertSpaces = true;
18
19 /**
20 * Trim trailing whitespace on a line.
21 *
22 * @since 3.15.0
23 */
24 optional<bool> trimTrailingWhitespace;
25
26 /**
27 * Insert a newline character at the end of the file if one does not exist.
28 *
29 * @since 3.15.0
30 */
31 optional<bool> insertFinalNewline;
32
33 /**
34 * Trim all newlines after the final newline at the end of the file.
35 *
36 * @since 3.15.0
37 */
38 optional<bool> trimFinalNewlines;
39 optional<KeyData> key;
40 MAKE_SWAP_METHOD(
41 lsFormattingOptions, tabSize, insertSpaces, trimTrailingWhitespace, insertFinalNewline, trimFinalNewlines, key
42 )
43 };
44 MAKE_REFLECT_STRUCT(
45 lsFormattingOptions, tabSize, insertSpaces, trimTrailingWhitespace, insertFinalNewline, trimFinalNewlines, key
46 );
47
48 extern void Reflect(Reader& visitor, lsFormattingOptions::KeyData& value);
49 extern void Reflect(Writer& visitor, lsFormattingOptions::KeyData& value);