From: Yegappan Lakshmanan Date: Wed, 16 Feb 2022 04:22:07 +0000 (-0800) Subject: Remove s: prefix in a few more places X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d4ee61a8468b902a0bd9c4bd559ef2437b6a6466;p=vim-lsp.git Remove s: prefix in a few more places --- diff --git a/autoload/handlers.vim b/autoload/handlers.vim index ca789e1..ce0b20c 100644 --- a/autoload/handlers.vim +++ b/autoload/handlers.vim @@ -673,28 +673,28 @@ enddef export def ProcessReply(lspserver: dict, req: dict, reply: dict): void var lsp_reply_handlers: dict = { - '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, reply: dict): void var lsp_notif_handlers: dict = { - '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, request: dict) var lspRequestHandlers: dict = { - '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) diff --git a/autoload/lspserver.vim b/autoload/lspserver.vim index 397ff55..6d9f1e8 100644 --- a/autoload/lspserver.vim +++ b/autoload/lspserver.vim @@ -454,7 +454,7 @@ def GotoDefinition(lspserver: dict, 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, 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, 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, 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): 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): 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, 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): 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, fname: string) # interface CallHierarchyPrepareParams # interface TextDocumentPositionParams - req.params->extend(s:GetLspTextDocPosition()) + req.params->extend(GetLspTextDocPosition()) lspserver.sendMessage(req) enddef diff --git a/autoload/outline.vim b/autoload/outline.vim index af549f9..d66c676 100644 --- a/autoload/outline.vim +++ b/autoload/outline.vim @@ -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 q :quit - :nnoremap :call outlineJumpToSymbol() + :nnoremap :call OutlineJumpToSymbol() :setlocal nomodifiable # highlight all the symbol types diff --git a/autoload/symbol.vim b/autoload/symbol.vim index 8e9cacf..9f96445 100644 --- a/autoload/symbol.vim +++ b/autoload/symbol.vim @@ -150,8 +150,8 @@ export def ShowSymbolMenu(lspserver: dict, 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 diff --git a/autoload/textedit.vim b/autoload/textedit.vim index 9da069a..b57addc 100644 --- a/autoload/textedit.vim +++ b/autoload/textedit.vim @@ -153,7 +153,7 @@ export def ApplyTextEdits(bnr: number, text_edits: list>): 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 = bnr->getbufline(start_line + 1, finish_line + 1) var fix_eol: bool = bnr->getbufvar('&fixeol') @@ -218,7 +218,7 @@ export def ApplyWorkspaceEdit(workspaceEdit: dict) if change->has_key('kind') util.ErrMsg('Error: Unsupported change in workspace edit [' .. change.kind .. ']') else - s:ApplyTextDocumentEdit(change) + ApplyTextDocumentEdit(change) endif endfor return diff --git a/plugin/lsp.vim b/plugin/lsp.vim index a9b51d5..83b98d7 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -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() 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() diff --git a/test/run_tests.sh b/test/run_tests.sh index 4285d6f..8116044 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -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