ga_append(&ga, NUL);
ga_init2(&lspga, 1, 4000);
+ // Header according to LSP specification.
vim_snprintf((char *)IObuff, IOSIZE,
"Content-Length: %u\r\n"
- "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n\r\n",
+ "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n\r\n",
ga.ga_len - 1);
ga_concat(&lspga, IObuff);
ga_concat_len(&lspga, ga.ga_data, ga.ga_len);
" " Test for sending a raw message
" let g:lspNotif = []
" let s = "Content-Length: 62\r\n"
- " let s ..= "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ " let s ..= "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
" let s ..= "\r\n"
" let s ..= '{"method":"echo","jsonrpc":"2.0","params":{"m":"raw-message"}}'
" call ch_sendraw(ch, s)
v['id'] = msgid
s = json.dumps(v)
resp = "Content-Length: " + str(len(s)) + "\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
resp += s
if self.debug:
v = 'wrong-payload'
s = json.dumps(v)
resp = "Content-Length: " + str(len(s)) + "\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
resp += s
self.request.sendall(resp.encode('utf-8'))
def send_empty_payload(self):
resp = "Content-Length: 0\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
self.request.sendall(resp.encode('utf-8'))
resp = "Host: abc.vim.org\r\n"
resp += "User-Agent: Python\r\n"
resp += "Accept-Language: en-US,en\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "Content-Length: " + str(len(s)) + "\r\n"
resp += "\r\n"
resp += s
# test for sending the http header without length
v = {'jsonrpc': '2.0', 'id': msgid, 'result': resp_dict}
s = json.dumps(v)
- resp = "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp = "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
resp += s
self.request.sendall(resp.encode('utf-8'))