diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 7304b003..1d4b0ed7 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -326,11 +326,9 @@ enddef # send a response message to the server def SendResponse(lspserver: dict, request: dict, result: any, error: dict) - if (request.id->type() == v:t_string - && (request.id->trim() =~ '[^[:digit:]]\+' - || request.id->trim()->empty())) + if (request.id->type() == v:t_string && request.id->trim()->empty()) || (request.id->type() != v:t_string && request.id->type() != v:t_number) - util.ErrMsg('request.id of response to LSP server is not a correct number') + util.ErrMsg('request.id of response to LSP server must be a number or a string') return endif var resp: dict = lspserver.createResponse(