summaryrefslogtreecommitdiff
path: root/graphics/asymptote/LspCpp/LibLsp/lsp/extention/jdtls/getMoveDestinations.h
blob: bcbf6f8c2ba781abeda20104afbd0f535e7460c9 (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
#pragma once

#include "LibLsp/JsonRpc/RequestInMessage.h"
#include "LibLsp/JsonRpc/lsResponseMessage.h"
#include <string>
#include "LibLsp/lsp/lsAny.h"
#include "LibLsp/lsp/CodeActionParams.h"

struct MoveKindInfo
{
	static   std::string moveResource()
	{
		return "moveResource";
	}
	static   std::string moveInstanceMethod()
	{
		return "moveInstanceMethod";
	}
	static   std::string moveStaticMember()
	{
		return "moveStaticMember";
	}
};

struct MoveParams {
	/**
	 * The supported move kind: moveResource, moveInstanceMethod, moveStaticMember,
	 * moveTypeToNewFile.
	 */
	std::string moveKind;
	/**
	 * The selected resource uris when the move operation is triggered.
	 */
	std::vector<std::string> sourceUris;
	/**
	 * The code action params when the move operation is triggered.
	 */
	boost::optional<lsCodeActionParams>  params;
	/**
	 * The possible destination: a folder/package, class, instanceDeclaration.
	 */
	lsp::Any destination;
	bool updateReferences;
	void swap(MoveParams& arg) noexcept
	{
		moveKind.swap(arg.moveKind);
		sourceUris.swap(arg.sourceUris);
		params.swap(arg.params);
		destination.swap(arg.destination);
		std::swap(updateReferences, arg.updateReferences);
	}
};
MAKE_REFLECT_STRUCT(MoveParams, moveKind, sourceUris, params, destination, updateReferences);

struct MoveDestinationsResponse {
	std::string errorMessage;
	std::vector<lsp::Any > destinations;
	MAKE_SWAP_METHOD(MoveDestinationsResponse, errorMessage, destinations);
};
MAKE_REFLECT_STRUCT(MoveDestinationsResponse, errorMessage, destinations);

DEFINE_REQUEST_RESPONSE_TYPE(java_getMoveDestinations, MoveParams, MoveDestinationsResponse, "java/getMoveDestinations");