| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "LibLsp/JsonRpc/serializer.h" |
| 4 |
|
| 5 |
#include <string> |
| 6 |
#include <vector> |
| 7 |
#include "lsPosition.h" |
| 8 |
#include "lsWorkspaceEdit.h" |
| 9 |
#include "lsp_diagnostic.h" |
| 10 |
#include "lsCommand.h" |
| 11 |
|
| 12 |
struct CodeAction |
| 13 |
{ |
| 14 |
/** |
| 15 |
* A short, human-readable, title for this code action. |
| 16 |
*/ |
| 17 |
|
| 18 |
std::string title; |
| 19 |
|
| 20 |
/** |
| 21 |
* The kind of the code action. |
| 22 |
* |
| 23 |
* Used to filter code actions. |
| 24 |
*/ |
| 25 |
optional<std::string> kind; |
| 26 |
|
| 27 |
/** |
| 28 |
* The diagnostics that this code action resolves. |
| 29 |
*/ |
| 30 |
optional<std::vector<lsDiagnostic>> diagnostics; |
| 31 |
|
| 32 |
/** |
| 33 |
* The workspace edit this code action performs. |
| 34 |
*/ |
| 35 |
optional<lsWorkspaceEdit> edit; |
| 36 |
|
| 37 |
/** |
| 38 |
* A command this code action executes. If a code action |
| 39 |
* provides a edit and a command, first the edit is |
| 40 |
* executed and then the command. |
| 41 |
*/ |
| 42 |
optional<lsCommandWithAny> command; |
| 43 |
|
| 44 |
MAKE_SWAP_METHOD(CodeAction, title, kind, diagnostics, edit, command) |
| 45 |
}; |
| 46 |
MAKE_REFLECT_STRUCT(CodeAction, title, kind, diagnostics, edit, command) |
| 47 |
struct TextDocumentCodeAction |
| 48 |
|
| 49 |
{ |
| 50 |
|
| 51 |
typedef std::pair<optional<lsCommandWithAny>, optional<CodeAction>> Either; |
| 52 |
}; |
| 53 |
|
| 54 |
extern void Reflect(Reader& visitor, TextDocumentCodeAction::Either& value); |