Mercurial > vim
comparison src/json.c @ 32311:10a03ae8ba60 v9.0.1487
patch 9.0.1487: Content-type header for LSP channel not according to spec
Commit: https://github.com/vim/vim/commit/c3eddd2068620ceb4e475961192c1d8cae3350cd
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Apr 25 14:54:54 2023 +0100
patch 9.0.1487: Content-type header for LSP channel not according to spec
Problem: Content-type header for LSP channel not according to spec.
Solution: Use "vscode-jsonrpc" instead of "vim-jsonrpc". (Yegappan
Lakshmanan, closes #12295)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 25 Apr 2023 16:00:09 +0200 |
parents | 39f4126d2a0d |
children | dd8da8f1c2bc |
comparison
equal
deleted
inserted
replaced
32310:c6eab83d1ba9 | 32311:10a03ae8ba60 |
---|---|
101 if (json_encode_gap(&ga, val, 0) == FAIL) | 101 if (json_encode_gap(&ga, val, 0) == FAIL) |
102 return NULL; | 102 return NULL; |
103 ga_append(&ga, NUL); | 103 ga_append(&ga, NUL); |
104 | 104 |
105 ga_init2(&lspga, 1, 4000); | 105 ga_init2(&lspga, 1, 4000); |
106 // Header according to LSP specification. | |
106 vim_snprintf((char *)IObuff, IOSIZE, | 107 vim_snprintf((char *)IObuff, IOSIZE, |
107 "Content-Length: %u\r\n" | 108 "Content-Length: %u\r\n" |
108 "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n\r\n", | 109 "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n\r\n", |
109 ga.ga_len - 1); | 110 ga.ga_len - 1); |
110 ga_concat(&lspga, IObuff); | 111 ga_concat(&lspga, IObuff); |
111 ga_concat_len(&lspga, ga.ga_data, ga.ga_len); | 112 ga_concat_len(&lspga, ga.ga_data, ga.ga_len); |
112 ga_clear(&ga); | 113 ga_clear(&ga); |
113 return lspga.ga_data; | 114 return lspga.ga_data; |