comparison runtime/doc/channel.txt @ 28511:d7ca583e5772 v8.2.4780

patch 8.2.4780: parsing an LSP message fails when it is split Commit: https://github.com/vim/vim/commit/03cca297df5210f94be2246cfdb1ee9a30454bea Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Apr 18 14:07:46 2022 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 18 Apr 2022 15:15:04 +0200
parents 1c112473a54f
children f73a9bdff3a3
comparison
equal deleted inserted replaced
28510:3f4bd5516667 28511:d7ca583e5772
1431 1431
1432 let cmd = ['clangd', '--background-index', '--clang-tidy'] 1432 let cmd = ['clangd', '--background-index', '--clang-tidy']
1433 let opts = {} 1433 let opts = {}
1434 let opts.in_mode = 'lsp' 1434 let opts.in_mode = 'lsp'
1435 let opts.out_mode = 'lsp' 1435 let opts.out_mode = 'lsp'
1436 let opts.err_mode = 'nl'
1436 let opts.out_cb = function('LspOutCallback') 1437 let opts.out_cb = function('LspOutCallback')
1437 let opts.err_cb = function('LspErrCallback') 1438 let opts.err_cb = function('LspErrCallback')
1438 let opts.exit_cb = function('LspExitCallback') 1439 let opts.exit_cb = function('LspExitCallback')
1439 let job = job_start(cmd, opts) 1440 let job = job_start(cmd, opts)
1441
1442 Note that if a job outputs LSP messages on stdout and non-LSP messages on
1443 stderr, then the channel-callback function should handle both the message
1444 formats appropriately or you should use a separate callback function for
1445 "out_cb" and "err_cb" to handle them as shown above.
1440 1446
1441 To synchronously send a JSON-RPC request to the server, use the 1447 To synchronously send a JSON-RPC request to the server, use the
1442 |ch_evalexpr()| function. This function will wait and return the decoded 1448 |ch_evalexpr()| function. This function will wait and return the decoded
1443 response message from the server. You can use either the |channel-timeout| or 1449 response message from the server. You can use either the |channel-timeout| or
1444 the 'timeout' field in the {options} argument to control the response wait 1450 the 'timeout' field in the {options} argument to control the response wait