]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Remove s: prefix in a few more places
authorYegappan Lakshmanan <yegappan@yahoo.com>
Wed, 16 Feb 2022 04:22:07 +0000 (20:22 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Wed, 16 Feb 2022 04:22:07 +0000 (20:22 -0800)
autoload/handlers.vim
autoload/lspserver.vim
autoload/outline.vim
autoload/symbol.vim
autoload/textedit.vim
plugin/lsp.vim
test/run_tests.sh

index ca789e13297da93de75f76d8966d351e9f074a2b..ce0b20c62a6099e4e50574c183482e370901d7de 100644 (file)
@@ -673,28 +673,28 @@ enddef
 export def ProcessReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   var lsp_reply_handlers: dict<func> =
     {
-      'initialize': function('s:ProcessInitializeReply'),
-      'textDocument/definition': function('s:ProcessDefDeclReply'),
-      'textDocument/declaration': function('s:ProcessDefDeclReply'),
-      'textDocument/typeDefinition': function('s:ProcessDefDeclReply'),
-      'textDocument/implementation': function('s:ProcessDefDeclReply'),
-      'textDocument/signatureHelp': function('s:ProcessSignaturehelpReply'),
-      'textDocument/completion': function('s:ProcessCompletionReply'),
-      'textDocument/hover': function('s:ProcessHoverReply'),
-      'textDocument/references': function('s:ProcessReferencesReply'),
-      'textDocument/documentHighlight': function('s:ProcessDocHighlightReply'),
-      'textDocument/documentSymbol': function('s:ProcessDocSymbolReply'),
-      'textDocument/formatting': function('s:ProcessFormatReply'),
-      'textDocument/rangeFormatting': function('s:ProcessFormatReply'),
-      'textDocument/rename': function('s:ProcessRenameReply'),
-      'textDocument/codeAction': function('s:ProcessCodeActionReply'),
-      'textDocument/selectionRange': function('s:ProcessSelectionRangeReply'),
-      'textDocument/foldingRange': function('s:ProcessFoldingRangeReply'),
-      'workspace/executeCommand': function('s:ProcessWorkspaceExecuteReply'),
-      'workspace/symbol': function('s:ProcessWorkspaceSymbolReply'),
-      'textDocument/prepareCallHierarchy': function('s:ProcessPrepareCallHierarchy'),
-      'callHierarchy/incomingCalls': function('s:ProcessIncomingCalls'),
-      'callHierarchy/outgoingCalls': function('s:ProcessOutgoingCalls')
+      'initialize': function('ProcessInitializeReply'),
+      'textDocument/definition': function('ProcessDefDeclReply'),
+      'textDocument/declaration': function('ProcessDefDeclReply'),
+      'textDocument/typeDefinition': function('ProcessDefDeclReply'),
+      'textDocument/implementation': function('ProcessDefDeclReply'),
+      'textDocument/signatureHelp': function('ProcessSignaturehelpReply'),
+      'textDocument/completion': function('ProcessCompletionReply'),
+      'textDocument/hover': function('ProcessHoverReply'),
+      'textDocument/references': function('ProcessReferencesReply'),
+      'textDocument/documentHighlight': function('ProcessDocHighlightReply'),
+      'textDocument/documentSymbol': function('ProcessDocSymbolReply'),
+      'textDocument/formatting': function('ProcessFormatReply'),
+      'textDocument/rangeFormatting': function('ProcessFormatReply'),
+      'textDocument/rename': function('ProcessRenameReply'),
+      'textDocument/codeAction': function('ProcessCodeActionReply'),
+      'textDocument/selectionRange': function('ProcessSelectionRangeReply'),
+      'textDocument/foldingRange': function('ProcessFoldingRangeReply'),
+      'workspace/executeCommand': function('ProcessWorkspaceExecuteReply'),
+      'workspace/symbol': function('ProcessWorkspaceSymbolReply'),
+      'textDocument/prepareCallHierarchy': function('ProcessPrepareCallHierarchy'),
+      'callHierarchy/incomingCalls': function('ProcessIncomingCalls'),
+      'callHierarchy/outgoingCalls': function('ProcessOutgoingCalls')
     }
 
   if lsp_reply_handlers->has_key(req.method)
@@ -757,14 +757,14 @@ enddef
 export def ProcessNotif(lspserver: dict<any>, reply: dict<any>): void
   var lsp_notif_handlers: dict<func> =
     {
-      'window/showMessage': function('s:ProcessShowMsgNotif'),
-      'window/logMessage': function('s:ProcessLogMsgNotif'),
-      'textDocument/publishDiagnostics': function('s:ProcessDiagNotif'),
-      '$/progress': function('s:ProcessUnsupportedNotif'),
-      'telemetry/event': function('s:ProcessUnsupportedNotif'),
+      'window/showMessage': function('ProcessShowMsgNotif'),
+      'window/logMessage': function('ProcessLogMsgNotif'),
+      'textDocument/publishDiagnostics': function('ProcessDiagNotif'),
+      '$/progress': function('ProcessUnsupportedNotif'),
+      'telemetry/event': function('ProcessUnsupportedNotif'),
       # Java language server sends the 'language/status' notification which is
       # not in the LSP specification
-      'language/status': function('s:IgnoreNotif')
+      'language/status': function('IgnoreNotif')
     }
 
   if lsp_notif_handlers->has_key(reply.method)
@@ -799,14 +799,14 @@ enddef
 export def ProcessRequest(lspserver: dict<any>, request: dict<any>)
   var lspRequestHandlers: dict<func> =
     {
-      'workspace/applyEdit': function('s:ProcessApplyEditReq'),
-      'window/workDoneProgress/create': function('s:ProcessUnsupportedReq'),
-      'client/registerCapability': function('s:ProcessUnsupportedReq'),
-      'client/unregisterCapability': function('s:ProcessUnsupportedReq'),
-      'workspace/workspaceFolders': function('s:ProcessUnsupportedReq'),
-      'workspace/configuration': function('s:ProcessUnsupportedReq'),
-      'workspace/codeLens/refresh': function('s:ProcessUnsupportedReq'),
-      'workspace/semanticTokens/refresh': function('s:ProcessUnsupportedReq')
+      'workspace/applyEdit': function('ProcessApplyEditReq'),
+      'window/workDoneProgress/create': function('ProcessUnsupportedReq'),
+      'client/registerCapability': function('ProcessUnsupportedReq'),
+      'client/unregisterCapability': function('ProcessUnsupportedReq'),
+      'workspace/workspaceFolders': function('ProcessUnsupportedReq'),
+      'workspace/configuration': function('ProcessUnsupportedReq'),
+      'workspace/codeLens/refresh': function('ProcessUnsupportedReq'),
+      'workspace/semanticTokens/refresh': function('ProcessUnsupportedReq')
     }
 
   if lspRequestHandlers->has_key(request.method)
index 397ff5590f6a93441dba34714438cca4e9b6d7ad..6d9f1e895be5d6ec04fd15c808ab5470eab14c00 100644 (file)
@@ -454,7 +454,7 @@ def GotoDefinition(lspserver: dict<any>, peek: bool)
   var req = lspserver.createRequest('textDocument/definition')
   # interface DefinitionParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
   lspserver.sendMessage(req)
 
   lspserver.waitForReponse(req)
@@ -478,7 +478,7 @@ def GotoDeclaration(lspserver: dict<any>, peek: bool): void
 
   # interface DeclarationParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -503,7 +503,7 @@ def GotoTypeDef(lspserver: dict<any>, peek: bool): void
 
   # interface TypeDefinitionParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -528,7 +528,7 @@ def GotoImplementation(lspserver: dict<any>, peek: bool): void
 
   # interface ImplementationParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -548,7 +548,7 @@ def ShowSignature(lspserver: dict<any>): void
   var req = lspserver.createRequest('textDocument/signatureHelp')
   # interface SignatureHelpParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -587,7 +587,7 @@ def Hover(lspserver: dict<any>): void
   var req = lspserver.createRequest('textDocument/hover')
   # interface HoverParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
   lspserver.sendMessage(req)
   if exists('g:LSPTest') && g:LSPTest
     # When running LSP tests, make this a synchronous call
@@ -608,7 +608,7 @@ def ShowReferences(lspserver: dict<any>, peek: bool): void
   var req = lspserver.createRequest('textDocument/references')
   # interface ReferenceParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
   req.params->extend({context: {includeDeclaration: true}})
 
   lspserver.peekSymbol = peek
@@ -632,7 +632,7 @@ def DocHighlight(lspserver: dict<any>): void
   var req = lspserver.createRequest('textDocument/documentHighlight')
   # interface DocumentHighlightParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
   lspserver.sendMessage(req)
   if exists('g:LSPTest') && g:LSPTest
     # When running LSP tests, make this a synchronous call
@@ -729,7 +729,7 @@ def PrepareCallHierarchy(lspserver: dict<any>, fname: string)
 
   # interface CallHierarchyPrepareParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:GetLspTextDocPosition())
+  req.params->extend(GetLspTextDocPosition())
   lspserver.sendMessage(req)
 enddef
 
index af549f929007b7cfbdb76c9d398d87ce3c94793d..d66c676c0ea5e506faecde274e1dd228046bef45 100644 (file)
@@ -99,7 +99,7 @@ def AddSymbolText(bnr: number,
                        col: start_col})
       s.outlineLine = lnumMap->len()
       if s->has_key('children') && !s.children->empty()
-       s:AddSymbolText(bnr, s.children, prefix, text, lnumMap, true)
+       AddSymbolText(bnr, s.children, prefix, text, lnumMap, true)
       endif
     endfor
   endfor
@@ -259,7 +259,7 @@ export def OpenOutlineWindow()
   :setlocal foldmethod=indent
   setline(1, ['# File Outline'])
   :nnoremap <silent> <buffer> q :quit<CR>
-  :nnoremap <silent> <buffer> <CR> :call <SID>outlineJumpToSymbol()<CR>
+  :nnoremap <silent> <buffer> <CR> :call <SID>OutlineJumpToSymbol()<CR>
   :setlocal nomodifiable
 
   # highlight all the symbol types
index 8e9cacf3abd93d5645d10a534d2ed28e72cd32a5..9f9644583d61abc6f5ebe6db588433e1e27f54e7 100644 (file)
@@ -150,8 +150,8 @@ export def ShowSymbolMenu(lspserver: dict<any>, query: string)
       mapping: false,
       fixed: 1,
       close: "button",
-      filter: function('s:filterSymbols', [lspserver]),
-      callback: function('s:jumpToWorkspaceSymbol')
+      filter: function('s:FilterSymbols', [lspserver]),
+      callback: function('s:JumpToWorkspaceSymbol')
   }
   lspserver.workspaceSymbolPopup = popup_menu([], popupAttr)
   lspserver.workspaceSymbolQuery = query
index 9da069a78d4e05067b2e3f863768a571157f85a6..b57addcabe863ec568eb2bc2fa919eec330d39d9 100644 (file)
@@ -153,7 +153,7 @@ export def ApplyTextEdits(bnr: number, text_edits: list<dict<any>>): void
 
   # Reverse sort the edit operations by descending line and column numbers so
   # that they can be applied without interfering with each other.
-  updated_edits->sort('s:Edit_sort_func')
+  updated_edits->sort('Edit_sort_func')
 
   var lines: list<string> = bnr->getbufline(start_line + 1, finish_line + 1)
   var fix_eol: bool = bnr->getbufvar('&fixeol')
@@ -218,7 +218,7 @@ export def ApplyWorkspaceEdit(workspaceEdit: dict<any>)
       if change->has_key('kind')
        util.ErrMsg('Error: Unsupported change in workspace edit [' .. change.kind .. ']')
       else
-       s:ApplyTextDocumentEdit(change)
+       ApplyTextDocumentEdit(change)
       endif
     endfor
     return
index a9b51d5032230fc8cf6a2d24773ebd6c25040bab..83b98d7a7d92b2318bb38b88f61ab808993c1bb9 100644 (file)
@@ -227,8 +227,8 @@ augroup END
 # autocmd VimLeavePre * call TstopAllServers()
 
 # LSP commands
-command! -nargs=0 -bar LspShowServers call s:TshowServers()
-command! -nargs=0 -bar LspShowServerCapabilities call s:TshowServerCapabilities()
+command! -nargs=0 -bar LspShowServers call TshowServers()
+command! -nargs=0 -bar LspShowServerCapabilities call TshowServerCapabilities()
 command! -nargs=1 -bar LspSetTrace call TsetTraceServer(<q-args>)
 command! -nargs=0 -bar LspGotoDefinition call TgotoDefinition(v:false)
 command! -nargs=0 -bar LspGotoDeclaration call TgotoDeclaration(v:false)
@@ -246,8 +246,8 @@ command! -nargs=0 -bar LspDiagNext call TjumpToDiag('next')
 command! -nargs=0 -bar LspDiagPrev call TjumpToDiag('prev')
 command! -nargs=0 -bar LspDiagHighlightEnable call TdiagHighlightEnable()
 command! -nargs=0 -bar LspDiagHighlightDisable call TdiagHighlightDisable()
-command! -nargs=0 -bar LspShowReferences call s:TshowReferences(v:false)
-command! -nargs=0 -bar LspPeekReferences call s:TshowReferences(v:true)
+command! -nargs=0 -bar LspShowReferences call TshowReferences(v:false)
+command! -nargs=0 -bar LspPeekReferences call TshowReferences(v:true)
 command! -nargs=0 -bar LspHighlight call LspDocHighlight()
 command! -nargs=0 -bar LspHighlightClear call LspDocHighlightClear()
 command! -nargs=0 -bar LspOutline call Toutline()
index 4285d6f423100e39b5a2bfe41851178a45442c93..811604424ff131b04dd1ebf3aa668bb3df846774 100755 (executable)
@@ -2,15 +2,20 @@
 
 # Script to run the unit-tests for the LSP Vim plugin
 
-#VIMPRG=${VIMPRG:=/usr/bin/vim}
-export VIMRUNTIME=/home/yega/Documents/vim/cmdexpand/vim/runtime
-VIMPRG=/home/yega/Documents/vim/cmdexpand/vim/src/vim
+VIMPRG=${VIMPRG:=/usr/bin/vim}
 VIM_CMD="$VIMPRG -u NONE -U NONE -i NONE --noplugin -N --not-a-term"
 
 $VIM_CMD -S unit_tests.vim
 
 echo "LSP unit test results:"
 echo
+
+if [ ! -f results.txt ]
+then
+  echo "ERROR: Test results file 'results.txt' is not found"
+  exit 1
+fi
+
 cat results.txt
 
 echo