]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Move the "fname" argument to the end by using a lambda
authorAndreas Louv <andreas@louv.dk>
Sun, 16 Apr 2023 18:14:22 +0000 (20:14 +0200)
committerAndreas Louv <andreas@louv.dk>
Sun, 16 Apr 2023 18:56:27 +0000 (20:56 +0200)
autoload/lsp/lspserver.vim
autoload/lsp/symbol.vim

index 6f4f559fba5268d6bb409d170c4497669a90e157..ed5dfaa20f2edd3c5f62e9915122eb556f15bb42 100644 (file)
@@ -928,8 +928,9 @@ def GetDocSymbols(lspserver: dict<any>, fname: string): void
   # interface DocumentSymbolParams
   # interface TextDocumentIdentifier
   var params = {textDocument: {uri: util.LspFileToUri(fname)}}
-  lspserver.rpc_a('textDocument/documentSymbol', params,
-                       function(symbol.DocSymbolReply, [fname]))
+  lspserver.rpc_a('textDocument/documentSymbol', params, (_, reply) => {
+    symbol.DocSymbolReply(lspserver, reply, fname)
+  })
 enddef
 
 # Request: "textDocument/formatting"
index 4c726796c2f4d6804a4c673a9dd15df7d6d8e2cd..597160656cf0893c7695a1180327dcb288a9fd7a 100644 (file)
@@ -578,7 +578,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
-export def DocSymbolReply(fname: string, lspserver: dict<any>, docsymbol: any)
+export def DocSymbolReply(lspserver: dict<any>, docsymbol: any, fname: string)
   var symbolTypeTable: dict<list<dict<any>>> = {}
   var symbolLineTable: list<dict<any>> = []