summaryrefslogtreecommitdiff
path: root/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/InitializeParams.h
blob: 145c63087f086ee1df90ab727a8b4b266c3b3b08 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#pragma once

#include "LibLsp/lsp/lsDocumentUri.h"
#include "LibLsp/lsp/lsAny.h"
#include "lsClientCapabilities.h"
#include "LibLsp/lsp/workspace/workspaceFolders.h"

struct ClientInfo {
        std::string name;
        optional<std::string> version;

        MAKE_SWAP_METHOD(ClientInfo,name,version);
};
MAKE_REFLECT_STRUCT(ClientInfo,name,version);

struct lsInitializeParams {
  // The process Id of the parent process that started
  // the server. Is null if the process has not been started by another process.
  // If the parent process is not alive then the server should exit (see exit
  // notification) its process.
  optional<int> processId;

  /**
   * Information about the client
   *
   * @since 3.15.0
   */
  optional<ClientInfo> clientInfo;
  /**
   * The locale the client is currently showing the user interface
   * in. This must not necessarily be the locale of the operating
   * system.
   *
   * Uses IETF language tags as the value's syntax
   * (See https://en.wikipedia.org/wiki/IETF_language_tag)
   *
   * @since 3.16.0
   */
  optional<std::string> locale;

  // The rootPath of the workspace. Is null
  // if no folder is open.
  //
  // @deprecated in favour of rootUri.
  optional<std::string> rootPath;

  // The rootUri of the workspace. Is null if no
  // folder is open. If both `rootPath` and `rootUri` are set
  // `rootUri` wins.
  optional<lsDocumentUri> rootUri;

  // User provided initialization options.
  optional<lsp::Any> initializationOptions;

  // The capabilities provided by the client (editor or tool)
  lsClientCapabilities capabilities;


  /**
 * An optional extension to the protocol.
 * To tell the server what client (editor) is talking to it.
 */
 // @Deprecated
  optional< std::string >clientName;



  enum class lsTrace {
    // NOTE: serialized as a string, one of 'off' | 'messages' | 'verbose';
    Off,       // off
    Messages,  // messages
    Verbose    // verbose

  };

  // The initial trace setting. If omitted trace is disabled ('off').
  lsTrace trace = lsTrace::Off;


  /**
 * The workspace folders configured in the client when the server starts.
 * This property is only available if the client supports workspace folders.
 * It can be `null` if the client supports workspace folders but none are
 * configured.
 *
 * Since 3.6.0
 */
  optional< std::vector<WorkspaceFolder> >  workspaceFolders;

  MAKE_SWAP_METHOD(lsInitializeParams,
      processId,
      rootPath,
      rootUri,
      initializationOptions,
      capabilities, clientName, clientInfo,
      trace, workspaceFolders, locale)
};

void Reflect(Reader& reader, lsInitializeParams::lsTrace& value);


void Reflect(Writer& writer, lsInitializeParams::lsTrace& value);


MAKE_REFLECT_STRUCT(lsInitializeParams,
                    processId,
                    rootPath,
                    rootUri,
                    initializationOptions,
                    capabilities, clientName, clientInfo,
                    trace, workspaceFolders, locale)

struct lsInitializeError {
  // Indicates whether the client should retry to send the
  // initilize request after showing the message provided
  // in the ResponseError.
  bool retry;
  void swap(lsInitializeError& arg) noexcept
  {
          auto tem = retry;
          retry = arg.retry;
          arg.retry = tem;
  }
};
MAKE_REFLECT_STRUCT(lsInitializeError, retry);