aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc
Commit message (Collapse)AuthorAge
...
* Merge #4411 from ZyX-I/luaviml'/luaJustin M. Keyes2017-05-09
|\
| * Merge branch 'master' into luaviml'/luaZyX2017-05-08
| |\
| * \ Merge branch 'master' into luaviml'/luaZyX2017-04-08
| |\ \
| * | | api: Also shift numbers in api_metadata outputZyX2017-03-27
| | | | | | | | | | | | | | | | | | | | | | | | Fixes problem introduced by “api: Allow kObjectTypeNil to be zero without breaking compatibility”: apparently there are clients which use metadata and there are which aren’t. For the first that commit would not be needed, for the second that commit misses this critical piece.
| * | | gendeclarations: Make declarations generator work with macros funcsZyX2017-03-27
| | | | | | | | | | | | | | | | | | | | Now it checks functions also after every semicolon and closing figure brace, possibly preceded by whitespaces (tabs and spaces). This should make messing with declarations in macros not needed.
| * | | msgpack_rpc: Fix #HANDLE_TYPE_CONVERSION_IMPLZyX2017-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Function declarations generator is able to handle properly only the *first* function definition that is in macros, and only if it is the first entity in the macros. So msgpack_rpc_from_* was already really a static function, additionally its attributes were useless. This commit switches to explicit declarations and makes generated functions static.
| * | | api: Allow kObjectTypeNil to be zero without breaking compatibilityZyX2017-03-27
| | | |
| * | | functests: Test for error conditionsZyX2017-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During testing found the following bugs: 1. msgpack-gen.lua script is completely unprepared for Float values either in return type or in arguments. Specifically: 1. At the time of writing relevant code FLOAT_OBJ did not exist as well as FLOATING_OBJ, but it would be used by msgpack-gen.lua should return type be Float. I added FLOATING_OBJ macros later because did not know that msgpack-gen.lua uses these _OBJ macros, otherwise it would be FLOAT_OBJ. 2. msgpack-gen.lua should use .data.floating in place of .data.float. But it did not expect that .data subattribute may have name different from lowercased type name. 2. vim_replace_termcodes returned its argument as-is if it receives an empty string (as well as _vim_id*() functions did). But if something in returned argument lives in an allocated memory such action will cause double free: once when freeing arguments, then when freeing return value. It did not cause problems yet because msgpack bindings return empty string as {NULL, 0} and nothing was actually allocated. 3. New code in msgpack-gen.lua popped arguments in reversed order, making lua bindings’ signatures be different from API ones.
* | | | refactor/single-include (#6687)Carlo Abelli2017-05-08
| |_|/ |/| |
* | | coverity/161682: FP: Dereference after null check (#6630)Justin M. Keyes2017-05-01
| | |
* | | api/nvim_get_mode: Use child-queue instead of "priority".Justin M. Keyes2017-04-28
| | |
* | | input.c: Process only safe events before blocking.Justin M. Keyes2017-04-28
| | | | | | | | | | | | | | | Introduce multiqueue_process_priority() to process only events at or above a certain priority.
* | | api: nvim_get_mode()Justin M. Keyes2017-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Asynchronous API functions are served immediately, which means pending input could change the state of Nvim shortly after an async API function result is returned. nvim_get_mode() is different: - If RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it is handled just-in-time before waiting for input, after pending input was processed. This makes the result more reliable (but not perfect). Internally this is handled as a special case, but _semantically_ nothing has changed: API users never know when input flushes, so this internal special-case doesn't violate that. As far as API users are concerned, nvim_get_mode() is just another asynchronous API function. In all cases nvim_get_mode() never blocks for more than the time it takes to flush the input/event queue (~µs). Note: This doesn't address #6166; nvim_get_mode() will provoke #6166 if e.g. `d` is operator-pending. Closes #6159
* | | api: Do not translate error messages.Justin M. Keyes2017-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also re-word some error messages: - "Key does not exist: %s" - "Invalid channel: %<PRIu64>" - "Request array size must be 4 (request) or 3 (notification)" - "String cannot contain newlines" References #6150
* | | api_set_error(): renameJustin M. Keyes2017-04-23
| | |
* | | api/internal: Remove `set` field from Error type.Justin M. Keyes2017-04-23
| | |
* | | api_clear_error()Justin M. Keyes2017-04-23
| | |
* | | api: Do not truncate errors <1 MB. #6237Sander Bosma2017-04-23
| | | | | | | | | | | | Closes #5984
* | | *: Add comment to all C filesZyX2017-04-19
| |/ |/|
* | Add handling for MSGPACK_OBJECT_FLOAT{32,64}James McCoy2017-03-30
| | | | | | | | | | | | msgpack-c previously only had MSGPACK_OBJECT_FLOAT, which was a 64-bit value. Now, 32-bit and 64-bit floats are supported as distinct types, but we'll simply continue to treat everything as 64-bit types.
* | eval,*: Move get_tv_string to typval.cZyX2017-03-29
|/ | | | Function was renamed and changed to return `const char *`.
* terminal: Disable some options in terminal-mode.Justin M. Keyes2017-03-01
| | | | | | | In terminal-mode these options are nonsense because cursor is placed at end of buffer to "follow" output. Closes #2259
* channel.c: loggingJustin M. Keyes2017-02-26
|
* msgpack_rpc: Allocate empty string in msgpack_rpc_to_objectJames McCoy2016-11-29
| | | | | | | | | | STR_CASE previously used a NULL data pointer for the String object, but this pushes the NULL checks to the rest of the code. Instead, allocating an empty string solves the same issue of there not being any data but ensures that we're not passing NULL to functions that don't expect it. Closes #5627
* Avoid serializing NULL string through msgpackJames McCoy2016-11-23
| | | | | | Attempting to serialize a NULL string through msgpack results in msgpack_sbuffer_write attempting to memcpy from a NULL pointer, which is undefined behavior.
* lintJames McCoy2016-11-02
|
* object_to_vim: Fix buffer/window/tabpage conversion on BE systemsJames McCoy2016-11-02
| | | | | | | | | | | Since data.integer is a different (larger) integer type than data.{buffer,window,tabpage}, we cannot abuse the union by using data.integer to access the value for all 4 types. Instead, remove the {buffer,window,tabpage} members and always use the integer member. In order to accomodate this, perform distinct validation and coercion between the Integer type and Buffer/Window/Tabpage types in object_to_vim, msgpack_rpc helpers, and gendispatch.lua.
* api: call multiple methods atomically (useful in async contexts)Björn Linse2016-10-22
| | | | remove unused response_id parameter of handle_nvim_... helpers
* event/multiqueue.c: Rename "queue" to "multiqueue".Justin M. Keyes2016-10-02
| | | | | | | | | | | | | | `lib/queue.h` implements a basic queue. `event/queue.c` implements a specialized data structure on top of lib/queue.h; it is not a "normal" queue. Rename the specialized multi-level queue implemented in event/queue.c to "multiqueue", to avoid confusion when reading the code. Before this change one can eventually notice that "macros (uppercase symbols) are for the normal queue, lowercase operations are for the multi-level queue", but that is unnecessary friction for new developers (or existing developers just visiting this part of the codebase).
* api: fix leak when a api function is incorrectly called with a list.Björn Linse2016-08-31
| | | | This applies both to msgpack-rpc and eval.
* api: unify buffer numbers and window ids with handlesBjörn Linse2016-08-31
| | | | also allow handle==0 meaning curbuf/curwin/curtab
* api: rename "msgpack_rpc/defs.h" to "api/private/dispatch.h" and use the ↵Björn Linse2016-08-31
| | | | header generator.
* job control: reuse common job code for rpc jobsBjörn Linse2016-08-20
| | | | This makes stderr and exit callbacks work for rpc jobs
* stream: set data together with callbackBjörn Linse2016-08-20
|
* server_init: Handle server_address_new() failure.Justin M. Keyes2016-07-18
| | | | Closes #3364
* *: Fix linter errorsZyX2016-06-24
| | | | | | | | | Also adds one exception to linter rules: typedef struct { kvec_t(Object) stack; } EncodedData; is completely valid (from the style guide point of view) code.
* msgpack_rpc: Fix crash in log_server_msgZyX2016-06-24
| | | | | | | | | | | It appears that used msgpack library is not able to parse back message created by msgpack_rpc_from_object() if nesting level is too high, so log_server_msg now cares about msgpack_unpack_next() return value. Also error message from server_notifications_spec.lua is not readable if something is wrong (though at least now it does not crash when parsing deeply nested structures). log_server_msg() in the test reports [msgpack-rpc] nvim -> client(1) [error] "parse error"
* msgpack_rpc: Also make msgpack_from_*/msgpack_to_* functions not recurZyX2016-06-24
| | | | | | This removes some stack overflows in new test regarding deeply nested variables. Now in place of crashing vim_to_object/msgpack_rpc_from_object/etc it crashes clear_tv with stack overflow.
* *: Fix errors from new linter checksZyX2016-06-11
|
* Merge pull request #4844 from ZyX-I/rename-main-loopJustin M. Keyes2016-05-31
|\ | | | | Rename main loop variable from loop to main_loop
| * *: Rename main loop variable from loop to main_loopZyX2016-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current name is inappropriate for the following reasons: 1. It is often masked by local `loop` variables. 2. It cannot be searched for. There are many `loop` variables where `loop` is some local variable. There are many cases when “loop” word is used in a comment. 3. It is in any case bad idea to use a generic name as a name of the global variable. Best if global has module prefix: this is why it is in `main.h`: `main_loop` both stands for “a main loop” and “a loop defined in `main.*`”. Since I have no idea how to list every occurrence of this variable method used to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if some occurrence was hidden under false `#if` branch it was not replaced.
* | lib/kvec: Do not use kv_init unless neededZyX2016-05-30
| |
* | lib/kvec: Remove useless type argument from kv_push macrosZyX2016-05-30
|/
* api: refactor remote ui to use API dispatch generationBjörn Linse2016-05-27
|
* syntax: Add support for the "special" color used for undercurlsAdnoC2016-05-17
|
* *: Fix new linter errorsZyX2016-05-01
| | | | Originally there were 128 new errors, so I thought this is a good idea to fix all of them. Of course, this commit also fixes many suppressed errors.
* Merge tempfile.c back into fileio.cJurica Bradaric2016-04-20
|
* *: Make set_vim_var_\* functions have proper argument typesZyX2016-04-18
|
* bufhl: fix unittests and lintBjörn Linse2016-02-23
| | | | msgpack_rpc_dispatch doesn't exist anymore
* helpers.c: Handle msgpack str/bin objects with length 0 correctlyoni-link2015-12-21
| | | | | | | | | | | When converting a msgpack object to a String object, strings (and byte arrays) with length 0 are handled as errors. This is fixed by always using the msgpack data pointer as a valid pointer. For a NULL pointer there is nothing to copy. Test by @snoe Fixes #3844