File: getMoveDestinations.h

package info (click to toggle)
asymptote 3.02%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 33,400 kB
  • sloc: cpp: 172,516; ansic: 69,728; python: 14,967; sh: 5,599; javascript: 4,866; lisp: 1,507; perl: 1,417; makefile: 1,028; yacc: 610; lex: 449; xml: 182; asm: 8
file content (66 lines) | stat: -rw-r--r-- 1,844 bytes parent folder | download | duplicates (2)
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
#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.
         */
    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"
);