]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Remove s: prefix from script-local functions
authorYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 10 Feb 2022 04:50:03 +0000 (20:50 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 10 Feb 2022 04:50:03 +0000 (20:50 -0800)
autoload/callhierarchy.vim
autoload/diag.vim
autoload/handlers.vim
autoload/lsp.vim
autoload/lspserver.vim
autoload/outline.vim
autoload/selection.vim
autoload/signature.vim
autoload/symbol.vim
autoload/textedit.vim
plugin/lsp.vim

index 9ccc71a30f1862471745cb719acbed3af5a4fcea..aaa5c40e0cb094ac0331c55ac1ca36d73a117deb 100644 (file)
@@ -19,7 +19,7 @@ else
   util.GetLineByteFromPos = GetLineByteFromPos
 endif
 
-def s:CreateLoclistWithCalls(calls: list<dict<any>>, incoming: bool)
+def CreateLoclistWithCalls(calls: list<dict<any>>, incoming: bool)
   var qflist: list<dict<any>> = []
 
   for item in calls
index 9780cd9ec94cc56f4b3ece8022111a784a0f42b5..7310d43636f8dfe4cb3467cb4eb5e22ea0ff72f8 100644 (file)
@@ -32,7 +32,7 @@ export def DiagRemoveFile(lspserver: dict<any>, bnr: number)
   endif
 enddef
 
-def s:DiagSevToSignName(severity: number): string
+def DiagSevToSignName(severity: number): string
   var typeMap: list<string> = ['LspDiagError', 'LspDiagWarning',
                                                'LspDiagInfo', 'LspDiagHint']
   if severity > 4
@@ -140,7 +140,7 @@ export def DiagsGetErrorCount(lspserver: dict<any>): dict<number>
 enddef
 
 # Map the LSP DiagnosticSeverity to a quickfix type character
-def s:DiagSevToQfType(severity: number): string
+def DiagSevToQfType(severity: number): string
   var typeMap: list<string> = ['E', 'W', 'I', 'N']
 
   if severity > 4
@@ -221,7 +221,7 @@ export def GetDiagByLine(lspserver: dict<any>, bnr: number, lnum: number): dict<
 enddef
 
 # sort the diaganostics messages for a buffer by line number
-def s:GetSortedDiagLines(lspsrv: dict<any>, bnr: number): list<number>
+def GetSortedDiagLines(lspsrv: dict<any>, bnr: number): list<number>
   # create a list of line numbers from the diag map keys
   var lnums: list<number> =
                lspsrv.diagsMap[bnr]->keys()->mapnew((_, v) => v->str2nr())
index f073f3194b08885f415c3163e3f0b4b47eba8925..e635016c2d5e35b8071ac90d122af80c6c7dc623 100644 (file)
@@ -83,7 +83,7 @@ endif
 
 # process the 'initialize' method reply from the LSP server
 # Result: InitializeResult
-def s:ProcessInitializeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessInitializeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   if reply.result->len() <= 0
     return
   endif
@@ -126,7 +126,7 @@ enddef
 # 'textDocument/typeDefinition' and 'textDocument/implementation' replies from
 # the LSP server
 # Result: Location | Location[] | LocationLink[] | null
-def s:ProcessDefDeclReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessDefDeclReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   var location: dict<any>
   if reply.result->type() == v:t_list
     if !reply.result->empty()
@@ -143,7 +143,7 @@ enddef
 
 # process the 'textDocument/signatureHelp' reply from the LSP server
 # Result: SignatureHelp | null
-def s:ProcessSignaturehelpReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessSignaturehelpReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   signature.SignatureDisplay(lspserver, reply.result)
 enddef
 
@@ -184,7 +184,7 @@ enddef
 
 # process the 'textDocument/completion' reply from the LSP server
 # Result: CompletionItem[] | CompletionList | null
-def s:ProcessCompletionReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessCompletionReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   if reply.result->empty()
     return
   endif
@@ -274,7 +274,7 @@ enddef
 
 # process the 'textDocument/hover' reply from the LSP server
 # Result: Hover | null
-def s:ProcessHoverReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessHoverReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   if reply.result->empty()
     return
   endif
@@ -337,13 +337,13 @@ enddef
 
 # process the 'textDocument/references' reply from the LSP server
 # Result: Location[] | null
-def s:ProcessReferencesReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessReferencesReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   symbol.ShowReferences(lspserver, reply.result)
 enddef
 
 # process the 'textDocument/documentHighlight' reply from the LSP server
 # Result: DocumentHighlight[] | null
-def s:ProcessDocHighlightReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessDocHighlightReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   if reply.result->empty()
     return
   endif
@@ -387,7 +387,7 @@ def LspSymbolKindToName(symkind: number): string
 enddef
 
 # process SymbolInformation[]
-def s:ProcessSymbolInfoTable(symbolInfoTable: list<dict<any>>,
+def ProcessSymbolInfoTable(symbolInfoTable: list<dict<any>>,
                                symbolTypeTable: dict<list<dict<any>>>,
                                symbolLineTable: list<dict<any>>)
   var fname: string
@@ -417,7 +417,7 @@ def s:ProcessSymbolInfoTable(symbolInfoTable: list<dict<any>>,
 enddef
 
 # process DocumentSymbol[]
-def s:ProcessDocSymbolTable(docSymbolTable: list<dict<any>>,
+def ProcessDocSymbolTable(docSymbolTable: list<dict<any>>,
                                symbolTypeTable: dict<list<dict<any>>>,
                                symbolLineTable: list<dict<any>>)
   var symbolType: string
@@ -451,7 +451,7 @@ enddef
 # process the 'textDocument/documentSymbol' reply from the LSP server
 # Open a symbols window and display the symbols as a tree
 # Result: DocumentSymbol[] | SymbolInformation[] | null
-def s:ProcessDocSymbolReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+def ProcessDocSymbolReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
   var fname: string
   var symbolTypeTable: dict<list<dict<any>>> = {}
   var symbolLineTable: list<dict<any>> = []
@@ -481,7 +481,7 @@ enddef
 
 # process the 'textDocument/formatting' reply from the LSP server
 # Result: TextEdit[] | null
-def s:ProcessFormatReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessFormatReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   if reply.result->empty()
     # nothing to format
     return
@@ -506,7 +506,7 @@ enddef
 # Reply: 'textDocument/rename'
 # Result: Range | { range: Range, placeholder: string }
 #              | { defaultBehavior: boolean } | null
-def s:ProcessRenameReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessRenameReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   if reply.result->empty()
     # nothing to rename
     return
@@ -518,19 +518,19 @@ enddef
 
 # process the 'textDocument/codeAction' reply from the LSP server
 # Result: (Command | CodeAction)[] | null
-def s:ProcessCodeActionReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessCodeActionReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   codeaction.ApplyCodeAction(lspserver, reply.result)
 enddef
 
 # Reply: 'textDocument/selectionRange'
 # Result: SelectionRange[] | null
-def s:ProcessSelectionRangeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessSelectionRangeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   selection.SelectionStart(lspserver, reply.result)
 enddef
 
 # Reply: 'textDocument/foldingRange'
 # Result: FoldingRange[] | null
-def s:ProcessFoldingRangeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessFoldingRangeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   if reply.result->empty()
     return
   endif
@@ -556,7 +556,7 @@ enddef
 
 # process the 'workspace/executeCommand' reply from the LSP server
 # Result: any | null
-def s:ProcessWorkspaceExecuteReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessWorkspaceExecuteReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   if reply.result->empty()
     return
   endif
@@ -566,7 +566,7 @@ enddef
 
 # Convert a file name <filename> (<dirname>) format.
 # Make sure the popup does't occupy the entire screen by reducing the width.
-def s:MakeMenuName(popupWidth: number, fname: string): string
+def MakeMenuName(popupWidth: number, fname: string): string
   var filename: string = fname->fnamemodify(':t')
   var flen: number = filename->len()
   var dirname: string = fname->fnamemodify(':h')
@@ -587,7 +587,7 @@ enddef
 
 # process the 'workspace/symbol' reply from the LSP server
 # Result: SymbolInformation[] | null
-def s:ProcessWorkspaceSymbolReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessWorkspaceSymbolReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   var symbols: list<dict<any>> = []
   var symbolType: string
   var fileName: string
@@ -628,7 +628,7 @@ enddef
 
 # process the 'textDocument/prepareCallHierarchy' reply from the LSP server
 # Result: CallHierarchyItem[] | null
-def s:ProcessPrepareCallHierarchy(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessPrepareCallHierarchy(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   if reply.result->empty()
     if lspserver.callHierarchyType == 'incoming'
       util.WarnMsg('No incoming calls')
@@ -659,13 +659,13 @@ enddef
 
 # process the 'callHierarchy/incomingCalls' reply from the LSP server
 # Result: CallHierarchyIncomingCall[] | null
-def s:ProcessIncomingCalls(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessIncomingCalls(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   callhier.IncomingCalls(reply.result)
 enddef
 
 # process the 'callHierarchy/outgoingCalls' reply from the LSP server
 # Result: CallHierarchyOutgoingCall[] | null
-def s:ProcessOutgoingCalls(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+def ProcessOutgoingCalls(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   callhier.OutgoingCalls(reply.result)
 enddef
 
@@ -707,14 +707,14 @@ enddef
 # process a diagnostic notification message from the LSP server
 # Notification: textDocument/publishDiagnostics
 # Param: PublishDiagnosticsParams
-def s:ProcessDiagNotif(lspserver: dict<any>, reply: dict<any>): void
+def ProcessDiagNotif(lspserver: dict<any>, reply: dict<any>): void
   diag.DiagNotification(lspserver, reply.params.uri, reply.params.diagnostics)
 enddef
 
 # process a show notification message from the LSP server
 # Notification: window/showMessage
 # Param: ShowMessageParams
-def s:ProcessShowMsgNotif(lspserver: dict<any>, reply: dict<any>)
+def ProcessShowMsgNotif(lspserver: dict<any>, reply: dict<any>)
   var msgType: list<string> = ['', 'Error: ', 'Warning: ', 'Info: ', 'Log: ']
   if reply.params.type == 4
     # ignore log messages from the LSP server (too chatty)
@@ -734,7 +734,7 @@ enddef
 # process a log notification message from the LSP server
 # Notification: window/logMessage
 # Param: LogMessageParams
-def s:ProcessLogMsgNotif(lspserver: dict<any>, reply: dict<any>)
+def ProcessLogMsgNotif(lspserver: dict<any>, reply: dict<any>)
   var msgType: list<string> = ['', 'Error: ', 'Warning: ', 'Info: ', 'Log: ']
   var mtype: string = 'Log: '
   if reply.params.type > 0 && reply.params.type < 5
@@ -745,12 +745,12 @@ def s:ProcessLogMsgNotif(lspserver: dict<any>, reply: dict<any>)
 enddef
 
 # process unsupported notification messages
-def s:ProcessUnsupportedNotif(lspserver: dict<any>, reply: dict<any>)
+def ProcessUnsupportedNotif(lspserver: dict<any>, reply: dict<any>)
   util.ErrMsg('Error: Unsupported notification message received from the LSP server (' .. lspserver.path .. '), message = ' .. reply->string())
 enddef
 
 # ignore unsupported notification message
-def s:IgnoreNotif(lspserver: dict<any>, reply: dict<any>)
+def IgnoreNotif(lspserver: dict<any>, reply: dict<any>)
 enddef
 
 # process notification messages from the LSP server
@@ -777,7 +777,7 @@ enddef
 # process the workspace/applyEdit LSP server request
 # Request: "workspace/applyEdit"
 # Param: ApplyWorkspaceEditParams
-def s:ProcessApplyEditReq(lspserver: dict<any>, request: dict<any>)
+def ProcessApplyEditReq(lspserver: dict<any>, request: dict<any>)
   # interface ApplyWorkspaceEditParams
   if !request->has_key('params')
     return
@@ -791,7 +791,7 @@ def s:ProcessApplyEditReq(lspserver: dict<any>, request: dict<any>)
   lspserver.sendResponse(request, {applied: true}, {})
 enddef
 
-def s:ProcessUnsupportedReq(lspserver: dict<any>, request: dict<any>)
+def ProcessUnsupportedReq(lspserver: dict<any>, request: dict<any>)
   util.ErrMsg('Error: Unsupported request message received from the LSP server (' .. lspserver.path .. '), message = ' .. request->string())
 enddef
 
index 324c048eaac01f446f434be0994cc9354b8b5ac3..e190d458e624f1c0c6d878ab211daf0365b5945c 100644 (file)
@@ -121,7 +121,7 @@ var ftypeOmniCtrlMap: dict<bool> = {}
 
 var lspInitializedOnce = false
 
-def s:LspInitOnce()
+def LspInitOnce()
   # Signs used for LSP diagnostics
   sign_define([{name: 'LspDiagError', text: 'E ', texthl: 'ErrorMsg',
                                                linehl: 'MatchParen'},
@@ -141,13 +141,13 @@ enddef
 
 # Returns the LSP server for the a specific filetype. Returns an empty dict if
 # the server is not found.
-def s:LspGetServer(ftype: string): dict<any>
+def LspGetServer(ftype: string): dict<any>
   return ftypeServerMap->get(ftype, {})
 enddef
 
 # Returns the LSP server for the current buffer if it is running and is ready.
 # Returns an empty dict if the server is not found or is not ready.
-def s:CurbufGetServerChecked(): dict<any>
+def CurbufGetServerChecked(): dict<any>
   var fname: string = @%
   if fname == ''
     return {}
@@ -171,18 +171,18 @@ def s:CurbufGetServerChecked(): dict<any>
 enddef
 
 # Add a LSP server for a filetype
-def s:LspAddServer(ftype: string, lspsrv: dict<any>)
+def LspAddServer(ftype: string, lspsrv: dict<any>)
   ftypeServerMap->extend({[ftype]: lspsrv})
 enddef
 
 # Returns true if omni-completion is enabled for filetype 'ftype'.
 # Otherwise, returns false.
-def s:LspOmniComplEnabled(ftype: string): bool
+def LspOmniComplEnabled(ftype: string): bool
   return ftypeOmniCtrlMap->get(ftype, v:false)
 enddef
 
 # Enables or disables omni-completion for filetype 'fype'
-def s:LspOmniComplSet(ftype: string, enabled: bool)
+def LspOmniComplSet(ftype: string, enabled: bool)
   ftypeOmniCtrlMap->extend({[ftype]: enabled})
 enddef
 
@@ -260,7 +260,7 @@ def g:LspShowSignature(): string
 enddef
 
 # buffer change notification listener
-def s:Bufchange_listener(bnr: number, start: number, end: number, added: number, changes: list<dict<number>>)
+def Bufchange_listener(bnr: number, start: number, end: number, added: number, changes: list<dict<number>>)
   var lspserver: dict<any> = buf.CurbufGetServer()
   if lspserver->empty() || !lspserver.running
     return
@@ -270,7 +270,7 @@ def s:Bufchange_listener(bnr: number, start: number, end: number, added: number,
 enddef
 
 # A buffer is saved. Send the "textDocument/didSave" LSP notification
-def s:LspSavedFile()
+def LspSavedFile()
   var bnr: number = expand('<abuf>')->str2nr()
   var lspserver: dict<any> = buf.BufLspServerGet(bnr)
   if lspserver->empty() || !lspserver.running
index 74a693fac4cf94e4522531e639e77ff772ce997c..1be87460e3422d667dc1a1b2ec087ac77895f908 100644 (file)
@@ -56,19 +56,19 @@ else
 endif
 
 # LSP server standard output handler
-def s:Output_cb(lspserver: dict<any>, chan: channel, msg: string): void
+def Output_cb(lspserver: dict<any>, chan: channel, msg: string): void
   util.TraceLog(false, msg)
   lspserver.data = lspserver.data .. msg
   lspserver.processMessages()
 enddef
 
 # LSP server error output handler
-def s:Error_cb(lspserver: dict<any>, chan: channel, emsg: string,): void
+def Error_cb(lspserver: dict<any>, chan: channel, emsg: string,): void
   util.TraceLog(true, emsg)
 enddef
 
 # LSP server exit callback
-def s:Exit_cb(lspserver: dict<any>, job: job, status: number): void
+def Exit_cb(lspserver: dict<any>, job: job, status: number): void
   util.WarnMsg("LSP server exited with status " .. status)
   lspserver.job = v:null
   lspserver.running = false
@@ -77,7 +77,7 @@ def s:Exit_cb(lspserver: dict<any>, job: job, status: number): void
 enddef
 
 # Start a LSP server
-def s:StartServer(lspserver: dict<any>): number
+def StartServer(lspserver: dict<any>): number
   if lspserver.running
     util.WarnMsg("LSP server for is already running")
     return 0
@@ -122,7 +122,7 @@ enddef
 
 # Request: 'initialize'
 # Param: InitializeParams
-def s:InitServer(lspserver: dict<any>)
+def InitServer(lspserver: dict<any>)
   var req = lspserver.createRequest('initialize')
 
   # client capabilities (ClientCapabilities)
@@ -175,27 +175,27 @@ enddef
 
 # Send a "initialized" LSP notification
 # Params: InitializedParams
-def s:SendInitializedNotif(lspserver: dict<any>)
+def SendInitializedNotif(lspserver: dict<any>)
   var notif: dict<any> = lspserver.createNotification('initialized')
   lspserver.sendMessage(notif)
 enddef
 
 # Request: shutdown
 # Param: void
-def s:ShutdownServer(lspserver: dict<any>): void
+def ShutdownServer(lspserver: dict<any>): void
   var req = lspserver.createRequest('shutdown')
   lspserver.sendMessage(req)
 enddef
 
 # Send a 'exit' notification to the LSP server
 # Params: void
-def s:ExitServer(lspserver: dict<any>): void
+def ExitServer(lspserver: dict<any>): void
   var notif: dict<any> = lspserver.createNotification('exit')
   lspserver.sendMessage(notif)
 enddef
 
 # Stop a LSP server
-def s:StopServer(lspserver: dict<any>): number
+def StopServer(lspserver: dict<any>): number
   if !lspserver.running
     util.WarnMsg("LSP server is not running")
     return 0
@@ -217,21 +217,21 @@ def s:StopServer(lspserver: dict<any>): number
 enddef
 
 # set the LSP server trace level using $/setTrace notification
-def s:SetTrace(lspserver: dict<any>, traceVal: string)
+def SetTrace(lspserver: dict<any>, traceVal: string)
   var notif: dict<any> = lspserver.createNotification('$/setTrace')
   notif.params->extend({value: traceVal})
   lspserver.sendMessage(notif)
 enddef
 
 # Return the next id for a LSP server request message
-def s:NextReqID(lspserver: dict<any>): number
+def NextReqID(lspserver: dict<any>): number
   var id = lspserver.nextID
   lspserver.nextID = id + 1
   return id
 enddef
 
 # create a LSP server request message
-def s:CreateRequest(lspserver: dict<any>, method: string): dict<any>
+def CreateRequest(lspserver: dict<any>, method: string): dict<any>
   var req = {}
   req.jsonrpc = '2.0'
   req.id = lspserver.nextReqID()
@@ -245,7 +245,7 @@ def s:CreateRequest(lspserver: dict<any>, method: string): dict<any>
 enddef
 
 # create a LSP server response message
-def s:CreateResponse(lspserver: dict<any>, req_id: number): dict<any>
+def CreateResponse(lspserver: dict<any>, req_id: number): dict<any>
   var resp = {}
   resp.jsonrpc = '2.0'
   resp.id = req_id
@@ -254,7 +254,7 @@ def s:CreateResponse(lspserver: dict<any>, req_id: number): dict<any>
 enddef
 
 # create a LSP server notification message
-def s:CreateNotification(lspserver: dict<any>, notif: string): dict<any>
+def CreateNotification(lspserver: dict<any>, notif: string): dict<any>
   var req = {}
   req.jsonrpc = '2.0'
   req.method = notif
@@ -264,7 +264,7 @@ def s:CreateNotification(lspserver: dict<any>, notif: string): dict<any>
 enddef
 
 # send a response message to the server
-def s:SendResponse(lspserver: dict<any>, request: dict<any>, result: dict<any>, error: dict<any>)
+def SendResponse(lspserver: dict<any>, request: dict<any>, result: dict<any>, error: dict<any>)
   var resp: dict<any> = lspserver.createResponse(request.id)
   if result->type() != v:t_none
     resp->extend({result: result})
@@ -275,7 +275,7 @@ def s:SendResponse(lspserver: dict<any>, request: dict<any>, result: dict<any>,
 enddef
 
 # Send a request message to LSP server
-def s:SendMessage(lspserver: dict<any>, content: dict<any>): void
+def SendMessage(lspserver: dict<any>, content: dict<any>): void
   var payload_js: string = content->json_encode()
   var msg = "Content-Length: " .. payload_js->len() .. "\r\n\r\n"
   var ch = lspserver.job->job_getchannel()
@@ -289,7 +289,7 @@ enddef
 
 # Wait for a response message from the LSP server for the request "req"
 # Waits for a maximum of 5 seconds
-def s:WaitForReponse(lspserver: dict<any>, req: dict<any>)
+def WaitForReponse(lspserver: dict<any>, req: dict<any>)
   var maxCount: number = 2500
   var key: string = req.id->string()
 
@@ -301,7 +301,7 @@ enddef
 
 # Send a LSP "textDocument/didOpen" notification
 # Params: DidOpenTextDocumentParams
-def s:TextdocDidOpen(lspserver: dict<any>, bnr: number, ftype: string): void
+def TextdocDidOpen(lspserver: dict<any>, bnr: number, ftype: string): void
   var notif: dict<any> = lspserver.createNotification('textDocument/didOpen')
 
   # interface DidOpenTextDocumentParams
@@ -317,7 +317,7 @@ def s:TextdocDidOpen(lspserver: dict<any>, bnr: number, ftype: string): void
 enddef
 
 # Send a LSP "textDocument/didClose" notification
-def s:TextdocDidClose(lspserver: dict<any>, bnr: number): void
+def TextdocDidClose(lspserver: dict<any>, bnr: number): void
   var notif: dict<any> = lspserver.createNotification('textDocument/didClose')
 
   # interface DidCloseTextDocumentParams
@@ -331,7 +331,7 @@ enddef
 
 # Send a LSP "textDocument/didChange" notification
 # Params: DidChangeTextDocumentParams
-def s:TextdocDidChange(lspserver: dict<any>, bnr: number, start: number,
+def TextdocDidChange(lspserver: dict<any>, bnr: number, start: number,
                        end: number, added: number,
                        changes: list<dict<number>>): void
   var notif: dict<any> = lspserver.createNotification('textDocument/didChange')
@@ -392,7 +392,7 @@ enddef
 # LSP line and column numbers start from zero, whereas Vim line and column
 # numbers start from one. The LSP column number is the character index in the
 # line and not the byte index in the line.
-def s:GetLspPosition(): dict<number>
+def GetLspPosition(): dict<number>
   var lnum: number = line('.') - 1
   var col: number = charcol('.') - 1
   return {line: lnum, character: col}
@@ -400,7 +400,7 @@ enddef
 
 # Return the current file name and current cursor position as a LSP
 # TextDocumentPositionParams structure
-def s:GetLspTextDocPosition(): dict<dict<any>>
+def GetLspTextDocPosition(): dict<dict<any>>
   # interface TextDocumentIdentifier
   # interface Position
   return {textDocument: {uri: util.LspFileToUri(@%)},
@@ -410,7 +410,7 @@ enddef
 # Get a list of completion items.
 # Request: "textDocument/completion"
 # Param: CompletionParams
-def s:GetCompletion(lspserver: dict<any>, triggerKind_arg: number): void
+def GetCompletion(lspserver: dict<any>, triggerKind_arg: number): void
   # Check whether LSP server supports completion
   if !lspserver.caps->has_key('completionProvider')
     util.ErrMsg("Error: LSP server does not support completion")
@@ -439,7 +439,7 @@ enddef
 
 # Request: "textDocument/definition"
 # Param: DefinitionParams
-def s:GotoDefinition(lspserver: dict<any>, peek: bool)
+def GotoDefinition(lspserver: dict<any>, peek: bool)
   # Check whether LSP server supports jumping to a definition
   if !lspserver.caps->has_key('definitionProvider')
                                || !lspserver.caps.definitionProvider
@@ -462,7 +462,7 @@ enddef
 
 # Request: "textDocument/declaration"
 # Param: DeclarationParams
-def s:GotoDeclaration(lspserver: dict<any>, peek: bool): void
+def GotoDeclaration(lspserver: dict<any>, peek: bool): void
   # Check whether LSP server supports jumping to a declaration
   if !lspserver.caps->has_key('declarationProvider')
                        || !lspserver.caps.declarationProvider
@@ -487,7 +487,7 @@ enddef
 
 # Request: "textDocument/typeDefinition"
 # Param: TypeDefinitionParams
-def s:GotoTypeDef(lspserver: dict<any>, peek: bool): void
+def GotoTypeDef(lspserver: dict<any>, peek: bool): void
   # Check whether LSP server supports jumping to a type definition
   if !lspserver.caps->has_key('typeDefinitionProvider')
                        || !lspserver.caps.typeDefinitionProvider
@@ -512,7 +512,7 @@ enddef
 
 # Request: "textDocument/implementation"
 # Param: ImplementationParams
-def s:GotoImplementation(lspserver: dict<any>, peek: bool): void
+def GotoImplementation(lspserver: dict<any>, peek: bool): void
   # Check whether LSP server supports jumping to a implementation
   if !lspserver.caps->has_key('implementationProvider')
                        || !lspserver.caps.implementationProvider
@@ -538,7 +538,7 @@ enddef
 # get symbol signature help.
 # Request: "textDocument/signatureHelp"
 # Param: SignatureHelpParams
-def s:ShowSignature(lspserver: dict<any>): void
+def ShowSignature(lspserver: dict<any>): void
   # Check whether LSP server supports signature help
   if !lspserver.caps->has_key('signatureHelpProvider')
     util.ErrMsg("Error: LSP server does not support signature help")
@@ -558,7 +558,7 @@ def s:ShowSignature(lspserver: dict<any>): void
   endif
 enddef
 
-def s:DidSaveFile(lspserver: dict<any>, bnr: number): void
+def DidSaveFile(lspserver: dict<any>, bnr: number): void
   # Check whether the LSP server supports the didSave notification
   if !lspserver.caps->has_key('textDocumentSync')
                || lspserver.caps.textDocumentSync->type() == v:t_number
@@ -577,7 +577,7 @@ enddef
 # get the hover information
 # Request: "textDocument/hover"
 # Param: HoverParams
-def s:Hover(lspserver: dict<any>): void
+def Hover(lspserver: dict<any>): void
   # Check whether LSP server supports getting hover information
   if !lspserver.caps->has_key('hoverProvider')
                        || !lspserver.caps.hoverProvider
@@ -597,7 +597,7 @@ enddef
 
 # Request: "textDocument/references"
 # Param: ReferenceParams
-def s:ShowReferences(lspserver: dict<any>, peek: bool): void
+def ShowReferences(lspserver: dict<any>, peek: bool): void
   # Check whether LSP server supports getting reference information
   if !lspserver.caps->has_key('referencesProvider')
                        || !lspserver.caps.referencesProvider
@@ -621,7 +621,7 @@ enddef
 
 # Request: "textDocument/documentHighlight"
 # Param: DocumentHighlightParams
-def s:DocHighlight(lspserver: dict<any>): void
+def DocHighlight(lspserver: dict<any>): void
   # Check whether LSP server supports getting highlight information
   if !lspserver.caps->has_key('documentHighlightProvider')
                        || !lspserver.caps.documentHighlightProvider
@@ -642,7 +642,7 @@ enddef
 
 # Request: "textDocument/documentSymbol"
 # Param: DocumentSymbolParams
-def s:GetDocSymbols(lspserver: dict<any>, fname: string): void
+def GetDocSymbols(lspserver: dict<any>, fname: string): void
   # Check whether LSP server supports getting document symbol information
   if !lspserver.caps->has_key('documentSymbolProvider')
                        || !lspserver.caps.documentSymbolProvider
@@ -666,7 +666,7 @@ enddef
 # or
 # Request: "textDocument/rangeFormatting"
 # Param: DocumentRangeFormattingParams
-def s:TextDocFormat(lspserver: dict<any>, fname: string, rangeFormat: bool,
+def TextDocFormat(lspserver: dict<any>, fname: string, rangeFormat: bool,
                                start_lnum: number, end_lnum: number)
   # Check whether LSP server supports formatting documents
   if !lspserver.caps->has_key('documentFormattingProvider')
@@ -717,7 +717,7 @@ enddef
 
 # Request: "textDocument/prepareCallHierarchy"
 # Param: CallHierarchyPrepareParams
-def s:PrepareCallHierarchy(lspserver: dict<any>, fname: string)
+def PrepareCallHierarchy(lspserver: dict<any>, fname: string)
   # Check whether LSP server supports call hierarchy
   if !lspserver.caps->has_key('callHierarchyProvider')
                        || !lspserver.caps.callHierarchyProvider
@@ -735,7 +735,7 @@ enddef
 
 # Request: "callHierarchy/incomingCalls"
 # Param: CallHierarchyItem
-def s:IncomingCalls(lspserver: dict<any>, hierItem: dict<any>)
+def IncomingCalls(lspserver: dict<any>, hierItem: dict<any>)
   # Check whether LSP server supports call hierarchy
   if !lspserver.caps->has_key('callHierarchyProvider')
                        || !lspserver.caps.callHierarchyProvider
@@ -757,7 +757,7 @@ enddef
 
 # Request: "callHierarchy/outgoingCalls"
 # Param: CallHierarchyItem
-def s:OutgoingCalls(lspserver: dict<any>, hierItem: dict<any>)
+def OutgoingCalls(lspserver: dict<any>, hierItem: dict<any>)
   # Check whether LSP server supports call hierarchy
   if !lspserver.caps->has_key('callHierarchyProvider')
                        || !lspserver.caps.callHierarchyProvider
@@ -779,7 +779,7 @@ enddef
 
 # Request: "textDocument/rename"
 # Param: RenameParams
-def s:RenameSymbol(lspserver: dict<any>, newName: string)
+def RenameSymbol(lspserver: dict<any>, newName: string)
   # Check whether LSP server supports rename operation
   if !lspserver.caps->has_key('renameProvider')
                        || !lspserver.caps.renameProvider
@@ -801,7 +801,7 @@ enddef
 
 # Request: "textDocument/codeAction"
 # Param: CodeActionParams
-def s:CodeAction(lspserver: dict<any>, fname_arg: string)
+def CodeAction(lspserver: dict<any>, fname_arg: string)
   # Check whether LSP server supports code action operation
   if !lspserver.caps->has_key('codeActionProvider')
                        || !lspserver.caps.codeActionProvider
@@ -836,7 +836,7 @@ enddef
 # List project-wide symbols matching query string
 # Request: "workspace/symbol"
 # Param: WorkspaceSymbolParams
-def s:WorkspaceQuerySymbols(lspserver: dict<any>, query: string): bool
+def WorkspaceQuerySymbols(lspserver: dict<any>, query: string): bool
   # Check whether the LSP server supports listing workspace symbols
   if !lspserver.caps->has_key('workspaceSymbolProvider')
                                || !lspserver.caps.workspaceSymbolProvider
@@ -854,7 +854,7 @@ enddef
 # Add a workspace folder to the LSP server.
 # Request: "workspace/didChangeWorkspaceFolders"
 # Param: DidChangeWorkspaceFoldersParams
-def s:AddWorkspaceFolder(lspserver: dict<any>, dirName: string): void
+def AddWorkspaceFolder(lspserver: dict<any>, dirName: string): void
   if !lspserver.caps->has_key('workspace')
          || !lspserver.caps.workspace->has_key('workspaceFolders')
          || !lspserver.caps.workspace.workspaceFolders->has_key('supported')
@@ -880,7 +880,7 @@ enddef
 # Remove a workspace folder from the LSP server.
 # Request: "workspace/didChangeWorkspaceFolders"
 # Param: DidChangeWorkspaceFoldersParams
-def s:RemoveWorkspaceFolder(lspserver: dict<any>, dirName: string): void
+def RemoveWorkspaceFolder(lspserver: dict<any>, dirName: string): void
   if !lspserver.caps->has_key('workspace')
          || !lspserver.caps.workspace->has_key('workspaceFolders')
          || !lspserver.caps.workspace.workspaceFolders->has_key('supported')
@@ -907,7 +907,7 @@ enddef
 # select the text around the current cursor location
 # Request: "textDocument/selectionRange"
 # Param: SelectionRangeParams
-def s:SelectionRange(lspserver: dict<any>, fname: string)
+def SelectionRange(lspserver: dict<any>, fname: string)
   # Check whether LSP server supports selection ranges
   if !lspserver.caps->has_key('selectionRangeProvider')
                        || !lspserver.caps.selectionRangeProvider
@@ -928,7 +928,7 @@ def s:SelectionRange(lspserver: dict<any>, fname: string)
 enddef
 
 # Expand the previous selection or start a new one
-def s:SelectionExpand(lspserver: dict<any>)
+def SelectionExpand(lspserver: dict<any>)
   # Check whether LSP server supports selection ranges
   if !lspserver.caps->has_key('selectionRangeProvider')
                        || !lspserver.caps.selectionRangeProvider
@@ -940,7 +940,7 @@ def s:SelectionExpand(lspserver: dict<any>)
 enddef
 
 # Shrink the previous selection or start a new one
-def s:SelectionShrink(lspserver: dict<any>)
+def SelectionShrink(lspserver: dict<any>)
   # Check whether LSP server supports selection ranges
   if !lspserver.caps->has_key('selectionRangeProvider')
                        || !lspserver.caps.selectionRangeProvider
@@ -954,7 +954,7 @@ enddef
 # fold the entire document
 # Request: "textDocument/foldingRange"
 # Param: FoldingRangeParams
-def s:FoldRange(lspserver: dict<any>, fname: string)
+def FoldRange(lspserver: dict<any>, fname: string)
   # Check whether LSP server supports fold ranges
   if !lspserver.caps->has_key('foldingRangeProvider')
                        || !lspserver.caps.foldingRangeProvider
@@ -976,7 +976,7 @@ enddef
 # Request the LSP server to execute a command
 # Request: workspace/executeCommand
 # Params: ExecuteCommandParams
-def s:ExecuteCommand(lspserver: dict<any>, cmd: dict<any>)
+def ExecuteCommand(lspserver: dict<any>, cmd: dict<any>)
   var req = lspserver.createRequest('workspace/executeCommand')
   req.params->extend(cmd)
   lspserver.sendMessage(req)
@@ -988,7 +988,7 @@ enddef
 
 # Display the LSP server capabilities (received during the initialization
 # stage).
-def s:ShowCapabilities(lspserver: dict<any>)
+def ShowCapabilities(lspserver: dict<any>)
   echo "Capabilities of '" .. lspserver.path .. "' LSP server:"
   for k in lspserver.caps->keys()->sort()
     echo k .. ": " .. lspserver.caps[k]->string()
index 25e41ed47fcffafc482e234d92f0e139f2838d57..bef0ae310a96c3396ea660377247b66759480c02 100644 (file)
@@ -16,7 +16,7 @@ else
 endif
 
 # jump to a symbol selected in the outline window
-def s:OutlineJumpToSymbol()
+def OutlineJumpToSymbol()
   var lnum: number = line('.') - 1
   if w:lspSymbols.lnumTable[lnum]->empty()
     return
@@ -70,7 +70,7 @@ export def SkipOutlineRefresh(): bool
   return skipRefresh
 enddef
 
-def s:AddSymbolText(bnr: number,
+def AddSymbolText(bnr: number,
                        symbolTypeTable: dict<list<dict<any>>>,
                        pfx: string,
                        text: list<string>,
@@ -156,7 +156,7 @@ export def UpdateOutlineWindow(fname: string,
   skipRefresh = false
 enddef
 
-def s:OutlineHighlightCurrentSymbol()
+def OutlineHighlightCurrentSymbol()
   var fname: string = expand('%')->fnamemodify(':p')
   if fname == '' || &filetype == ''
     return
@@ -224,7 +224,7 @@ def s:OutlineHighlightCurrentSymbol()
 enddef
 
 # when the outline window is closed, do the cleanup
-def s:OutlineCleanup()
+def OutlineCleanup()
   # Remove the outline autocommands
   :silent! autocmd! LSPOutline
 
index 49c2ddebda0c2d48927c0c8a9ab43d64d6456070..7b733405cc2073e10716622830e18901b11f5aa8 100644 (file)
@@ -14,7 +14,7 @@ else
 endif
 
 # Visually (character-wise) select the text in a range
-def s:SelectText(bnr: number, range: dict<dict<number>>)
+def SelectText(bnr: number, range: dict<dict<number>>)
   var start_col: number = util.GetLineByteFromPos(bnr, range.start) + 1
   var end_col: number = util.GetLineByteFromPos(bnr, range.end)
 
@@ -39,7 +39,7 @@ export def SelectionStart(lspserver: dict<any>, sel: list<dict<any>>)
 enddef
 
 # Locate the range in the LSP reply at a specified level
-def s:GetSelRangeAtLevel(selRange: dict<any>, level: number): dict<any>
+def GetSelRangeAtLevel(selRange: dict<any>, level: number): dict<any>
   var r: dict<any> = selRange
   var idx: number = 0
 
@@ -56,7 +56,7 @@ enddef
 
 # Returns true if the current visual selection matches a range in the
 # selection reply from LSP.
-def s:SelectionFromLSP(range: dict<any>, startpos: list<number>, endpos: list<number>): bool
+def SelectionFromLSP(range: dict<any>, startpos: list<number>, endpos: list<number>): bool
   return startpos[1] == range.start.line + 1
                        && endpos[1] == range.end.line + 1
                        && startpos[2] == range.start.character + 1
index 19ff04da2e02e7343491dcf74f5f71bd7aac946a..64d2d772db169fcfcd6f65e607a3e3f1d5ae7dd0 100644 (file)
@@ -25,12 +25,12 @@ else
 endif
 
 # close the signature popup window
-def s:CloseSignaturePopup(lspserver: dict<any>)
+def CloseSignaturePopup(lspserver: dict<any>)
   lspserver.signaturePopup->popup_close()
   lspserver.signaturePopup = -1
 enddef
 
-def s:CloseCurBufSignaturePopup()
+def CloseCurBufSignaturePopup()
   var lspserver: dict<any> = buf.CurbufGetServer()
   if lspserver->empty()
     return
index 6b09430ad7b8a8b433cbaa5fbc8569306b807ff1..8e9cacf3abd93d5645d10a534d2ed28e72cd32a5 100644 (file)
@@ -33,7 +33,7 @@ else
 endif
 
 # Handle keys pressed when the workspace symbol popup menu is displayed
-def s:FilterSymbols(lspserver: dict<any>, popupID: number, key: string): bool
+def FilterSymbols(lspserver: dict<any>, popupID: number, key: string): bool
   var key_handled: bool = false
   var update_popup: bool = false
   var query: string = lspserver.workspaceSymbolQuery
@@ -94,7 +94,7 @@ def s:FilterSymbols(lspserver: dict<any>, popupID: number, key: string): bool
 enddef
 
 # Jump to the location of a symbol selected in the popup menu
-def s:JumpToWorkspaceSymbol(popupID: number, result: number): void
+def JumpToWorkspaceSymbol(popupID: number, result: number): void
   # clear the message displayed at the command-line
   echo ''
 
index 77a09f6aa3c5e2acd7c07854d138ce633faec6fc..f9afaa28922571013cb0bb5151d5d9482dfcbb99 100644 (file)
@@ -26,7 +26,7 @@ endif
 # numbers.
 # 'a': {'A': [lnum, col], 'B': [lnum, col]}
 # 'b': {'A': [lnum, col], 'B': [lnum, col]}
-def s:Edit_sort_func(a: dict<any>, b: dict<any>): number
+def Edit_sort_func(a: dict<any>, b: dict<any>): number
   # line number
   if a.A[0] != b.A[0]
     return b.A[0] - a.A[0]
@@ -49,7 +49,7 @@ enddef
 # 'new_lines' A list of strings to replace the original
 #
 # returns the modified 'lines'
-def s:Set_lines(lines: list<string>, A: list<number>, B: list<number>,
+def Set_lines(lines: list<string>, A: list<number>, B: list<number>,
                                        new_lines: list<string>): list<string>
   var i_0: number = A[0]
 
@@ -202,7 +202,7 @@ export def ApplyTextEdits(bnr: number, text_edits: list<dict<any>>): void
 enddef
 
 # interface TextDocumentEdit
-def s:ApplyTextDocumentEdit(textDocEdit: dict<any>)
+def ApplyTextDocumentEdit(textDocEdit: dict<any>)
   var bnr: number = bufnr(util.LspUriToFile(textDocEdit.textDocument.uri))
   if bnr == -1
     util.ErrMsg('Error: Text Document edit, buffer ' .. textDocEdit.textDocument.uri .. ' is not found')
index fa06c734a0e208ff4bf2a58c11775a0e7f94f8fb..84b9ff123f21892772b860ba012676d2504a208a 100644 (file)
@@ -144,8 +144,6 @@ else
   lspf.showDiagnostics = ShowDiagnostics
   lspf.showCurrentDiag = LspShowCurrentDiag
   lspf.jumpToDiag = JumpToDiag
-  lspf.jumpToDiag = JumpToDiag
-  lspf.jumpToDiag = JumpToDiag
   lspf.diagHighlightEnable = DiagHighlightEnable
   lspf.diagHighlightDisable = DiagHighlightDisable
   lspf.showReferences = ShowReferences