]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Consistently use the colon prefix for Ex commands
authorYegappan Lakshmanan <yegappan@yahoo.com>
Tue, 28 Mar 2023 01:50:06 +0000 (18:50 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Tue, 28 Mar 2023 01:50:06 +0000 (18:50 -0700)
autoload/lsp/callhierarchy.vim
autoload/lsp/completion.vim
autoload/lsp/diag.vim
autoload/lsp/hover.vim
autoload/lsp/lsp.vim
autoload/lsp/outline.vim
autoload/lsp/signature.vim
autoload/lsp/symbol.vim
autoload/lsp/typehierarchy.vim
autoload/lsp/util.vim

index f0bce566f08f5e0cb689c91968b26199347afd73..6e57571d5a2b2d38545feb8b51799a2831b5e2d4 100644 (file)
@@ -132,15 +132,15 @@ def CallHierarchyTreeShow(incoming: bool, prepareItem: dict<any>,
     :setlocal nonumber nornu
     :setlocal fdc=0 signcolumn=no
 
-    nnoremap <buffer> <CR> <ScriptCmd>CallHierarchyItemJump()<CR>
-    nnoremap <buffer> - <ScriptCmd>CallHierarchyTreeItemOpen()<CR>
-    nnoremap <buffer> + <ScriptCmd>CallHierarchyTreeItemClose()<CR>
-    command -buffer LspCallHierarchyRefresh CallHierarchyTreeRefreshCmd()
-    command -buffer LspCallHierarchyIncoming CallHierarchyTreeIncomingCmd()
-    command -buffer LspCallHierarchyOutgoing CallHierarchyTreeOutgoingCmd()
-
-    syntax match Comment '^#.*$'
-    syntax match Directory '(.*)$'
+    :nnoremap <buffer> <CR> <ScriptCmd>CallHierarchyItemJump()<CR>
+    :nnoremap <buffer> - <ScriptCmd>CallHierarchyTreeItemOpen()<CR>
+    :nnoremap <buffer> + <ScriptCmd>CallHierarchyTreeItemClose()<CR>
+    :command -buffer LspCallHierarchyRefresh CallHierarchyTreeRefreshCmd()
+    :command -buffer LspCallHierarchyIncoming CallHierarchyTreeIncomingCmd()
+    :command -buffer LspCallHierarchyOutgoing CallHierarchyTreeOutgoingCmd()
+
+    :syntax match Comment '^#.*$'
+    :syntax match Directory '(.*)$'
   endif
 
   w:LspBufnr = save_bufnr
index 84867338d97fb0b88173adb5e0ae42b60306f9ed..cb84cf0fb41336d4cc9a730055e34fd96b6e69d6 100644 (file)
@@ -494,7 +494,7 @@ export def BufferInit(lspserver: dict<any>, bnr: number, ftype: string)
     endif
     # <Enter> in insert mode stops completion and inserts a <Enter>
     if !opt.lspOptions.noNewlineInCompletion
-      inoremap <expr> <buffer> <CR> pumvisible() ? "\<C-Y>\<CR>" : "\<CR>"
+      :inoremap <expr> <buffer> <CR> pumvisible() ? "\<C-Y>\<CR>" : "\<CR>"
     endif
   else
     if LspOmniComplEnabled(ftype)
index b4c72e67cb34f211401eda853dadb2d27e48a54d..c0ebade53c61639e4792359f175e5bb0caea421f 100644 (file)
@@ -123,7 +123,7 @@ export def DiagNotification(lspserver: dict<any>, uri: string, diags: list<dict<
 
   # Notify user scripts that diags has been updated
   if exists('#User#LspDiagsUpdated')
-    doautocmd <nomodeline> User LspDiagsUpdated
+    :doautocmd <nomodeline> User LspDiagsUpdated
   endif
 enddef
 
@@ -276,7 +276,7 @@ def DisplayDiag(diag: dict<any>)
     ShowDiagInPopup(diag)
   else
     # Display the diagnostic message in the status message area
-    echo diag.message
+    :echo diag.message
   endif
 enddef
 
@@ -307,9 +307,9 @@ export def ShowCurrentDiagInStatusLine(lspserver: dict<any>)
       code = $'[{diag.code}] '
     endif
     var msgNoLineBreak = code .. substitute(substitute(diag.message, "\n", ' ', ''), "\\n", ' ', '')
-    echo msgNoLineBreak[ : max_width]
+    :echo msgNoLineBreak[ : max_width]
   else
-    echo ''
+    :echo ''
   endif
 enddef
 
index fa7a5be103bd656f2e1666f384601158ad289e47..d429ffa0ec9313b19030dccdacb276b92610421a 100644 (file)
@@ -64,15 +64,15 @@ export def HoverReply(lspserver: dict<any>, hoverResult: any): void
   endif
 
   if opt.lspOptions.hoverInPreview
-    silent! pedit LspHoverReply
-    wincmd P
+    :silent! pedit LspHoverReply
+    :wincmd P
     :setlocal buftype=nofile
     :setlocal bufhidden=delete
     bufnr()->deletebufline(1, '$')
     hoverText->append(0)
     [1, 1]->cursor()
     exe $'setlocal ft={hoverKind}'
-    wincmd p
+    :wincmd p
   else
     var winid = hoverText->popup_atcursor({moved: 'word',
                                           maxwidth: 80,
index c6fc4b23733b4b955bbdedc2658f3efc3f36caad..9347a031fe449d10affd5c29552cbdc252559b7f 100644 (file)
@@ -765,7 +765,7 @@ export def Rename(a_newName: string)
     endif
 
     # clear the input prompt
-    echo "\r"
+    :echo "\r"
   endif
 
   lspserver.renameSymbol(newName)
@@ -798,7 +798,7 @@ export def SymbolSearch(queryArg: string)
       return
     endif
   endif
-  redraw!
+  :redraw!
 
   lspserver.workspaceQuery(query)
 enddef
@@ -810,7 +810,7 @@ export def ListWorkspaceFolders()
     return
   endif
 
-  echomsg $'Workspace Folders: {lspserver.workspaceFolders->string()}'
+  :echomsg $'Workspace Folders: {lspserver.workspaceFolders->string()}'
 enddef
 
 # Add a workspace folder. Default is to use the current folder.
index f36c2809286fa73869abf093063743719a59a7fc..266fc55db0daa7228ad7021b8614edc6444989de 100644 (file)
@@ -255,8 +255,8 @@ export def OpenOutlineWindow()
   :syntax keyword LSPTitle EnumMember Struct Event Operator TypeParameter
 
   if str2nr(&t_Co) > 2
-    highlight clear LSPTitle
-    highlight default link LSPTitle Title
+    :highlight clear LSPTitle
+    :highlight default link LSPTitle Title
   endif
 
   prop_type_add('LspOutlineHighlight', {bufnr: bufnr(), highlight: 'Search', override: true})
index 1d8f447efeaabc3c23cacb2bbc07a395427e6cc7..590718f88c357479799d2bd834828cf073ff7974 100644 (file)
@@ -73,13 +73,13 @@ export def SignatureHelp(lspserver: dict<any>, sighelp: any): void
     endif
   endif
   if opt.lspOptions.echoSignature
-    echon "\r\r"
-    echon ''
-    echon text->strpart(0, startcol)
-    echoh LineNr
-    echon text->strpart(startcol, hllen)
-    echoh None
-    echon text->strpart(startcol + hllen)
+    :echon "\r\r"
+    :echon ''
+    :echon text->strpart(0, startcol)
+    :echoh LineNr
+    :echon text->strpart(startcol, hllen)
+    :echoh None
+    :echon text->strpart(startcol + hllen)
   else
     # Close the previous signature popup and open a new one
     lspserver.signaturePopup->popup_close()
index 74fed32a58e2fab0edc1b2aa610452960921fd1b..db0b590ebf7591c0d3a8e0b7503a6641b396825c 100644 (file)
@@ -58,7 +58,7 @@ def FilterSymbols(lspserver: dict<any>, popupID: number, key: string): bool
     else
       []->setwinvar(popupID, 'LspSymbolTable')
     endif
-    echo $'Symbol: {query}'
+    :echo $'Symbol: {query}'
   endif
 
   # Update the workspace symbol query string
@@ -74,7 +74,7 @@ enddef
 # Jump to the location of a symbol selected in the popup menu
 def JumpToWorkspaceSymbol(popupID: number, result: number): void
   # clear the message displayed at the command-line
-  echo ''
+  :echo ''
 
   if result <= 0
     # popup is canceled
@@ -114,7 +114,7 @@ def JumpToWorkspaceSymbol(popupID: number, result: number): void
     endif
     # Set the previous cursor location mark. Instead of using setpos(), m' is
     # used so that the current location is added to the jump list.
-    normal m'
+    :normal m'
     setcursorcharpos(symTbl[result - 1].pos.line + 1,
                        symTbl[result - 1].pos.character + 1)
   catch
@@ -147,7 +147,7 @@ def ShowSymbolMenu(lspserver: dict<any>, query: string)
   prop_type_add('lspworkspacesymbol',
                        {bufnr: lspserver.workspaceSymbolPopup->winbufnr(),
                         highlight: 'Title'})
-  echo $'Symbol: {query}'
+  :echo $'Symbol: {query}'
 enddef
 
 # Convert a file name to <filename> (<dirname>) format.
@@ -260,9 +260,9 @@ def UpdatePeekFilePopup(lspserver: dict<any>, locations: list<dict<any>>)
 
   lspserver.peekSymbolFilePopup = popup_create(bnr, popupAttrs)
   var cmds =<< trim eval END
-    setlocal number
+    :setlocal number
     [{range.start.line + 1}, 1]->cursor()
-    normal! z.
+    :normal! z.
   END
   win_execute(lspserver.peekSymbolFilePopup, cmds)
 
@@ -441,7 +441,7 @@ def PeekSymbolLocation(lspserver: dict<any>, location: dict<any>)
   matchaddpos('Search', [pos], 10, 101, {window: pwid})
   var cmds =<< trim eval END
     [{range.start.line + 1}, 1]->cursor()
-    normal! z.
+    :normal! z.
   END
   win_execute(pwid, cmds, 'silent!')
 enddef
index d4048e67ca5599b5b2399fcce019f46e5b85a2ab..67c4965a6e51e2c51b45f216c4806b3580f38a66 100644 (file)
@@ -87,7 +87,7 @@ def UpdateTypeHierFileInPopup(lspserver: dict<any>, typeUriMap: list<dict<any>>)
   lspserver.typeHierFilePopup = popup_create(bnr, popupAttrs)
   var cmds =<< trim eval END
     [{typeUriMap[n].range.start.line + 1}, 1]->cursor()
-    normal! z.
+    :normal! z.
   END
   win_execute(lspserver.typeHierFilePopup, cmds)
 
index 9343d4e0008d38f0d34fe3506786d094e59ed8bb..f9e73f6e9ab071cdd22108089dba6ed7ab735e4c 100644 (file)
@@ -175,7 +175,7 @@ export def JumpToLspLocation(location: dict<any>, cmdmods: string)
     if bnr == bufnr()
       # Set the previous cursor location mark. Instead of using setpos(), m' is
       # used so that the current location is added to the jump list.
-      normal m'
+      :normal m'
     else
       var wid = fname->bufwinid()
       if wid != -1