diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-26 18:10:05 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-07-17 11:37:08 -0300 |
commit | 887d32e54672cc3957bd2977df92fc3e9de10a52 (patch) | |
tree | a092cb21c31fc27e9b3c2ca652aadc73dbcc17c3 /src/nvim/os/channel.c | |
parent | 0b2b1da0e809e529a25530d80a77284d618390cf (diff) | |
download | rneovim-887d32e54672cc3957bd2977df92fc3e9de10a52.tar.gz rneovim-887d32e54672cc3957bd2977df92fc3e9de10a52.tar.bz2 rneovim-887d32e54672cc3957bd2977df92fc3e9de10a52.zip |
provider: New module used to expose extension points for core services
Introducing the concept of providers: co-processes that talk with the editor
through the remote API and provide implementation for one or more core
services.
The `provider_register` function and it's API wrapper can be used by channels
that want to self-register as a service provider.
Some old builtin vim features will be re-implemented as providers. The
`provider_has_feature` function is used to check if a provider
implementing a certain feature is available(It will be called by the `has`
vimscript function to check for features in a vim-compatible way)
This implements the provider module without exposing any extension points, which
will be done in future commits.
Diffstat (limited to 'src/nvim/os/channel.c')
-rw-r--r-- | src/nvim/os/channel.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/nvim/os/channel.c b/src/nvim/os/channel.c index efe628098c..c12779e794 100644 --- a/src/nvim/os/channel.c +++ b/src/nvim/os/channel.c @@ -6,6 +6,7 @@ #include <msgpack.h> #include "nvim/api/private/helpers.h" +#include "nvim/api/vim.h" #include "nvim/os/channel.h" #include "nvim/os/event.h" #include "nvim/os/rstream.h" @@ -17,9 +18,11 @@ #include "nvim/os/msgpack_rpc.h" #include "nvim/os/msgpack_rpc_helpers.h" #include "nvim/vim.h" +#include "nvim/ascii.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/map.h" +#include "nvim/log.h" #include "nvim/lib/kvec.h" typedef struct { @@ -274,7 +277,15 @@ static void job_out(RStream *rstream, void *data, bool eof) static void job_err(RStream *rstream, void *data, bool eof) { - // TODO(tarruda): plugin error messages should be sent to the error buffer + size_t count; + char buf[256]; + Channel *channel = job_data(data); + + while ((count = rstream_available(rstream))) { + size_t read = rstream_read(rstream, buf, sizeof(buf) - 1); + buf[read] = NUL; + ELOG("Channel %" PRIu64 " stderr: %s", channel->id, buf); + } } static void parse_msgpack(RStream *rstream, void *data, bool eof) |