summaryrefslogtreecommitdiff
path: root/graphics/asymptote/LspCpp/include/LibLsp/lsp/client/registerCapability.h
blob: fa5d1114037ea0f48e65d5229985e9231ec6edc8 (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
#pragma once
#include "LibLsp/JsonRpc/message.h"
#include "LibLsp/lsp/lsDocumentUri.h"

/**
 * General parameters to register for a capability.
 */

struct Registration {
	static  Registration Create(const std::string& method);
	/**
	 * The id used to register the request. The id can be used to deregister
	 * the request again.
	 */
	std::string id;

	/**
	 * The method / capability to register for.
	 */

	std::string method;
	
	MAKE_SWAP_METHOD(Registration, id, method);
};


MAKE_REFLECT_STRUCT(Registration, id, method);

/**
 * The client/registerCapability request is sent from the server to the client to register
 * for a new capability on the client side. Not all clients need to support dynamic
 * capability registration. A client opts in via the dynamicRegistration property on the
 * specific client capabilities. A client can even provide dynamic registration for
 * capability A but not for capability B (see TextDocumentClientCapabilities as an example).
 */
struct RegistrationParams
{
	std::vector<Registration> registrations;
	MAKE_SWAP_METHOD(RegistrationParams, registrations);
};
/**
 * The client/registerCapability request is sent from the server to the client
 * to register for a new capability on the client side.
 * Not all clients need to support dynamic capability registration.
 * A client opts in via the ClientCapabilities.dynamicRegistration property
 */
MAKE_REFLECT_STRUCT(RegistrationParams, registrations);

DEFINE_REQUEST_RESPONSE_TYPE(Req_ClientRegisterCapability, RegistrationParams,JsonNull, "client/registerCapability");