File: lsFormattingOptions.h

package info (click to toggle)
asymptote 3.02%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 33,400 kB
  • sloc: cpp: 172,516; ansic: 69,728; python: 14,967; sh: 5,599; javascript: 4,866; lisp: 1,507; perl: 1,417; makefile: 1,028; yacc: 610; lex: 449; xml: 182; asm: 8
file content (49 lines) | stat: -rw-r--r-- 1,337 bytes parent folder | download | duplicates (2)
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
#pragma once

#include "LibLsp/JsonRpc/serializer.h"

struct lsFormattingOptions
{
    struct KeyData
    {
        optional<bool> _boolean;
        optional<int32_t> _integer;
        optional<std::string> _string;
    };

    // Size of a tab in spaces.
    int tabSize = 4;
    // Prefer spaces over tabs.
    bool insertSpaces = true;

    /**
                 * Trim trailing whitespace on a line.
                 *
                 * @since 3.15.0
                 */
    optional<bool> trimTrailingWhitespace;

    /**
         * Insert a newline character at the end of the file if one does not exist.
         *
         * @since 3.15.0
         */
    optional<bool> insertFinalNewline;

    /**
         * Trim all newlines after the final newline at the end of the file.
         *
         * @since 3.15.0
         */
    optional<bool> trimFinalNewlines;
    optional<KeyData> key;
    MAKE_SWAP_METHOD(
        lsFormattingOptions, tabSize, insertSpaces, trimTrailingWhitespace, insertFinalNewline, trimFinalNewlines, key
    )
};
MAKE_REFLECT_STRUCT(
    lsFormattingOptions, tabSize, insertSpaces, trimTrailingWhitespace, insertFinalNewline, trimFinalNewlines, key
);

extern void Reflect(Reader& visitor, lsFormattingOptions::KeyData& value);
extern void Reflect(Writer& visitor, lsFormattingOptions::KeyData& value);