mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
api/msgpack-rpc: Parse type information from api/private/defs.h
Enhance msgpack-gen.lua to extract custom api type codes from the ObjectType enum in api/private/defs.h. The type information is made available from the api metadata and clients can use to correctly serialize/deserialize these types using msgpack EXT type.
This commit is contained in:
@@ -49,32 +49,36 @@ typedef struct {
|
||||
} Dictionary;
|
||||
|
||||
typedef enum {
|
||||
// The following comments are markers that msgpack-gen.lua uses to extract
|
||||
// types, don't remove!
|
||||
// start custom types
|
||||
kObjectTypePosition,
|
||||
kObjectTypeBuffer,
|
||||
kObjectTypeWindow,
|
||||
kObjectTypeTabpage,
|
||||
// end custom types
|
||||
kObjectTypeNil,
|
||||
kObjectTypeBoolean,
|
||||
kObjectTypeInteger,
|
||||
kObjectTypeFloat,
|
||||
kObjectTypeString,
|
||||
kObjectTypeBuffer,
|
||||
kObjectTypeWindow,
|
||||
kObjectTypeTabpage,
|
||||
kObjectTypeArray,
|
||||
kObjectTypeDictionary,
|
||||
kObjectTypePosition,
|
||||
} ObjectType;
|
||||
|
||||
struct object {
|
||||
ObjectType type;
|
||||
union {
|
||||
Position position;
|
||||
Buffer buffer;
|
||||
Window window;
|
||||
Tabpage tabpage;
|
||||
Boolean boolean;
|
||||
Integer integer;
|
||||
Float floating;
|
||||
String string;
|
||||
Buffer buffer;
|
||||
Window window;
|
||||
Tabpage tabpage;
|
||||
Array array;
|
||||
Dictionary dictionary;
|
||||
Position position;
|
||||
} data;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user