From 655437ec7b9279a40486dc34809a3364337356db Mon Sep 17 00:00:00 2001 From: Julien Castelain Date: Sun, 10 Nov 2024 21:41:59 +0100 Subject: [PATCH] Do not check for digits in request.id --- autoload/lsp/lspserver.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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(