From 41c73ec8e4914123a8c84fca9fc63861f24360c1 Mon Sep 17 00:00:00 2001 From: julien castelain Date: Mon, 11 Nov 2024 04:20:55 +0100 Subject: [PATCH] Do not check for digits in request.id (#572) --- 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(