aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/channel.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-01-24 19:15:39 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-05-26 15:42:16 +0200
commit8ed54bbec3b07d16658547d6bf38a1e804800341 (patch)
tree404fd83325f4d6193b1b3d2c0c8ea7838d95e742 /src/nvim/msgpack_rpc/channel.c
parente0348c610c5f84c03f69f638effab27d0c784c7f (diff)
downloadrneovim-8ed54bbec3b07d16658547d6bf38a1e804800341.tar.gz
rneovim-8ed54bbec3b07d16658547d6bf38a1e804800341.tar.bz2
rneovim-8ed54bbec3b07d16658547d6bf38a1e804800341.zip
messages: use proper multiline error message for rpcrequest and API wrappers
Diffstat (limited to 'src/nvim/msgpack_rpc/channel.c')
-rw-r--r--src/nvim/msgpack_rpc/channel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 3438949e2d..2f3af22b65 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -687,6 +687,22 @@ Dictionary rpc_client_info(Channel *chan)
return copy_dictionary(chan->rpc.info);
}
+const char *rpc_client_name(Channel *chan)
+{
+ if (!chan->is_rpc) {
+ return NULL;
+ }
+ Dictionary info = chan->rpc.info;
+ for (size_t i = 0; i < info.size; i++) {
+ if (strequal("name", info.items[i].key.data)
+ && info.items[i].value.type == kObjectTypeString) {
+ return info.items[i].value.data.string.data;
+ }
+ }
+
+ return NULL;
+}
+
#if MIN_LOG_LEVEL <= DEBUG_LOG_LEVEL
#define REQ "[request] "
#define RES "[response] "