mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-24 00:25:07 +00:00
47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "lsp.h"
|
|
|
|
// codeAction
|
|
struct CommandArgs {
|
|
lsDocumentUri textDocumentUri;
|
|
std::vector<lsTextEdit> edits;
|
|
};
|
|
MAKE_REFLECT_STRUCT_WRITER_AS_ARRAY(CommandArgs, textDocumentUri, edits);
|
|
|
|
// codeLens
|
|
struct lsCodeLensUserData {};
|
|
MAKE_REFLECT_EMPTY_STRUCT(lsCodeLensUserData);
|
|
|
|
struct lsCodeLensCommandArguments {
|
|
lsDocumentUri uri;
|
|
lsPosition position;
|
|
std::vector<lsLocation> locations;
|
|
};
|
|
|
|
// FIXME Don't use array in vscode-ccls
|
|
inline void Reflect(Writer& visitor, lsCodeLensCommandArguments& value) {
|
|
visitor.StartArray(3);
|
|
Reflect(visitor, value.uri);
|
|
Reflect(visitor, value.position);
|
|
Reflect(visitor, value.locations);
|
|
visitor.EndArray();
|
|
}
|
|
|
|
inline void Reflect(Reader& visitor, lsCodeLensCommandArguments& value) {
|
|
int i = 0;
|
|
visitor.IterArray([&](Reader& visitor) {
|
|
switch (i++) {
|
|
case 0:
|
|
Reflect(visitor, value.uri);
|
|
break;
|
|
case 1:
|
|
Reflect(visitor, value.position);
|
|
break;
|
|
case 2:
|
|
Reflect(visitor, value.locations);
|
|
break;
|
|
}
|
|
});
|
|
}
|