]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Change the script-local function names to start with an uppercase letter. Remove...
authorYegappan Lakshmanan <yegappan@yahoo.com>
Tue, 8 Feb 2022 04:42:40 +0000 (20:42 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Tue, 8 Feb 2022 04:42:40 +0000 (20:42 -0800)
12 files changed:
autoload/buffer.vim
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 1b50403d275812035e3d998ab213be0886de9bdf..d7fb5ba0bc571788065f76c8fe2b25f07e898de7 100644 (file)
@@ -28,3 +28,5 @@ enddef
 export def BufHasLspServer(bnr: number): bool
   return bufnrToServer->has_key(bnr)
 enddef
+
+# vim: shiftwidth=2 softtabstop=2
index 9d20dd7f89f4550f9f1333648caaa85736f76273..9ccc71a30f1862471745cb719acbed3af5a4fcea 100644 (file)
@@ -19,7 +19,7 @@ else
   util.GetLineByteFromPos = GetLineByteFromPos
 endif
 
-def s:createLoclistWithCalls(calls: list<dict<any>>, incoming: bool)
+def s:CreateLoclistWithCalls(calls: list<dict<any>>, incoming: bool)
   var qflist: list<dict<any>> = []
 
   for item in calls
@@ -74,7 +74,7 @@ export def IncomingCalls(calls: list<dict<any>>)
     return
   endif
 
-  s:createLoclistWithCalls(calls, true)
+  s:CreateLoclistWithCalls(calls, true)
 enddef
 
 export def OutgoingCalls(calls: list<dict<any>>)
@@ -83,7 +83,7 @@ export def OutgoingCalls(calls: list<dict<any>>)
     return
   endif
 
-  s:createLoclistWithCalls(calls, false)
+  s:CreateLoclistWithCalls(calls, false)
 enddef
 
 # vim: shiftwidth=2 softtabstop=2
index e5a5b003d0abec12e65cbefa27a4aab6b372ca32..9780cd9ec94cc56f4b3ece8022111a784a0f42b5 100644 (file)
@@ -32,7 +32,7 @@ export def DiagRemoveFile(lspserver: dict<any>, bnr: number)
   endif
 enddef
 
-def s:lspDiagSevToSignName(severity: number): string
+def s:DiagSevToSignName(severity: number): string
   var typeMap: list<string> = ['LspDiagError', 'LspDiagWarning',
                                                'LspDiagInfo', 'LspDiagHint']
   if severity > 4
@@ -71,7 +71,7 @@ def ProcessNewDiags(lspserver: dict<any>, bnr: number)
   for [lnum, diag] in lspserver.diagsMap[bnr]->items()
     signs->add({id: 0, buffer: bnr, group: 'LSPDiag',
                                lnum: str2nr(lnum),
-                               name: s:lspDiagSevToSignName(diag.severity)})
+                               name: s:DiagSevToSignName(diag.severity)})
   endfor
 
   signs->sign_placelist()
@@ -140,7 +140,7 @@ export def DiagsGetErrorCount(lspserver: dict<any>): dict<number>
 enddef
 
 # Map the LSP DiagnosticSeverity to a quickfix type character
-def s:lspDiagSevToQfType(severity: number): string
+def s:DiagSevToQfType(severity: number): string
   var typeMap: list<string> = ['E', 'W', 'I', 'N']
 
   if severity > 4
@@ -173,7 +173,7 @@ export def ShowAllDiags(lspserver: dict<any>): void
                    'lnum': diag.range.start.line + 1,
                    'col': util.GetLineByteFromPos(bnr, diag.range.start) + 1,
                    'text': text,
-                   'type': s:lspDiagSevToQfType(diag.severity)})
+                   'type': s:DiagSevToQfType(diag.severity)})
   endfor
   setloclist(0, [], ' ', {'title': 'Language Server Diagnostics',
                                                        'items': qflist})
@@ -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 s: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())
@@ -242,7 +242,7 @@ export def LspDiagsJump(lspserver: dict<any>, which: string): void
   endif
 
   # sort the diagnostics by line number
-  var sortedDiags: list<number> = s:getSortedDiagLines(lspserver, bnr)
+  var sortedDiags: list<number> = s:GetSortedDiagLines(lspserver, bnr)
 
   if which == 'first'
     cursor(sortedDiags[0], 1)
index 48965fd1c81829b3901d884e3f69eb0ca34c4818..f073f3194b08885f415c3163e3f0b4b47eba8925 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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s:ProcessDocSymbolTable(docSymbolTable: list<dict<any>>,
                                symbolTypeTable: dict<list<dict<any>>>,
                                symbolLineTable: list<dict<any>>)
   var symbolType: string
@@ -439,7 +439,7 @@ def s:processDocSymbolTable(docSymbolTable: list<dict<any>>,
     endif
     childSymbols = {}
     if symbol->has_key('children')
-      s:processDocSymbolTable(symbol.children, childSymbols, symbolLineTable)
+      s:ProcessDocSymbolTable(symbol.children, childSymbols, symbolLineTable)
     endif
     symInfo = {name: name, range: r, detail: symbolDetail,
                                                children: childSymbols}
@@ -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 s: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>> = []
@@ -468,10 +468,10 @@ def s:processDocSymbolReply(lspserver: dict<any>, req: dict<any>, reply: dict<an
 
   if reply.result[0]->has_key('location')
     # SymbolInformation[]
-    s:processSymbolInfoTable(reply.result, symbolTypeTable, symbolLineTable)
+    s:ProcessSymbolInfoTable(reply.result, symbolTypeTable, symbolLineTable)
   else
     # DocumentSymbol[]
-    s:processDocSymbolTable(reply.result, symbolTypeTable, symbolLineTable)
+    s:ProcessDocSymbolTable(reply.result, symbolTypeTable, symbolLineTable)
   endif
 
   # sort the symbols by line number
@@ -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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s:ProcessWorkspaceSymbolReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   var symbols: list<dict<any>> = []
   var symbolType: string
   var fileName: string
@@ -613,7 +613,7 @@ def s:processWorkspaceSymbolReply(lspserver: dict<any>, req: dict<any>, reply: d
       symName = symbol.containerName .. '::' .. symName
     endif
     symName ..= ' [' .. LspSymbolKindToName(symbol.kind) .. ']'
-    symName ..= ' ' .. s:makeMenuName(
+    symName ..= ' ' .. s:MakeMenuName(
                lspserver.workspaceSymbolPopup->popup_getpos().core_width,
                fileName)
 
@@ -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 s: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 s: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 s:ProcessOutgoingCalls(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
   callhier.OutgoingCalls(reply.result)
 enddef
 
@@ -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('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')
     }
 
   if lsp_reply_handlers->has_key(req.method)
@@ -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 s: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 s: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 s: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,26 +745,26 @@ def s:processLogMsgNotif(lspserver: dict<any>, reply: dict<any>)
 enddef
 
 # process unsupported notification messages
-def s:processUnsupportedNotif(lspserver: dict<any>, reply: dict<any>)
+def s: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 s:IgnoreNotif(lspserver: dict<any>, reply: dict<any>)
 enddef
 
 # process notification messages from the LSP server
 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('s:ProcessShowMsgNotif'),
+      'window/logMessage': function('s:ProcessLogMsgNotif'),
+      'textDocument/publishDiagnostics': function('s:ProcessDiagNotif'),
+      '$/progress': function('s:ProcessUnsupportedNotif'),
+      'telemetry/event': function('s:ProcessUnsupportedNotif'),
       # Java language server sends the 'language/status' notification which is
       # not in the LSP specification
-      'language/status': function('s:ignoreNotif')
+      'language/status': function('s:IgnoreNotif')
     }
 
   if lsp_notif_handlers->has_key(reply.method)
@@ -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 s: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 s:ProcessUnsupportedReq(lspserver: dict<any>, request: dict<any>)
   util.ErrMsg('Error: Unsupported request message received from the LSP server (' .. lspserver.path .. '), message = ' .. request->string())
 enddef
 
@@ -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('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')
     }
 
   if lspRequestHandlers->has_key(request.method)
index 7a37b6a7430a86a323857fa11d5a33dd648af279..324c048eaac01f446f434be0994cc9354b8b5ac3 100644 (file)
@@ -121,7 +121,7 @@ var ftypeOmniCtrlMap: dict<bool> = {}
 
 var lspInitializedOnce = false
 
-def s:lspInitOnce()
+def s: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 s: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 s: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 s: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 s: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 s:LspOmniComplSet(ftype: string, enabled: bool)
   ftypeOmniCtrlMap->extend({[ftype]: enabled})
 enddef
 
@@ -207,7 +207,7 @@ enddef
 
 # Go to a definition using "textDocument/definition" LSP request
 export def GotoDefinition(peek: bool)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -217,7 +217,7 @@ enddef
 
 # Go to a declaration using "textDocument/declaration" LSP request
 export def GotoDeclaration(peek: bool)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -227,7 +227,7 @@ enddef
 
 # Go to a type definition using "textDocument/typeDefinition" LSP request
 export def GotoTypedef(peek: bool)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -237,7 +237,7 @@ enddef
 
 # Go to a implementation using "textDocument/implementation" LSP request
 export def GotoImplementation(peek: bool)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -248,7 +248,7 @@ enddef
 # Show the signature using "textDocument/signatureHelp" LSP method
 # Invoked from an insert-mode mapping, so return an empty string.
 def g:LspShowSignature(): string
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return ''
   endif
@@ -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 s: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 s:LspSavedFile()
   var bnr: number = expand('<abuf>')->str2nr()
   var lspserver: dict<any> = buf.BufLspServerGet(bnr)
   if lspserver->empty() || !lspserver.running
@@ -339,20 +339,20 @@ export def AddFile(bnr: number): void
   if ftype == ''
     return
   endif
-  var lspserver: dict<any> = s:lspGetServer(ftype)
+  var lspserver: dict<any> = s:LspGetServer(ftype)
   if lspserver->empty()
     return
   endif
   if !lspserver.running
     if !lspInitializedOnce
-      s:lspInitOnce()
+      s:LspInitOnce()
     endif
     lspserver.startServer()
   endif
   lspserver.textdocDidOpen(bnr, ftype)
 
   # add a listener to track changes to this buffer
-  listener_add(function('s:bufchange_listener'), bnr)
+  listener_add(function('s:Bufchange_listener'), bnr)
 
   # set options for insert mode completion
   if opt.lspOptions.autoComplete
@@ -363,7 +363,7 @@ export def AddFile(bnr: number): void
       inoremap <expr> <buffer> <CR> pumvisible() ? "\<C-Y>\<CR>" : "\<CR>"
     endif
   else
-    if s:lspOmniComplEnabled(ftype)
+    if s:LspOmniComplEnabled(ftype)
       setbufvar(bnr, '&omnifunc', 'LspOmniFunc')
     endif
   endif
@@ -376,7 +376,7 @@ export def AddFile(bnr: number): void
   # Set buffer local autocmds
   augroup LSPBufferAutocmds
     # file saved notification handler
-    exe 'autocmd BufWritePost <buffer=' .. bnr .. '> call s:lspSavedFile()'
+    exe 'autocmd BufWritePost <buffer=' .. bnr .. '> call s:LspSavedFile()'
 
     if opt.lspOptions.autoComplete
       # Trigger 24x7 insert mode completion when text is changed
@@ -454,12 +454,12 @@ export def AddServer(serverList: list<dict<any>>)
     var lspserver: dict<any> = lserver.NewLspServer(server.path, args)
 
     if server.filetype->type() == v:t_string
-      s:lspAddServer(server.filetype, lspserver)
-      s:lspOmniComplSet(server.filetype, server.omnicompl)
+      s:LspAddServer(server.filetype, lspserver)
+      s:LspOmniComplSet(server.filetype, server.omnicompl)
     elseif server.filetype->type() == v:t_list
       for ftype in server.filetype
-        s:lspAddServer(ftype, lspserver)
-        s:lspOmniComplSet(ftype, server.omnicompl)
+        s:LspAddServer(ftype, lspserver)
+        s:LspOmniComplSet(ftype, server.omnicompl)
       endfor
     else
       util.ErrMsg('Error: Unsupported file type information "' ..
@@ -492,7 +492,7 @@ export def SetTraceServer(traceVal: string)
     return
   endif
 
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -503,7 +503,7 @@ enddef
 # Display the diagnostic messages from the LSP server for the current buffer
 # in a quickfix list
 export def ShowDiagnostics(): void
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -513,7 +513,7 @@ enddef
 
 # Show the diagnostic message for the current line
 export def LspShowCurrentDiag()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -554,7 +554,7 @@ enddef
 
 # jump to the next/previous/first diagnostic message in the current buffer
 export def JumpToDiag(which: string): void
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -601,7 +601,7 @@ enddef
 
 # omni complete handler
 def g:LspOmniFunc(findstart: number, base: string): any
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return -2
   endif
@@ -654,7 +654,7 @@ enddef
 
 # show symbol references
 export def ShowReferences(peek: bool)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -664,7 +664,7 @@ enddef
 
 # highlight all the places where a symbol is referenced
 def g:LspDocHighlight()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -710,7 +710,7 @@ export def TextDocFormat(range_args: number, line1: number, line2: number)
     return
   endif
 
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -729,7 +729,7 @@ enddef
 # Display all the locations where the current symbol is called from.
 # Uses LSP "callHierarchy/incomingCalls" request
 export def IncomingCalls()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -740,7 +740,7 @@ export def IncomingCalls()
 enddef
 
 def g:LspGetIncomingCalls(item: dict<any>)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -749,7 +749,7 @@ def g:LspGetIncomingCalls(item: dict<any>)
 enddef
 
 def g:LspGetOutgoingCalls(item: dict<any>)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -761,7 +761,7 @@ enddef
 # Display all the symbols used by the current symbol.
 # Uses LSP "callHierarchy/outgoingCalls" request
 export def OutgoingCalls()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -774,7 +774,7 @@ enddef
 # Rename a symbol
 # Uses LSP "textDocument/rename" request
 export def Rename()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -790,7 +790,7 @@ enddef
 # Perform a code action
 # Uses LSP "textDocument/codeAction" request
 export def CodeAction()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -802,7 +802,7 @@ enddef
 # Perform a workspace wide symbol lookup
 # Uses LSP "workspace/symbol" request
 export def SymbolSearch(queryArg: string)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -825,7 +825,7 @@ enddef
 
 # Display the list of workspace folders
 export def ListWorkspaceFolders()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -835,7 +835,7 @@ enddef
 
 # Add a workspace folder. Default is to use the current folder.
 export def AddWorkspaceFolder(dirArg: string)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -858,7 +858,7 @@ enddef
 
 # Remove a workspace folder. Default is to use the current folder.
 export def RemoveWorkspaceFolder(dirArg: string)
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -881,7 +881,7 @@ enddef
 
 # expand the previous selection or start a new selection
 export def SelectionExpand()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -891,7 +891,7 @@ enddef
 
 # shrink the previous selection or start a new selection
 export def SelectionShrink()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -901,7 +901,7 @@ enddef
 
 # fold the entire document
 export def FoldDocument()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
@@ -927,7 +927,7 @@ enddef
 
 # Display the LSP server capabilities
 export def ShowServerCapabilities()
-  var lspserver: dict<any> = s:curbufGetServerChecked()
+  var lspserver: dict<any> = s:CurbufGetServerChecked()
   if lspserver->empty()
     return
   endif
index 9a71724cb3583ad57c04f714337ad871cf7d36f5..74a693fac4cf94e4522531e639e77ff772ce997c 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 s: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 s: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 s: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 s:StartServer(lspserver: dict<any>): number
   if lspserver.running
     util.WarnMsg("LSP server for is already running")
     return 0
@@ -90,9 +90,9 @@ def s:startServer(lspserver: dict<any>): number
                out_mode: 'raw',
                err_mode: 'raw',
                noblock: 1,
-               out_cb: function('s:output_cb', [lspserver]),
-               err_cb: function('s:error_cb', [lspserver]),
-               exit_cb: function('s:exit_cb', [lspserver])}
+               out_cb: function('s:Output_cb', [lspserver]),
+               err_cb: function('s:Error_cb', [lspserver]),
+               exit_cb: function('s:Exit_cb', [lspserver])}
 
   lspserver.data = ''
   lspserver.caps = {}
@@ -122,7 +122,7 @@ enddef
 
 # Request: 'initialize'
 # Param: InitializeParams
-def s:initServer(lspserver: dict<any>)
+def s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s: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 s:GetLspPosition(): dict<number>
   var lnum: number = line('.') - 1
   var col: number = charcol('.') - 1
   return {line: lnum, character: col}
@@ -400,17 +400,17 @@ enddef
 
 # Return the current file name and current cursor position as a LSP
 # TextDocumentPositionParams structure
-def s:getLspTextDocPosition(): dict<dict<any>>
+def s:GetLspTextDocPosition(): dict<dict<any>>
   # interface TextDocumentIdentifier
   # interface Position
   return {textDocument: {uri: util.LspFileToUri(@%)},
-         position: s:getLspPosition()}
+         position: s:GetLspPosition()}
 enddef
 
 # Get a list of completion items.
 # Request: "textDocument/completion"
 # Param: CompletionParams
-def s:getCompletion(lspserver: dict<any>, triggerKind_arg: number): void
+def s: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")
@@ -426,7 +426,7 @@ def s:getCompletion(lspserver: dict<any>, triggerKind_arg: number): void
 
   # interface CompletionParams
   #   interface TextDocumentPositionParams
-  req.params = s:getLspTextDocPosition()
+  req.params = s:GetLspTextDocPosition()
   #   interface CompletionContext
   req.params.context = {triggerKind: triggerKind_arg}
 
@@ -439,7 +439,7 @@ enddef
 
 # Request: "textDocument/definition"
 # Param: DefinitionParams
-def s:gotoDefinition(lspserver: dict<any>, peek: bool)
+def s:GotoDefinition(lspserver: dict<any>, peek: bool)
   # Check whether LSP server supports jumping to a definition
   if !lspserver.caps->has_key('definitionProvider')
                                || !lspserver.caps.definitionProvider
@@ -454,7 +454,7 @@ def s:gotoDefinition(lspserver: dict<any>, peek: bool)
   var req = lspserver.createRequest('textDocument/definition')
   # interface DefinitionParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
   lspserver.sendMessage(req)
 
   lspserver.waitForReponse(req)
@@ -462,7 +462,7 @@ enddef
 
 # Request: "textDocument/declaration"
 # Param: DeclarationParams
-def s:gotoDeclaration(lspserver: dict<any>, peek: bool): void
+def s: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
@@ -478,7 +478,7 @@ def s:gotoDeclaration(lspserver: dict<any>, peek: bool): void
 
   # interface DeclarationParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -487,7 +487,7 @@ enddef
 
 # Request: "textDocument/typeDefinition"
 # Param: TypeDefinitionParams
-def s:gotoTypeDef(lspserver: dict<any>, peek: bool): void
+def s: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
@@ -503,7 +503,7 @@ def s:gotoTypeDef(lspserver: dict<any>, peek: bool): void
 
   # interface TypeDefinitionParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -512,7 +512,7 @@ enddef
 
 # Request: "textDocument/implementation"
 # Param: ImplementationParams
-def s:gotoImplementation(lspserver: dict<any>, peek: bool): void
+def s: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
@@ -528,7 +528,7 @@ def s:gotoImplementation(lspserver: dict<any>, peek: bool): void
 
   # interface ImplementationParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -538,7 +538,7 @@ enddef
 # get symbol signature help.
 # Request: "textDocument/signatureHelp"
 # Param: SignatureHelpParams
-def s:showSignature(lspserver: dict<any>): void
+def s: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")
@@ -548,7 +548,7 @@ def s:showSignature(lspserver: dict<any>): void
   var req = lspserver.createRequest('textDocument/signatureHelp')
   # interface SignatureHelpParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
 
   lspserver.sendMessage(req)
 
@@ -558,7 +558,7 @@ def s:showSignature(lspserver: dict<any>): void
   endif
 enddef
 
-def s:didSaveFile(lspserver: dict<any>, bnr: number): void
+def s: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 s:Hover(lspserver: dict<any>): void
   # Check whether LSP server supports getting hover information
   if !lspserver.caps->has_key('hoverProvider')
                        || !lspserver.caps.hoverProvider
@@ -587,7 +587,7 @@ def s:hover(lspserver: dict<any>): void
   var req = lspserver.createRequest('textDocument/hover')
   # interface HoverParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
   lspserver.sendMessage(req)
   if exists('g:LSPTest') && g:LSPTest
     # When running LSP tests, make this a synchronous call
@@ -597,7 +597,7 @@ enddef
 
 # Request: "textDocument/references"
 # Param: ReferenceParams
-def s:showReferences(lspserver: dict<any>, peek: bool): void
+def s:ShowReferences(lspserver: dict<any>, peek: bool): void
   # Check whether LSP server supports getting reference information
   if !lspserver.caps->has_key('referencesProvider')
                        || !lspserver.caps.referencesProvider
@@ -608,7 +608,7 @@ def s: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(s:GetLspTextDocPosition())
   req.params->extend({context: {includeDeclaration: true}})
 
   lspserver.peekSymbol = peek
@@ -621,7 +621,7 @@ enddef
 
 # Request: "textDocument/documentHighlight"
 # Param: DocumentHighlightParams
-def s:docHighlight(lspserver: dict<any>): void
+def s:DocHighlight(lspserver: dict<any>): void
   # Check whether LSP server supports getting highlight information
   if !lspserver.caps->has_key('documentHighlightProvider')
                        || !lspserver.caps.documentHighlightProvider
@@ -632,7 +632,7 @@ def s:docHighlight(lspserver: dict<any>): void
   var req = lspserver.createRequest('textDocument/documentHighlight')
   # interface DocumentHighlightParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
   lspserver.sendMessage(req)
   if exists('g:LSPTest') && g:LSPTest
     # When running LSP tests, make this a synchronous call
@@ -642,7 +642,7 @@ enddef
 
 # Request: "textDocument/documentSymbol"
 # Param: DocumentSymbolParams
-def s:getDocSymbols(lspserver: dict<any>, fname: string): void
+def s: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 s: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 s:PrepareCallHierarchy(lspserver: dict<any>, fname: string)
   # Check whether LSP server supports call hierarchy
   if !lspserver.caps->has_key('callHierarchyProvider')
                        || !lspserver.caps.callHierarchyProvider
@@ -729,13 +729,13 @@ def s:prepareCallHierarchy(lspserver: dict<any>, fname: string)
 
   # interface CallHierarchyPrepareParams
   #   interface TextDocumentPositionParams
-  req.params->extend(s:getLspTextDocPosition())
+  req.params->extend(s:GetLspTextDocPosition())
   lspserver.sendMessage(req)
 enddef
 
 # Request: "callHierarchy/incomingCalls"
 # Param: CallHierarchyItem
-def s:incomingCalls(lspserver: dict<any>, hierItem: dict<any>)
+def s: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 s: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 s:RenameSymbol(lspserver: dict<any>, newName: string)
   # Check whether LSP server supports rename operation
   if !lspserver.caps->has_key('renameProvider')
                        || !lspserver.caps.renameProvider
@@ -790,7 +790,7 @@ def s:renameSymbol(lspserver: dict<any>, newName: string)
   var req = lspserver.createRequest('textDocument/rename')
   # interface RenameParams
   #   interface TextDocumentPositionParams
-  req.params = s:getLspTextDocPosition()
+  req.params = s:GetLspTextDocPosition()
   req.params.newName = newName
   lspserver.sendMessage(req)
   if exists('g:LSPTest') && g:LSPTest
@@ -801,7 +801,7 @@ enddef
 
 # Request: "textDocument/codeAction"
 # Param: CodeActionParams
-def s:codeAction(lspserver: dict<any>, fname_arg: string)
+def s: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 s: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 s: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 s: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 s:SelectionRange(lspserver: dict<any>, fname: string)
   # Check whether LSP server supports selection ranges
   if !lspserver.caps->has_key('selectionRangeProvider')
                        || !lspserver.caps.selectionRangeProvider
@@ -921,14 +921,14 @@ def s:selectionRange(lspserver: dict<any>, fname: string)
   var req = lspserver.createRequest('textDocument/selectionRange')
   # interface SelectionRangeParams
   # interface TextDocumentIdentifier
-  req.params->extend({textDocument: {uri: util.LspFileToUri(fname)}, positions: [s:getLspPosition()]})
+  req.params->extend({textDocument: {uri: util.LspFileToUri(fname)}, positions: [s:GetLspPosition()]})
   lspserver.sendMessage(req)
 
   lspserver.waitForReponse(req)
 enddef
 
 # Expand the previous selection or start a new one
-def s:selectionExpand(lspserver: dict<any>)
+def s: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 s: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 s: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 s: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 s:ShowCapabilities(lspserver: dict<any>)
   echo "Capabilities of '" .. lspserver.path .. "' LSP server:"
   for k in lspserver.caps->keys()->sort()
     echo k .. ": " .. lspserver.caps[k]->string()
@@ -1018,54 +1018,54 @@ export def NewLspServer(path: string, args: list<string>): dict<any>
   }
   # Add the LSP server functions
   lspserver->extend({
-    startServer: function('s:startServer', [lspserver]),
-    initServer: function('s:initServer', [lspserver]),
-    stopServer: function('s:stopServer', [lspserver]),
-    shutdownServer: function('s:shutdownServer', [lspserver]),
-    exitServer: function('s:exitServer', [lspserver]),
-    setTrace: function('s:setTrace', [lspserver]),
-    nextReqID: function('s:nextReqID', [lspserver]),
-    createRequest: function('s:createRequest', [lspserver]),
-    createResponse: function('s:createResponse', [lspserver]),
-    createNotification: function('s:createNotification', [lspserver]),
-    sendResponse: function('s:sendResponse', [lspserver]),
-    sendMessage: function('s:sendMessage', [lspserver]),
-    waitForReponse: function('s:waitForReponse', [lspserver]),
+    startServer: function('s:StartServer', [lspserver]),
+    initServer: function('s:InitServer', [lspserver]),
+    stopServer: function('s:StopServer', [lspserver]),
+    shutdownServer: function('s:ShutdownServer', [lspserver]),
+    exitServer: function('s:ExitServer', [lspserver]),
+    setTrace: function('s:SetTrace', [lspserver]),
+    nextReqID: function('s:NextReqID', [lspserver]),
+    createRequest: function('s:CreateRequest', [lspserver]),
+    createResponse: function('s:CreateResponse', [lspserver]),
+    createNotification: function('s:CreateNotification', [lspserver]),
+    sendResponse: function('s:SendResponse', [lspserver]),
+    sendMessage: function('s:SendMessage', [lspserver]),
+    waitForReponse: function('s:WaitForReponse', [lspserver]),
     processReply: function(handlers.ProcessReply, [lspserver]),
     processNotif: function(handlers.ProcessNotif, [lspserver]),
     processRequest: function(handlers.ProcessRequest, [lspserver]),
     processMessages: function(handlers.ProcessMessages, [lspserver]),
     getDiagByLine: function(diag.GetDiagByLine, [lspserver]),
-    textdocDidOpen: function('s:textdocDidOpen', [lspserver]),
-    textdocDidClose: function('s:textdocDidClose', [lspserver]),
-    textdocDidChange: function('s:textdocDidChange', [lspserver]),
-    sendInitializedNotif: function('s:sendInitializedNotif', [lspserver]),
-    getCompletion: function('s:getCompletion', [lspserver]),
-    gotoDefinition: function('s:gotoDefinition', [lspserver]),
-    gotoDeclaration: function('s:gotoDeclaration', [lspserver]),
-    gotoTypeDef: function('s:gotoTypeDef', [lspserver]),
-    gotoImplementation: function('s:gotoImplementation', [lspserver]),
-    showSignature: function('s:showSignature', [lspserver]),
-    didSaveFile: function('s:didSaveFile', [lspserver]),
-    hover: function('s:hover', [lspserver]),
-    showReferences: function('s:showReferences', [lspserver]),
-    docHighlight: function('s:docHighlight', [lspserver]),
-    getDocSymbols: function('s:getDocSymbols', [lspserver]),
-    textDocFormat: function('s:textDocFormat', [lspserver]),
-    prepareCallHierarchy: function('s:prepareCallHierarchy', [lspserver]),
-    incomingCalls: function('s:incomingCalls', [lspserver]),
-    outgoingCalls: function('s:outgoingCalls', [lspserver]),
-    renameSymbol: function('s:renameSymbol', [lspserver]),
-    codeAction: function('s:codeAction', [lspserver]),
-    workspaceQuery: function('s:workspaceQuerySymbols', [lspserver]),
-    addWorkspaceFolder: function('s:addWorkspaceFolder', [lspserver]),
-    removeWorkspaceFolder: function('s:removeWorkspaceFolder', [lspserver]),
-    selectionRange: function('s:selectionRange', [lspserver]),
-    selectionExpand: function('s:selectionExpand', [lspserver]),
-    selectionShrink: function('s:selectionShrink', [lspserver]),
-    foldRange: function('s:foldRange', [lspserver]),
-    executeCommand: function('s:executeCommand', [lspserver]),
-    showCapabilities: function('s:showCapabilities', [lspserver])
+    textdocDidOpen: function('s:TextdocDidOpen', [lspserver]),
+    textdocDidClose: function('s:TextdocDidClose', [lspserver]),
+    textdocDidChange: function('s:TextdocDidChange', [lspserver]),
+    sendInitializedNotif: function('s:SendInitializedNotif', [lspserver]),
+    getCompletion: function('s:GetCompletion', [lspserver]),
+    gotoDefinition: function('s:GotoDefinition', [lspserver]),
+    gotoDeclaration: function('s:GotoDeclaration', [lspserver]),
+    gotoTypeDef: function('s:GotoTypeDef', [lspserver]),
+    gotoImplementation: function('s:GotoImplementation', [lspserver]),
+    showSignature: function('s:ShowSignature', [lspserver]),
+    didSaveFile: function('s:DidSaveFile', [lspserver]),
+    hover: function('s:Hover', [lspserver]),
+    showReferences: function('s:ShowReferences', [lspserver]),
+    docHighlight: function('s:DocHighlight', [lspserver]),
+    getDocSymbols: function('s:GetDocSymbols', [lspserver]),
+    textDocFormat: function('s:TextDocFormat', [lspserver]),
+    prepareCallHierarchy: function('s:PrepareCallHierarchy', [lspserver]),
+    incomingCalls: function('s:IncomingCalls', [lspserver]),
+    outgoingCalls: function('s:OutgoingCalls', [lspserver]),
+    renameSymbol: function('s:RenameSymbol', [lspserver]),
+    codeAction: function('s:CodeAction', [lspserver]),
+    workspaceQuery: function('s:WorkspaceQuerySymbols', [lspserver]),
+    addWorkspaceFolder: function('s:AddWorkspaceFolder', [lspserver]),
+    removeWorkspaceFolder: function('s:RemoveWorkspaceFolder', [lspserver]),
+    selectionRange: function('s:SelectionRange', [lspserver]),
+    selectionExpand: function('s:SelectionExpand', [lspserver]),
+    selectionShrink: function('s:SelectionShrink', [lspserver]),
+    foldRange: function('s:FoldRange', [lspserver]),
+    executeCommand: function('s:ExecuteCommand', [lspserver]),
+    showCapabilities: function('s:ShowCapabilities', [lspserver])
   })
 
   return lspserver
index 71840f8ab86862781eb9f199aac841bcd887d70d..25e41ed47fcffafc482e234d92f0e139f2838d57 100644 (file)
@@ -16,7 +16,7 @@ else
 endif
 
 # jump to a symbol selected in the outline window
-def s:outlineJumpToSymbol()
+def s: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 s:AddSymbolText(bnr: number,
                        symbolTypeTable: dict<list<dict<any>>>,
                        pfx: string,
                        text: list<string>,
@@ -99,7 +99,7 @@ def s: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)
+       s:AddSymbolText(bnr, s.children, prefix, text, lnumMap, true)
       endif
     endfor
   endfor
@@ -137,7 +137,7 @@ export def UpdateOutlineWindow(fname: string,
   # First two lines in the buffer display comment information
   var lnumMap: list<dict<any>> = [{}, {}]
   var text: list<string> = []
-  s:addSymbolText(fname->bufnr(), symbolTypeTable, '', text, lnumMap, false)
+  s:AddSymbolText(fname->bufnr(), symbolTypeTable, '', text, lnumMap, false)
   append('$', text)
   w:lspSymbols = {filename: fname, lnumTable: lnumMap,
                                symbolsByLine: symbolLineTable}
@@ -150,13 +150,13 @@ export def UpdateOutlineWindow(fname: string,
   prevWinID->win_gotoid()
 
   # Highlight the current symbol
-  s:outlineHighlightCurrentSymbol()
+  s:OutlineHighlightCurrentSymbol()
 
   # re-enable refreshing the outline window
   skipRefresh = false
 enddef
 
-def s:outlineHighlightCurrentSymbol()
+def s: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 s:OutlineCleanup()
   # Remove the outline autocommands
   :silent! autocmd! LSPOutline
 
@@ -279,8 +279,8 @@ export def OpenOutlineWindow()
     au!
     autocmd BufEnter * call g:LspRequestDocSymbols()
     # when the outline window is closed, do the cleanup
-    autocmd BufUnload LSP-Outline call s:outlineCleanup()
-    autocmd CursorHold * call s:outlineHighlightCurrentSymbol()
+    autocmd BufUnload LSP-Outline call s:OutlineCleanup()
+    autocmd CursorHold * call s:OutlineHighlightCurrentSymbol()
   augroup END
 
   prevWinID->win_gotoid()
index 3b5e070def21b1ac11b17da00b2c105f5856cd84..49c2ddebda0c2d48927c0c8a9ab43d64d6456070 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 s: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)
 
@@ -35,11 +35,11 @@ export def SelectionStart(lspserver: dict<any>, sel: list<dict<any>>)
   # save the reply for expanding or shrinking the selected text.
   lspserver.selection = {bnr: bnr, selRange: sel[0], index: 0}
 
-  s:selectText(bnr, sel[0].range)
+  s:SelectText(bnr, sel[0].range)
 enddef
 
 # Locate the range in the LSP reply at a specified level
-def s:getSelRangeAtLevel(selRange: dict<any>, level: number): dict<any>
+def s: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 s: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
@@ -80,11 +80,11 @@ export def SelectionModify(lspserver: dict<any>, expand: bool)
     var idx: number = lspserver.selection.index
 
     # Locate the range in the LSP reply for the current selection
-    selRange = s:getSelRangeAtLevel(selRange, lspserver.selection.index)
+    selRange = s:GetSelRangeAtLevel(selRange, lspserver.selection.index)
 
     # If the current selection is present in the LSP reply, then modify the
     # selection
-    if s:selectionFromLSP(selRange.range, startpos, endpos)
+    if s:SelectionFromLSP(selRange.range, startpos, endpos)
       if expand
        # expand the selection
         if selRange->has_key('parent')
@@ -95,12 +95,12 @@ export def SelectionModify(lspserver: dict<any>, expand: bool)
        # shrink the selection
        if idx > 0
          idx -= 1
-          selRange = s:getSelRangeAtLevel(lspserver.selection.selRange, idx)
+          selRange = s:GetSelRangeAtLevel(lspserver.selection.selRange, idx)
          lspserver.selection.index = idx
        endif
       endif
 
-      s:selectText(bnr, selRange.range)
+      s:SelectText(bnr, selRange.range)
       return
     endif
   endif
index 9459a2cee61d2ee3737996198604d81120a2152b..19ff04da2e02e7343491dcf74f5f71bd7aac946a 100644 (file)
@@ -25,18 +25,18 @@ else
 endif
 
 # close the signature popup window
-def s:closeSignaturePopup(lspserver: dict<any>)
+def s:CloseSignaturePopup(lspserver: dict<any>)
   lspserver.signaturePopup->popup_close()
   lspserver.signaturePopup = -1
 enddef
 
-def s:closeCurBufSignaturePopup()
+def s:CloseCurBufSignaturePopup()
   var lspserver: dict<any> = buf.CurbufGetServer()
   if lspserver->empty()
     return
   endif
 
-  s:closeSignaturePopup(lspserver)
+  s:CloseSignaturePopup(lspserver)
 enddef
 
 # Initialize the signature triggers for the current buffer
@@ -53,19 +53,19 @@ export def SignatureInit(lspserver: dict<any>)
                                        .. "<C-R>=LspShowSignature()<CR>"
   endfor
   # close the signature popup when leaving insert mode
-  autocmd InsertLeave <buffer> call s:closeCurBufSignaturePopup()
+  autocmd InsertLeave <buffer> call s:CloseCurBufSignaturePopup()
 enddef
 
 # Display the symbol signature help
 export def SignatureDisplay(lspserver: dict<any>, sighelp: dict<any>): void
   if sighelp->empty()
-    s:closeSignaturePopup(lspserver)
+    s:CloseSignaturePopup(lspserver)
     return
   endif
 
   if sighelp.signatures->len() <= 0
     util.WarnMsg('No signature help available')
-    s:closeSignaturePopup(lspserver)
+    s:CloseSignaturePopup(lspserver)
     return
   endif
 
index e46887df0f1444adb38ce75d963cabda1677aa2a..6b09430ad7b8a8b433cbaa5fbc8569306b807ff1 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 s: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 s:JumpToWorkspaceSymbol(popupID: number, result: number): void
   # clear the message displayed at the command-line
   echo ''
 
index abddb4ec7caa05689658a9fe564f28b78aa26662..77a09f6aa3c5e2acd7c07854d138ce633faec6fc 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 s: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 s:Set_lines(lines: list<string>, A: list<number>, B: list<number>,
                                        new_lines: list<string>): list<string>
   var i_0: number = A[0]
 
@@ -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('s:Edit_sort_func')
 
   var lines: list<string> = bnr->getbufline(start_line + 1, finish_line + 1)
   var fix_eol: bool = bnr->getbufvar('&fixeol')
@@ -168,7 +168,7 @@ export def ApplyTextEdits(bnr: number, text_edits: list<dict<any>>): void
   for e in updated_edits
     var A: list<number> = [e.A[0] - start_line, e.A[1]]
     var B: list<number> = [e.B[0] - start_line, e.B[1]]
-    lines = s:set_lines(lines, A, B, e.lines)
+    lines = s:Set_lines(lines, A, B, e.lines)
   endfor
 
   #echomsg 'lines(2) = ' .. string(lines)
@@ -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 s: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')
@@ -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)
+       s:ApplyTextDocumentEdit(change)
       endif
     endfor
     return
index 4da8915a9c0debe71df42978575f1f4bff17cfef..fa06c734a0e208ff4bf2a58c11775a0e7f94f8fb 100644 (file)
@@ -27,19 +27,12 @@ if has('patch-8.2.4257')
   lspf.gotoDeclaration = lsp.GotoDeclaration
   lspf.gotoTypedef = lsp.GotoTypedef
   lspf.gotoImplementation = lsp.GotoImplementation
-  lspf.gotoDefinition = lsp.GotoDefinition
-  lspf.gotoDeclaration = lsp.GotoDeclaration
-  lspf.gotoTypedef = lsp.GotoTypedef
-  lspf.gotoImplementation = lsp.GotoImplementation
   lspf.showDiagnostics = lsp.ShowDiagnostics
   lspf.showCurrentDiag = lsp.LspShowCurrentDiag
   lspf.jumpToDiag = lsp.JumpToDiag
-  lspf.jumpToDiag = lsp.JumpToDiag
-  lspf.jumpToDiag = lsp.JumpToDiag
   lspf.diagHighlightEnable = lsp.DiagHighlightEnable
   lspf.diagHighlightDisable = lsp.DiagHighlightDisable
   lspf.showReferences = lsp.ShowReferences
-  lspf.showReferences = lsp.ShowReferences
   lspf.outline = lsp.Outline
   lspf.textDocFormat = lsp.TextDocFormat
   lspf.incomingCalls = lsp.IncomingCalls
@@ -73,19 +66,12 @@ elseif has('patch-8.2.4019')
   lspf.gotoDeclaration = lsp_import.GotoDeclaration
   lspf.gotoTypedef = lsp_import.GotoTypedef
   lspf.gotoImplementation = lsp_import.GotoImplementation
-  lspf.gotoDefinition = lsp_import.GotoDefinition
-  lspf.gotoDeclaration = lsp_import.GotoDeclaration
-  lspf.gotoTypedef = lsp_import.GotoTypedef
-  lspf.gotoImplementation = lsp_import.GotoImplementation
   lspf.showDiagnostics = lsp_import.ShowDiagnostics
   lspf.showCurrentDiag = lsp_import.LspShowCurrentDiag
   lspf.jumpToDiag = lsp_import.JumpToDiag
-  lspf.jumpToDiag = lsp_import.JumpToDiag
-  lspf.jumpToDiag = lsp_import.JumpToDiag
   lspf.diagHighlightEnable = lsp_import.DiagHighlightEnable
   lspf.diagHighlightDisable = lsp_import.DiagHighlightDisable
   lspf.showReferences = lsp_import.ShowReferences
-  lspf.showReferences = lsp_import.ShowReferences
   lspf.outline = lsp_import.Outline
   lspf.textDocFormat = lsp_import.TextDocFormat
   lspf.incomingCalls = lsp_import.IncomingCalls