comparison src/channel.c @ 33313:a60275d71dc2 v9.0.1922

patch 9.0.1922: LSP server request message is misinterpreted as a response message Commit: https://github.com/vim/vim/commit/78c5a5abc657f0173551157547213d8bbb033fd4 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Wed Sep 20 20:32:55 2023 +0200 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>
author Christian Brabandt <cb@256bit.org>
date Wed, 20 Sep 2023 20:45:03 +0200
parents 52c1e2a4d014
children 41e2414d2886
comparison
equal deleted inserted replaced
33312:3a4308ce45b5 33313:a60275d71dc2
2925 dictitem_T *di; 2925 dictitem_T *di;
2926 2926
2927 seq_nr = 0; 2927 seq_nr = 0;
2928 if (d != NULL) 2928 if (d != NULL)
2929 { 2929 {
2930 di = dict_find(d, (char_u *)"id", -1); 2930 // When looking for a response message from the LSP server,
2931 if (di != NULL && di->di_tv.v_type == VAR_NUMBER) 2931 // ignore new LSP request and notification messages. LSP
2932 seq_nr = di->di_tv.vval.v_number; 2932 // request and notification messages have the "method" field in
2933 // the header and the response messages do not have this field.
2934 if (!dict_has_key(d, "method"))
2935 {
2936 di = dict_find(d, (char_u *)"id", -1);
2937 if (di != NULL && di->di_tv.v_type == VAR_NUMBER)
2938 seq_nr = di->di_tv.vval.v_number;
2939 }
2933 } 2940 }
2934 2941
2935 argv[1] = *listtv; 2942 argv[1] = *listtv;
2936 } 2943 }
2937 else 2944 else