From: Yegappan Lakshmanan Date: Sun, 3 Jan 2021 15:04:37 +0000 (-0800) Subject: Minor refactoring X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=7b6baf368dee5e80e4ca70d27d809f4784b99a01;p=vim-lsp.git Minor refactoring --- diff --git a/autoload/lsp.vim b/autoload/lsp.vim index 044504d..a738bcd 100644 --- a/autoload/lsp.vim +++ b/autoload/lsp.vim @@ -640,7 +640,7 @@ def lsp#codeAction() enddef # Handle keys pressed when the workspace symbol popup menu is displayed -def LspFilterNames(lspserver: dict, popupID: number, key: string): bool +def s:filterSymbols(lspserver: dict, popupID: number, key: string): bool var key_handled: bool = false var update_popup: bool = false var query: string = lspserver.workspaceSymbolQuery @@ -699,7 +699,7 @@ def LspFilterNames(lspserver: dict, popupID: number, key: string): bool enddef # Jump to the location of a symbol selected in the popup menu -def LspJumpToSymbol(popupID: number, result: number): void +def s:jumpToSymbol(popupID: number, result: number): void # clear the message displayed at the command-line echo '' @@ -749,8 +749,8 @@ def s:showSymbolMenu(lspserver: dict, query: string) mapping: false, fixed: 1, close: "button", - filter: function('s:LspFilterNames', [lspserver]), - callback: LspJumpToSymbol + filter: function('s:filterSymbols', [lspserver]), + callback: function('s:jumpToSymbol') } lspserver.workspaceSymbolPopup = popup_menu([], popupAttr) lspserver.workspaceSymbolQuery = query @@ -762,7 +762,7 @@ enddef # Perform a workspace wide symbol lookup # Uses LSP "workspace/symbol" request -def lsp#showWorkspaceSymbols(queryArg: string) +def lsp#symbolSearch(queryArg: string) var ftype = &filetype if ftype == '' return diff --git a/plugin/lsp.vim b/plugin/lsp.vim index 3f79709..f2e396f 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -35,7 +35,7 @@ command! -nargs=0 -bar LspCalledBy call lsp#incomingCalls() command! -nargs=0 -bar LspCalling call lsp#outgoingCalls() command! -nargs=0 -bar LspRename call lsp#rename() command! -nargs=0 -bar LspCodeAction call lsp#codeAction() -command! -nargs=? -bar LspShowWorkspaceSymbols call lsp#showWorkspaceSymbols() +command! -nargs=? -bar LspSymbolSearch call lsp#symbolSearch() command! -nargs=0 -bar LspWorkspaceListFolders call lsp#listWorkspaceFolders() command! -nargs=1 -bar -complete=dir LspWorkspaceAddFolder call lsp#addWorkspaceFolder() command! -nargs=1 -bar -complete=dir LspWorkspaceRemoveFolder call lsp#removeWorkspaceFolder()