From 63c92d2f9eba8372d8119a9709344f6ebf45c2f3 Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Sun, 16 Apr 2023 07:53:17 +0800 Subject: [PATCH] feat: tidy err/wrn msg Signed-off-by: shane.xb.qian --- autoload/lsp/buffer.vim | 6 +-- autoload/lsp/codeaction.vim | 2 +- autoload/lsp/completion.vim | 4 +- autoload/lsp/diag.vim | 4 +- autoload/lsp/handlers.vim | 14 +++---- autoload/lsp/lsp.vim | 26 ++++++------ autoload/lsp/lspserver.vim | 80 ++++++++++++++++++------------------- autoload/lsp/textedit.vim | 4 +- autoload/lsp/util.vim | 4 +- 9 files changed, 72 insertions(+), 72 deletions(-) diff --git a/autoload/lsp/buffer.vim b/autoload/lsp/buffer.vim index c34f9a9..455e692 100644 --- a/autoload/lsp/buffer.vim +++ b/autoload/lsp/buffer.vim @@ -157,15 +157,15 @@ export def CurbufGetServerChecked(domain: string = null_string): dict var lspserver: dict = CurbufGetServer(domain) if lspserver->empty() - util.ErrMsg($'Error: Language server for "{&filetype}" file type is not found') + util.ErrMsg($'Language server for "{&filetype}" file type is not found') return {} endif if !lspserver.running - util.ErrMsg($'Error: Language server for "{&filetype}" file type is not running') + util.ErrMsg($'Language server for "{&filetype}" file type is not running') return {} endif if !lspserver.ready - util.ErrMsg($'Error: Language server for "{&filetype}" file type is not ready') + util.ErrMsg($'Language server for "{&filetype}" file type is not ready') return {} endif diff --git a/autoload/lsp/codeaction.vim b/autoload/lsp/codeaction.vim index faa11bd..2c1680e 100644 --- a/autoload/lsp/codeaction.vim +++ b/autoload/lsp/codeaction.vim @@ -18,7 +18,7 @@ export def DoCommand(lspserver: dict, cmd: dict) try call CmdHandler(cmd) catch - util.ErrMsg($'Error: "{cmd.command}" handler raised exception {v:exception}') + util.ErrMsg($'"{cmd.command}" handler raised exception {v:exception}') endtry else lspserver.executeCommand(cmd) diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index 9159e10..75e0a78 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -324,13 +324,13 @@ def ShowCompletionDocumentation(cItem: any) infoText->extend(cItem.documentation.value->split("\n")) infoKind = 'lspgfm' else - util.ErrMsg($'Error: Unsupported documentation type ({cItem.documentation.kind})') + util.ErrMsg($'Unsupported documentation type ({cItem.documentation.kind})') return endif elseif cItem.documentation->type() == v:t_string infoText->extend(cItem.documentation->split("\n")) else - util.ErrMsg($'Error: Unsupported documentation ({cItem.documentation->string()})') + util.ErrMsg($'Unsupported documentation ({cItem.documentation->string()})') return endif endif diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 1d28a40..8dec2dc 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -590,9 +590,9 @@ export def LspDiagsJump(which: string, a_count: number = 0): void endif if which == 'here' - util.WarnMsg('Error: No more diagnostics found on this line') + util.WarnMsg('No more diagnostics found on this line') else - util.WarnMsg('Error: No more diagnostics found') + util.WarnMsg('No more diagnostics found') endif enddef diff --git a/autoload/lsp/handlers.vim b/autoload/lsp/handlers.vim index b4219f5..2c84048 100644 --- a/autoload/lsp/handlers.vim +++ b/autoload/lsp/handlers.vim @@ -10,7 +10,7 @@ import './textedit.vim' # Process various reply messages from the LSP server export def ProcessReply(lspserver: dict, req: dict, reply: dict): void - util.ErrMsg($'Error: Unsupported reply received from LSP server: {reply->string()} for request: {req->string()}') + util.ErrMsg($'Unsupported reply received from LSP server: {reply->string()} for request: {req->string()}') enddef # process a diagnostic notification message from the LSP server @@ -62,7 +62,7 @@ enddef # process unsupported notification messages def ProcessUnsupportedNotif(lspserver: dict, reply: dict) - util.ErrMsg($'Error: Unsupported notification message received from the LSP server ({lspserver.path}), message = {reply->string()}') + util.ErrMsg($'Unsupported notification message received from the LSP server ({lspserver.path}), message = {reply->string()}') enddef # per-filetype private map inside to record if ntf once or not @@ -109,7 +109,7 @@ export def ProcessNotif(lspserver: dict, reply: dict): void elseif lspserver.customNotificationHandlers->has_key(reply.method) lspserver.customNotificationHandlers[reply.method](lspserver, reply) elseif lsp_ignored_notif_handlers->index(reply.method) == -1 - util.ErrMsg($'Error: Unsupported notification received from LSP server {reply->string()}') + util.ErrMsg($'Unsupported notification received from LSP server {reply->string()}') endif enddef @@ -178,7 +178,7 @@ def ProcessClientUnregisterCap(lspserver: dict, request: dict) enddef def ProcessUnsupportedReq(lspserver: dict, request: dict) - util.ErrMsg($'Error: Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}') + util.ErrMsg($'Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}') enddef # process a request message from the server @@ -198,7 +198,7 @@ export def ProcessRequest(lspserver: dict, request: dict) if lspRequestHandlers->has_key(request.method) lspRequestHandlers[request.method](lspserver, request) else - util.ErrMsg($'Error: Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}') + util.ErrMsg($'Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}') endif enddef @@ -227,7 +227,7 @@ export def ProcessMessages(lspserver: dict): void if msg.error->has_key('data') emsg ..= $', data = {msg.error.data->string()}' endif - util.ErrMsg($'Error(LSP): request {req.method} failed ({emsg})') + util.ErrMsg($'request {req.method} failed ({emsg})') endif endif elseif msg->has_key('id') && msg->has_key('method') @@ -237,7 +237,7 @@ export def ProcessMessages(lspserver: dict): void # notification message from the server lspserver.processNotif(msg) else - util.ErrMsg($'Error(LSP): Unsupported message ({msg->string()})') + util.ErrMsg($'Unsupported message ({msg->string()})') endif enddef diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 945ea47..b2db8b2 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -87,7 +87,7 @@ enddef # Enable/disable the logging of the language server protocol messages def ServerDebug(arg: string) if ['errors', 'messages', 'off', 'on']->index(arg) == -1 - util.ErrMsg($'Error: Unsupported argument "{arg}" for LspServer debug') + util.ErrMsg($'Unsupported argument "{arg}" for LspServer debug') return endif @@ -223,7 +223,7 @@ def ShowServer(arg: string) lines->extend(lspserver.getMessages()) endfor else - util.ErrMsg($'Error: Unsupported argument "{arg}"') + util.ErrMsg($'Unsupported argument "{arg}"') return endif @@ -566,7 +566,7 @@ enddef export def AddServer(serverList: list>) for server in serverList if !server->has_key('filetype') || !server->has_key('path') - util.ErrMsg('Error: LSP server information is missing filetype or path') + util.ErrMsg('LSP server information is missing filetype or path') continue endif # Enable omni-completion by default @@ -574,14 +574,14 @@ export def AddServer(serverList: list>) if !server.path->executable() if !opt.lspOptions.ignoreMissingServer - util.ErrMsg($'Error: LSP server {server.path} is not found') + util.ErrMsg($'LSP server {server.path} is not found') endif return endif var args: list = [] if server->has_key('args') if server.args->type() != v:t_list - util.ErrMsg($'Error: Arguments for LSP server {server.args} is not a List') + util.ErrMsg($'Arguments for LSP server {server.args} is not a List') return endif args = server.args @@ -603,7 +603,7 @@ export def AddServer(serverList: list>) endif if server.omnicompl->type() != v:t_bool - util.ErrMsg($'Error: Setting of omnicompl {server.omnicompl} is not a Boolean') + util.ErrMsg($'Setting of omnicompl {server.omnicompl} is not a Boolean') return endif @@ -656,7 +656,7 @@ export def AddServer(serverList: list>) AddServerForFiltype(lspserver, ftype, server.omnicompl) endfor else - util.ErrMsg($'Error: Unsupported file type information "{ftypes->string()}" in LSP server registration') + util.ErrMsg($'Unsupported file type information "{ftypes->string()}" in LSP server registration') continue endif endfor @@ -688,7 +688,7 @@ enddef # Params: SetTraceParams def ServerTraceSet(traceVal: string) if ['off', 'messages', 'verbose']->index(traceVal) == -1 - util.ErrMsg($'Error: Unsupported LSP server trace value {traceVal}') + util.ErrMsg($'Unsupported LSP server trace value {traceVal}') return endif @@ -809,7 +809,7 @@ enddef # Format the entire file export def TextDocFormat(range_args: number, line1: number, line2: number) if !&modifiable - util.ErrMsg('Error: Current file is not a modifiable file') + util.ErrMsg('Current file is not a modifiable file') return endif @@ -947,7 +947,7 @@ export def AddWorkspaceFolder(dirArg: string) endif :redraw! if !dirName->isdirectory() - util.ErrMsg($'Error: {dirName} is not a directory') + util.ErrMsg($'{dirName} is not a directory') return endif @@ -969,7 +969,7 @@ export def RemoveWorkspaceFolder(dirArg: string) endif :redraw! if !dirName->isdirectory() - util.ErrMsg($'Error: {dirName} is not a directory') + util.ErrMsg($'{dirName} is not a directory') return endif @@ -1007,7 +1007,7 @@ export def FoldDocument() endif if &foldmethod != 'manual' - util.ErrMsg("Error: Only works when 'foldmethod' is 'manual'") + util.ErrMsg("Only works when 'foldmethod' is 'manual'") return endif @@ -1130,7 +1130,7 @@ export def LspServerCmd(args: string) var subcmd = args[6 : ]->trim() ServerTraceSet(subcmd) else - util.ErrMsg($'Error: LspServer - Unsupported argument "{args}"') + util.ErrMsg($'LspServer - Unsupported argument "{args}"') endif enddef diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 6f4f559..aa192ed 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -75,7 +75,7 @@ def StartServer(lspserver: dict, bnr: number): number var job = cmd->job_start(opts) if job->job_status() == 'fail' - util.ErrMsg($'Error: Failed to start LSP server {lspserver.path}') + util.ErrMsg($'Failed to start LSP server {lspserver.path}') return 1 endif @@ -317,7 +317,7 @@ def SendResponse(lspserver: dict, request: dict, result: any, error: d && (request.id->trim() =~ '[^[:digit:]]\+' || request.id->trim() == '')) || (request.id->type() != v:t_string && request.id->type() != v:t_number) - util.ErrMsg('Error: request.id of response to LSP server is not a correct number') + util.ErrMsg('request.id of response to LSP server is not a correct number') return endif var resp: dict = lspserver.createResponse( @@ -383,7 +383,7 @@ def Rpc(lspserver: dict, method: string, params: any, handleError: bool = t if reply.error->has_key('data') emsg ..= $', data = {reply.error.data->string()}' endif - util.ErrMsg($'Error(LSP): request {method} failed ({emsg})') + util.ErrMsg($'request {method} failed ({emsg})') endif return {} @@ -404,12 +404,12 @@ def AsyncRpcCb(lspserver: dict, method: string, RpcCb: func, chan: channel, if reply.error->has_key('data') emsg ..= $', data = {reply.error.data->string()}' endif - util.ErrMsg($'Error(LSP): request {method} failed ({emsg})') + util.ErrMsg($'request {method} failed ({emsg})') return endif if !reply->has_key('result') - util.ErrMsg($'Error(LSP): request {method} failed (no result)') + util.ErrMsg($'request {method} failed (no result)') return endif @@ -611,7 +611,7 @@ enddef def GetCompletion(lspserver: dict, triggerKind_arg: number, triggerChar: string): void # Check whether LSP server supports completion if !lspserver.isCompletionProvider - util.ErrMsg('Error: LSP server does not support completion') + util.ErrMsg('LSP server does not support completion') return endif @@ -636,7 +636,7 @@ enddef def ResolveCompletion(lspserver: dict, item: dict): void # Check whether LSP server supports completion item resolve if !lspserver.isCompletionResolveProvider - util.ErrMsg('Error: LSP server does not support completion item resolve') + util.ErrMsg('LSP server does not support completion item resolve') return endif @@ -668,13 +668,13 @@ def GotoSymbolLoc(lspserver: dict, msg: string, peekSymbol: bool, if reply->empty() || reply.result->empty() var emsg: string if msg ==# 'textDocument/declaration' - emsg = 'Error: symbol declaration is not found' + emsg = 'symbol declaration is not found' elseif msg ==# 'textDocument/typeDefinition' - emsg = 'Error: symbol type definition is not found' + emsg = 'symbol type definition is not found' elseif msg ==# 'textDocument/implementation' - emsg = 'Error: symbol implementation is not found' + emsg = 'symbol implementation is not found' else - emsg = 'Error: symbol definition is not found' + emsg = 'symbol definition is not found' endif util.WarnMsg(emsg) @@ -715,7 +715,7 @@ enddef def GotoDefinition(lspserver: dict, peek: bool, cmdmods: string) # Check whether LSP server supports jumping to a definition if !lspserver.isDefinitionProvider - util.ErrMsg('Error: Jumping to a symbol definition is not supported') + util.ErrMsg('Jumping to a symbol definition is not supported') return endif @@ -729,7 +729,7 @@ enddef def GotoDeclaration(lspserver: dict, peek: bool, cmdmods: string) # Check whether LSP server supports jumping to a declaration if !lspserver.isDeclarationProvider - util.ErrMsg('Error: Jumping to a symbol declaration is not supported') + util.ErrMsg('Jumping to a symbol declaration is not supported') return endif @@ -743,7 +743,7 @@ enddef def GotoTypeDef(lspserver: dict, peek: bool, cmdmods: string) # Check whether LSP server supports jumping to a type definition if !lspserver.isTypeDefinitionProvider - util.ErrMsg('Error: Jumping to a symbol type definition is not supported') + util.ErrMsg('Jumping to a symbol type definition is not supported') return endif @@ -757,7 +757,7 @@ enddef def GotoImplementation(lspserver: dict, peek: bool, cmdmods: string) # Check whether LSP server supports jumping to a implementation if !lspserver.isImplementationProvider - util.ErrMsg('Error: Jumping to a symbol implementation is not supported') + util.ErrMsg('Jumping to a symbol implementation is not supported') return endif @@ -774,7 +774,7 @@ def SwitchSourceHeader(lspserver: dict) param.uri = util.LspFileToUri(@%) var reply = lspserver.rpc('textDocument/switchSourceHeader', param) if reply->empty() || reply.result->empty() - util.WarnMsg('Error: No alternate file found') + util.WarnMsg('No alternate file found') return endif @@ -796,7 +796,7 @@ enddef def ShowSignature(lspserver: dict): void # Check whether LSP server supports signature help if !lspserver.isSignatureHelpProvider - util.ErrMsg('Error: LSP server does not support signature help') + util.ErrMsg('LSP server does not support signature help') return endif @@ -846,7 +846,7 @@ enddef def ShowReferences(lspserver: dict, peek: bool): void # Check whether LSP server supports getting reference information if !lspserver.isReferencesProvider - util.ErrMsg('Error: LSP server does not support showing references') + util.ErrMsg('LSP server does not support showing references') return endif @@ -859,7 +859,7 @@ def ShowReferences(lspserver: dict, peek: bool): void # Result: Location[] | null if reply->empty() || reply.result->empty() - util.WarnMsg('Error: No references found') + util.WarnMsg('No references found') return endif @@ -904,7 +904,7 @@ enddef def DocHighlight(lspserver: dict, cmdmods: string): void # Check whether LSP server supports getting highlight information if !lspserver.isDocumentHighlightProvider - util.ErrMsg('Error: LSP server does not support document highlight') + util.ErrMsg('LSP server does not support document highlight') return endif @@ -921,7 +921,7 @@ enddef def GetDocSymbols(lspserver: dict, fname: string): void # Check whether LSP server supports getting document symbol information if !lspserver.isDocumentSymbolProvider - util.ErrMsg('Error: LSP server does not support getting list of symbols') + util.ErrMsg('LSP server does not support getting list of symbols') return endif @@ -941,7 +941,7 @@ def TextDocFormat(lspserver: dict, fname: string, rangeFormat: bool, start_lnum: number, end_lnum: number) # Check whether LSP server supports formatting documents if !lspserver.isDocumentFormattingProvider - util.ErrMsg('Error: LSP server does not support formatting documents') + util.ErrMsg('LSP server does not support formatting documents') return endif @@ -1023,7 +1023,7 @@ enddef def IncomingCalls(lspserver: dict, fname: string) # Check whether LSP server supports call hierarchy if !lspserver.isCallHierarchyProvider - util.ErrMsg('Error: LSP server does not support call hierarchy') + util.ErrMsg('LSP server does not support call hierarchy') return endif @@ -1046,7 +1046,7 @@ enddef def OutgoingCalls(lspserver: dict, fname: string) # Check whether LSP server supports call hierarchy if !lspserver.isCallHierarchyProvider - util.ErrMsg('Error: LSP server does not support call hierarchy') + util.ErrMsg('LSP server does not support call hierarchy') return endif @@ -1070,7 +1070,7 @@ enddef def InlayHintsShow(lspserver: dict) # Check whether LSP server supports type hierarchy if !lspserver.isInlayHintProvider && !lspserver.isClangdInlayHintsProvider - util.ErrMsg('Error: LSP server does not support inlay hint') + util.ErrMsg('LSP server does not support inlay hint') return endif @@ -1101,7 +1101,7 @@ enddef def TypeHiearchy(lspserver: dict, direction: number) # Check whether LSP server supports type hierarchy if !lspserver.isTypeHierarchyProvider - util.ErrMsg('Error: LSP server does not support type hierarchy') + util.ErrMsg('LSP server does not support type hierarchy') return endif @@ -1126,7 +1126,7 @@ enddef def RenameSymbol(lspserver: dict, newName: string) # Check whether LSP server supports rename operation if !lspserver.isRenameProvider - util.ErrMsg('Error: LSP server does not support rename operation') + util.ErrMsg('LSP server does not support rename operation') return endif @@ -1154,7 +1154,7 @@ def CodeAction(lspserver: dict, fname_arg: string, line1: number, line2: number, query: string) # Check whether LSP server supports code action operation if !lspserver.isCodeActionProvider - util.ErrMsg('Error: LSP server does not support code action operation') + util.ErrMsg('LSP server does not support code action operation') return endif @@ -1197,14 +1197,14 @@ enddef def CodeLens(lspserver: dict, fname: string) # Check whether LSP server supports code lens operation if !lspserver.isCodeLensProvider - util.ErrMsg('Error: LSP server does not support code lens operation') + util.ErrMsg('LSP server does not support code lens operation') return endif var params = {textDocument: {uri: util.LspFileToUri(fname)}} var reply = lspserver.rpc('textDocument/codeLens', params) if reply->empty() || reply.result->empty() - util.WarnMsg($'Error: No code lens actions found for the current file') + util.WarnMsg($'No code lens actions found for the current file') return endif @@ -1230,7 +1230,7 @@ enddef def WorkspaceQuerySymbols(lspserver: dict, query: string) # Check whether the LSP server supports listing workspace symbols if !lspserver.isWorkspaceSymbolProvider - util.ErrMsg('Error: LSP server does not support listing workspace symbols') + util.ErrMsg('LSP server does not support listing workspace symbols') return endif @@ -1239,7 +1239,7 @@ def WorkspaceQuerySymbols(lspserver: dict, query: string) param.query = query var reply = lspserver.rpc('workspace/symbol', param) if reply->empty() || reply.result->empty() - util.WarnMsg($'Error: Symbol "{query}" is not found') + util.WarnMsg($'Symbol "{query}" is not found') return endif @@ -1252,12 +1252,12 @@ def AddWorkspaceFolder(lspserver: dict, dirName: string): void || !lspserver.caps.workspace->has_key('workspaceFolders') || !lspserver.caps.workspace.workspaceFolders->has_key('supported') || !lspserver.caps.workspace.workspaceFolders.supported - util.ErrMsg('Error: LSP server does not support workspace folders') + util.ErrMsg('LSP server does not support workspace folders') return endif if lspserver.workspaceFolders->index(dirName) != -1 - util.ErrMsg($'Error: {dirName} is already part of this workspace') + util.ErrMsg($'{dirName} is already part of this workspace') return endif @@ -1275,13 +1275,13 @@ def RemoveWorkspaceFolder(lspserver: dict, dirName: string): void || !lspserver.caps.workspace->has_key('workspaceFolders') || !lspserver.caps.workspace.workspaceFolders->has_key('supported') || !lspserver.caps.workspace.workspaceFolders.supported - util.ErrMsg('Error: LSP server does not support workspace folders') + util.ErrMsg('LSP server does not support workspace folders') return endif var idx: number = lspserver.workspaceFolders->index(dirName) if idx == -1 - util.ErrMsg($'Error: {dirName} is not currently part of this workspace') + util.ErrMsg($'{dirName} is not currently part of this workspace') return endif @@ -1299,7 +1299,7 @@ enddef def SelectionRange(lspserver: dict, fname: string) # Check whether LSP server supports selection ranges if !lspserver.isSelectionRangeProvider - util.ErrMsg('Error: LSP server does not support selection ranges') + util.ErrMsg('LSP server does not support selection ranges') return endif @@ -1325,7 +1325,7 @@ enddef def SelectionExpand(lspserver: dict) # Check whether LSP server supports selection ranges if !lspserver.isSelectionRangeProvider - util.ErrMsg('Error: LSP server does not support selection ranges') + util.ErrMsg('LSP server does not support selection ranges') return endif @@ -1336,7 +1336,7 @@ enddef def SelectionShrink(lspserver: dict) # Check whether LSP server supports selection ranges if !lspserver.isSelectionRangeProvider - util.ErrMsg('Error: LSP server does not support selection ranges') + util.ErrMsg('LSP server does not support selection ranges') return endif @@ -1349,7 +1349,7 @@ enddef def FoldRange(lspserver: dict, fname: string) # Check whether LSP server supports fold ranges if !lspserver.isFoldingRangeProvider - util.ErrMsg('Error: LSP server does not support folding') + util.ErrMsg('LSP server does not support folding') return endif diff --git a/autoload/lsp/textedit.vim b/autoload/lsp/textedit.vim index 4fdc615..7a30137 100644 --- a/autoload/lsp/textedit.vim +++ b/autoload/lsp/textedit.vim @@ -189,7 +189,7 @@ enddef def ApplyTextDocumentEdit(textDocEdit: dict) var bnr: number = bufnr(util.LspUriToFile(textDocEdit.textDocument.uri)) if bnr == -1 - util.ErrMsg($'Error: Text Document edit, buffer {textDocEdit.textDocument.uri} is not found') + util.ErrMsg($'Text Document edit, buffer {textDocEdit.textDocument.uri} is not found') return endif ApplyTextEdits(bnr, textDocEdit.edits) @@ -200,7 +200,7 @@ export def ApplyWorkspaceEdit(workspaceEdit: dict) if workspaceEdit->has_key('documentChanges') for change in workspaceEdit.documentChanges if change->has_key('kind') - util.ErrMsg($'Error: Unsupported change in workspace edit [{change.kind}]') + util.ErrMsg($'Unsupported change in workspace edit [{change.kind}]') else ApplyTextDocumentEdit(change) endif diff --git a/autoload/lsp/util.vim b/autoload/lsp/util.vim index 39a3a47..dd02a1e 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -3,14 +3,14 @@ vim9script # Display a warning message export def WarnMsg(msg: string) :echohl WarningMsg - :echomsg msg + :echomsg $'Warn: [Lsp] {msg}' :echohl None enddef # Display an error message export def ErrMsg(msg: string) :echohl Error - :echomsg msg + :echomsg $'Error: [Lsp] {msg}' :echohl None enddef -- 2.50.0