| 1 |
#pragma once |
| 2 |
#include "LibLsp/JsonRpc/message.h" |
| 3 |
#include "InitializeParams.h" |
| 4 |
#include "lsServerCapabilities.h" |
| 5 |
#include "LibLsp/JsonRpc/lsResponseMessage.h" |
| 6 |
#include "LibLsp/JsonRpc/RequestInMessage.h" |
| 7 |
|
| 8 |
/** |
| 9 |
* The capabilities the language server provides. |
| 10 |
*/ |
| 11 |
struct InitializeResult |
| 12 |
{ |
| 13 |
lsServerCapabilities capabilities; |
| 14 |
MAKE_SWAP_METHOD(InitializeResult, capabilities); |
| 15 |
}; |
| 16 |
|
| 17 |
MAKE_REFLECT_STRUCT(InitializeResult, capabilities); |
| 18 |
|
| 19 |
/** |
| 20 |
* The initialize request is sent as the first request from the client to |
| 21 |
* the server. |
| 22 |
* |
| 23 |
* If the server receives request or notification before the initialize request it should act as follows: |
| 24 |
* - for a request the respond should be errored with code: -32001. The message can be picked by the server. |
| 25 |
* - notifications should be dropped, except for the exit notification. This will allow the exit a server without an initialize request. |
| 26 |
* |
| 27 |
* Until the server has responded to the initialize request with an InitializeResult |
| 28 |
* the client must not sent any additional requests or notifications to the server. |
| 29 |
* |
| 30 |
* During the initialize request the server is allowed to sent the notifications window/showMessage, |
| 31 |
* window/logMessage and telemetry/event as well as the window/showMessageRequest request to the client. |
| 32 |
*/ |
| 33 |
|
| 34 |
DEFINE_REQUEST_RESPONSE_TYPE(td_initialize, lsInitializeParams, InitializeResult, "initialize"); |