]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
fix: tidy the echom msg to InfoMsg
authorshane.xb.qian <shane.qian@foxmail.com>
Sun, 16 Apr 2023 01:26:05 +0000 (09:26 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Sun, 16 Apr 2023 19:21:37 +0000 (03:21 +0800)
// based on #262

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
autoload/lsp/handlers.vim
autoload/lsp/lsp.vim

index b4219f51c5e6df156d58c11c747d6681afb8ff19..0a9fab686cdc4364ceac1d79f3ae971e6c2acc0b 100644 (file)
@@ -41,8 +41,13 @@ def ProcessShowMsgNotif(lspserver: dict<any>, reply: dict<any>)
     # them.
     return
   endif
-  var mtype = LspMsgTypeToString(reply.params.type)
-  :echomsg $'Lsp({lspserver.name}):[{mtype}]: {reply.params.message}'
+  if reply.params.type == 1
+    util.ErrMsg($'Lsp({lspserver.name}) {reply.params.message}')
+  elseif reply.params.type == 2
+    util.WarnMsg($'Lsp({lspserver.name}) {reply.params.message}')
+  elseif reply.params.type == 3
+    util.InfoMsg($'Lsp({lspserver.name}) {reply.params.message}')
+  endif
 enddef
 
 # process a log notification message from the LSP server
@@ -123,7 +128,7 @@ def ProcessApplyEditReq(lspserver: dict<any>, request: dict<any>)
   endif
   var workspaceEditParams: dict<any> = request.params
   if workspaceEditParams->has_key('label')
-    :echomsg $'Workspace edit {workspaceEditParams.label}'
+    util.InfoMsg($'Workspace edit {workspaceEditParams.label}')
   endif
   textedit.ApplyWorkspaceEdit(workspaceEditParams.edit)
   # TODO: Need to return the proper result of the edit operation
index 945ea47851322022af7a2aa77a6ab34b5c6ab398..5a332d612eb2fae93c2ef1b0ec6ac6b20d591656 100644 (file)
@@ -932,7 +932,7 @@ enddef
 export def ListWorkspaceFolders()
   var lspservers: list<dict<any>> = buf.CurbufGetServers()
   for lspserver in lspservers
-    :echomsg $'Workspace Folders: "{lspserver.name}" {lspserver.workspaceFolders->string()}'
+    util.InfoMsg($'Workspace Folders: "{lspserver.name}" {lspserver.workspaceFolders->string()}')
   endfor
 enddef