From 03cca297df5210f94be2246cfdb1ee9a30454bea Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Mon, 18 Apr 2022 14:07:46 +0100 Subject: patch 8.2.4780: parsing an LSP message fails when it is split Problem: Parsing an LSP message fails when it is split. Solution: Collapse the received data before parsing. (Yegappan Lakshmanan, closes #10215) --- runtime/doc/channel.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index ae90430509..43862d8a2a 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -1433,11 +1433,17 @@ To open a channel using the 'lsp' mode with a job, set the 'in_mode' and let opts = {} let opts.in_mode = 'lsp' let opts.out_mode = 'lsp' + let opts.err_mode = 'nl' let opts.out_cb = function('LspOutCallback') let opts.err_cb = function('LspErrCallback') let opts.exit_cb = function('LspExitCallback') let job = job_start(cmd, opts) +Note that if a job outputs LSP messages on stdout and non-LSP messages on +stderr, then the channel-callback function should handle both the message +formats appropriately or you should use a separate callback function for +"out_cb" and "err_cb" to handle them as shown above. + To synchronously send a JSON-RPC request to the server, use the |ch_evalexpr()| function. This function will wait and return the decoded response message from the server. You can use either the |channel-timeout| or -- cgit v1.2.3