]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
feat: tidy err/wrn msg
authorshane.xb.qian <shane.qian@foxmail.com>
Sat, 15 Apr 2023 23:53:17 +0000 (07:53 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Sun, 16 Apr 2023 19:22:37 +0000 (03:22 +0800)
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
autoload/lsp/buffer.vim
autoload/lsp/codeaction.vim
autoload/lsp/completion.vim
autoload/lsp/diag.vim
autoload/lsp/handlers.vim
autoload/lsp/lsp.vim
autoload/lsp/lspserver.vim
autoload/lsp/textedit.vim
autoload/lsp/util.vim

index c34f9a929d99c6b097e26032defc2b914d2fe5c9..455e6920f9ea03f3415e1c9f0f54b66b26b64aea 100644 (file)
@@ -157,15 +157,15 @@ export def CurbufGetServerChecked(domain: string = null_string): dict<any>
 
   var lspserver: dict<any> = 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
 
index faa11bd3e8f793f7d24f3cb9468ab46ce27e9441..2c1680e0cd84fff79b3f298e8b7c2aa2abd4d80b 100644 (file)
@@ -18,7 +18,7 @@ export def DoCommand(lspserver: dict<any>, cmd: dict<any>)
     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)
index 9159e10dc4e10849fb49b7be08bb9619c34de07d..75e0a7836570fab00fe0318d32cc9ed63ff253eb 100644 (file)
@@ -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
index 1d28a40e0d00200cf94cd4adb89663a855fdbbc2..8dec2dc4938453db61847792db7f77348c6c2fbb 100644 (file)
@@ -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
 
index b4219f51c5e6df156d58c11c747d6681afb8ff19..2c840482f7023a7621472b2250aa1c759386dc9e 100644 (file)
@@ -10,7 +10,7 @@ import './textedit.vim'
 
 # Process various reply messages from the LSP server
 export def ProcessReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): 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<any>, reply: dict<any>)
-  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<any>, reply: dict<any>): 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<any>, request: dict<any>)
 enddef
 
 def ProcessUnsupportedReq(lspserver: dict<any>, request: dict<any>)
-  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<any>, request: dict<any>)
   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<any>): 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<any>): 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
 
index 945ea47851322022af7a2aa77a6ab34b5c6ab398..b2db8b2f2f9cd727e56e4a9475e93d788390d585 100644 (file)
@@ -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<dict<any>>)
   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<dict<any>>)
 
     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<string> = []
     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<dict<any>>)
     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<dict<any>>)
        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
 
index 6f4f559fba5268d6bb409d170c4497669a90e157..aa192ed729fe4b5e4eb40edac1858b1fe01f1261 100644 (file)
@@ -75,7 +75,7 @@ def StartServer(lspserver: dict<any>, 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<any>, request: dict<any>, 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<any> = lspserver.createResponse(
@@ -383,7 +383,7 @@ def Rpc(lspserver: dict<any>, 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<any>, 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<any>, 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<any>, item: dict<any>): 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>)
   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<any>): 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>)
   # 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>, 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<any>)
   # 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<any>)
   # 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<any>, 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
 
index 4fdc615824a8a0efbd4e0be1d592145b315246d8..7a30137ae398c9f279fe82499bd3d4123d545c83 100644 (file)
@@ -189,7 +189,7 @@ enddef
 def ApplyTextDocumentEdit(textDocEdit: dict<any>)
   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<any>)
   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
index 39a3a478d4d9529872efc81306bd0392302aa423..dd02a1ebbb60bfb34fe39ba09cb3a613b9e11b1f 100644 (file)
@@ -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