File: willSave.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 (73 lines) | stat: -rw-r--r-- 2,096 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once

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

#include "LibLsp/lsp/lsTextDocumentIdentifier.h"

namespace WillSaveTextDocumentParams
{

/**
         * Represents reasons why a text document is saved.
         */
enum class TextDocumentSaveReason
{

    /**
                 * Manually triggered, e.g. by the user pressing save, by starting debugging,
                 * or by an API call.
                 */
    Manual = (1),

    /**
                 * Automatic after a delay.
                 */
    AfterDelay = (2),

    /**
                  * When the editor lost focus.
                  */
    FocusOut = (3)
};

struct Params
{
    /**
           * The document that will be saved.
           */
    lsTextDocumentIdentifier textDocument;

    /*
   * A reason why a text document is saved.
   */

    optional<TextDocumentSaveReason> reason;

    MAKE_SWAP_METHOD(Params, textDocument, reason);
};

}; // namespace WillSaveTextDocumentParams
MAKE_REFLECT_TYPE_PROXY(WillSaveTextDocumentParams::TextDocumentSaveReason);

MAKE_REFLECT_STRUCT(WillSaveTextDocumentParams::Params, textDocument, reason);

/**
 * The document save notification is sent from the client to the server when
 * the document for saved in the client.
 *
 * Registration Options: TextDocumentSaveRegistrationOptions
 */
DEFINE_NOTIFICATION_TYPE(td_willSave, WillSaveTextDocumentParams::Params, "textDocument/willSave");

/**
 * The document will save request is sent from the client to the server before the document is actually saved.
 * The request can return an array of TextEdits which will be applied to the text document before it is saved.
 * Please note that clients might drop results if computing the text edits took too long or if a server constantly fails on this request.
 * This is done to keep the save fast and reliable.
 *
 * Registration Options: TextDocumentRegistrationOptions
 */
DEFINE_REQUEST_RESPONSE_TYPE(
    td_willSaveWaitUntil, WillSaveTextDocumentParams::Params, std::vector<lsTextEdit>, "textDocument/willSaveWaitUntil"
);