patch 9.0.1922: LSP server request message is misinterpreted as a response message
Problem: LSP server request message is misinterpreted as a response message Solution: Check that the message does not have the "message" field closes: #13133 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
committed by
Christian Brabandt
parent
87018255e3
commit
78c5a5abc6
@ -2927,9 +2927,16 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
|||||||
seq_nr = 0;
|
seq_nr = 0;
|
||||||
if (d != NULL)
|
if (d != NULL)
|
||||||
{
|
{
|
||||||
di = dict_find(d, (char_u *)"id", -1);
|
// When looking for a response message from the LSP server,
|
||||||
if (di != NULL && di->di_tv.v_type == VAR_NUMBER)
|
// ignore new LSP request and notification messages. LSP
|
||||||
seq_nr = di->di_tv.vval.v_number;
|
// request and notification messages have the "method" field in
|
||||||
|
// the header and the response messages do not have this field.
|
||||||
|
if (!dict_has_key(d, "method"))
|
||||||
|
{
|
||||||
|
di = dict_find(d, (char_u *)"id", -1);
|
||||||
|
if (di != NULL && di->di_tv.v_type == VAR_NUMBER)
|
||||||
|
seq_nr = di->di_tv.vval.v_number;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
argv[1] = *listtv;
|
argv[1] = *listtv;
|
||||||
|
|||||||
@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1922,
|
||||||
/**/
|
/**/
|
||||||
1921,
|
1921,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user