mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 08:32:42 +00:00
In the api_info() output:
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
...
{'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}
The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
46 lines
859 B
C
46 lines
859 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <uv.h>
|
|
|
|
#include "nvim/api/private/dispatch.h"
|
|
#include "nvim/map_defs.h"
|
|
|
|
typedef struct Channel Channel;
|
|
typedef struct Unpacker Unpacker;
|
|
|
|
typedef enum {
|
|
kClientTypeUnknown = -1,
|
|
kClientTypeRemote = 0,
|
|
kClientTypeMsgpackRpc = 5,
|
|
kClientTypeUi = 1,
|
|
kClientTypeEmbedder = 2,
|
|
kClientTypeHost = 3,
|
|
kClientTypePlugin = 4,
|
|
} ClientType;
|
|
|
|
typedef struct {
|
|
uint32_t request_id;
|
|
bool returned, errored;
|
|
Object result;
|
|
ArenaMem result_mem;
|
|
} ChannelCallFrame;
|
|
|
|
typedef struct {
|
|
MessageType type;
|
|
Channel *channel;
|
|
MsgpackRpcRequestHandler handler;
|
|
Array args;
|
|
uint32_t request_id;
|
|
Arena used_mem;
|
|
} RequestEvent;
|
|
|
|
typedef struct {
|
|
bool closed;
|
|
Unpacker *unpacker;
|
|
uint32_t next_request_id;
|
|
kvec_t(ChannelCallFrame *) call_stack;
|
|
Dict info;
|
|
ClientType client_type;
|
|
} RpcState;
|