| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "LibLsp/JsonRpc/RequestInMessage.h" |
| 4 |
#include "LibLsp/JsonRpc/lsResponseMessage.h" |
| 5 |
|
| 6 |
#include "LibLsp/lsp/lsDocumentUri.h" |
| 7 |
|
| 8 |
struct ConfigurationItem |
| 9 |
{ |
| 10 |
/** |
| 11 |
* The scope to get the configuration section for. |
| 12 |
*/ |
| 13 |
lsDocumentUri scopeUri; |
| 14 |
|
| 15 |
/** |
| 16 |
* The configuration section asked for. |
| 17 |
*/ |
| 18 |
std::string section; |
| 19 |
MAKE_SWAP_METHOD(ConfigurationItem, scopeUri, section); |
| 20 |
}; |
| 21 |
MAKE_REFLECT_STRUCT(ConfigurationItem, scopeUri, section); |
| 22 |
struct ConfigurationParams |
| 23 |
{ |
| 24 |
std::vector<ConfigurationItem> items; |
| 25 |
MAKE_SWAP_METHOD(ConfigurationParams, items) |
| 26 |
}; |
| 27 |
|
| 28 |
MAKE_REFLECT_STRUCT(ConfigurationParams, items); |
| 29 |
|
| 30 |
/** |
| 31 |
* The workspace/configuration request is sent from the server to the client to fetch |
| 32 |
* configuration settings from the client. The request can fetch n configuration settings |
| 33 |
* in one roundtrip. The order of the returned configuration settings correspond to the |
| 34 |
* order of the passed ConfigurationItems (e.g. the first item in the response is the |
| 35 |
* result for the first configuration item in the params). |
| 36 |
*/ |
| 37 |
DEFINE_REQUEST_RESPONSE_TYPE( |
| 38 |
WorkspaceConfiguration, ConfigurationParams, std::vector<lsp::Any>, "workspace/configuration" |
| 39 |
); |