From f9b776b2344e90510b62962e792f8ef4430351d0 Mon Sep 17 00:00:00 2001 From: Maxim Yurevich Date: Sun, 22 Sep 2024 03:34:35 +0300 Subject: [PATCH] fix: wrap `didSaveFile` method with `try-finally` block (#495) --- autoload/lsp/lsp.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 3e6461b9..5138c177 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -339,7 +339,14 @@ def LspSavedFile(bnr: number) endif for lspserver in lspservers - lspserver.didSaveFile(bnr) + # TODO: implement `catch` block + # Wrap method with `try-finally` block to solve error: + # `E716: Key not present in Dictionary: "supportsDidSave"` + try + lspserver.didSaveFile(bnr) + finally + return + endtry endfor enddef