From: Yegappan Lakshmanan Date: Sun, 27 Nov 2022 16:29:32 +0000 (-0800) Subject: Ignore errors when clearing the highlight text properties X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=475c47c896db78b1f7e8716f6315c6717eaa7a3e;p=vim-lsp.git Ignore errors when clearing the highlight text properties --- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 45df1d2..9898ddd 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -125,7 +125,7 @@ export def DiagsGetErrorCount(lspserver: dict): dict endfor endif - return {'Error': errCount, 'Warn': warnCount, 'Info': infoCount, 'Hint': hintCount} + return {Error: errCount, Warn: warnCount, Info: infoCount, Hint: hintCount} enddef # Map the LSP DiagnosticSeverity to a quickfix type character diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 314e117..09ba79b 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -527,7 +527,7 @@ enddef # get the count of diagnostics in the current buffer export def ErrorCount(): dict - var res = {'Error': 0, 'Warn': 0, 'Info': 0, 'Hint': 0} + var res = {Error: 0, Warn: 0, Info: 0, Hint: 0} var fname: string = @% if fname == '' return res @@ -584,9 +584,8 @@ enddef # clear the symbol reference highlight def g:LspDocHighlightClear() - prop_remove({'type': 'LspTextRef', 'all': true}, 1, line('$')) - prop_remove({'type': 'LspReadRef', 'all': true}, 1, line('$')) - prop_remove({'type': 'LspWriteRef', 'all': true}, 1, line('$')) + :silent! prop_remove({types: ['LspTextRef', 'LspReadRef', 'LspWriteRef'], + all: true}) enddef def g:LspRequestDocSymbols()