mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
api: add metadata for ui events
This commit is contained in:
@@ -33,6 +33,7 @@ typedef struct {
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "api/private/helpers.c.generated.h"
|
||||
# include "api/private/funcs_metadata.generated.h"
|
||||
# include "api/private/ui_events_metadata.generated.h"
|
||||
#endif
|
||||
|
||||
/// Start block that may cause vimscript exceptions
|
||||
@@ -820,6 +821,7 @@ Dictionary api_metadata(void)
|
||||
if (!metadata.size) {
|
||||
PUT(metadata, "version", DICTIONARY_OBJ(version_dict()));
|
||||
init_function_metadata(&metadata);
|
||||
init_ui_event_metadata(&metadata);
|
||||
init_error_type_metadata(&metadata);
|
||||
init_type_metadata(&metadata);
|
||||
}
|
||||
@@ -843,6 +845,22 @@ static void init_function_metadata(Dictionary *metadata)
|
||||
PUT(*metadata, "functions", functions);
|
||||
}
|
||||
|
||||
static void init_ui_event_metadata(Dictionary *metadata)
|
||||
{
|
||||
msgpack_unpacked unpacked;
|
||||
msgpack_unpacked_init(&unpacked);
|
||||
if (msgpack_unpack_next(&unpacked,
|
||||
(const char *)ui_events_metadata,
|
||||
sizeof(ui_events_metadata),
|
||||
NULL) != MSGPACK_UNPACK_SUCCESS) {
|
||||
abort();
|
||||
}
|
||||
Object ui_events;
|
||||
msgpack_rpc_to_object(&unpacked.data, &ui_events);
|
||||
msgpack_unpacked_destroy(&unpacked);
|
||||
PUT(*metadata, "ui_events", ui_events);
|
||||
}
|
||||
|
||||
static void init_error_type_metadata(Dictionary *metadata)
|
||||
{
|
||||
Dictionary types = ARRAY_DICT_INIT;
|
||||
|
Reference in New Issue
Block a user