mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
messages: use proper multiline error message for rpcrequest and API wrappers
This commit is contained in:
@@ -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] "
|
||||
|
Reference in New Issue
Block a user