From fc1c123e6b5b625d1e675e7be11d142e1810b12c Mon Sep 17 00:00:00 2001
From: Andreas Louv <andreas@louv.dk>
Date: Sun, 16 Apr 2023 20:14:22 +0200
Subject: [PATCH] Move the "fname" argument to the end by using a lambda

---
 autoload/lsp/lspserver.vim | 5 +++--
 autoload/lsp/symbol.vim    | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim
index 6f4f559..ed5dfaa 100644
--- a/autoload/lsp/lspserver.vim
+++ b/autoload/lsp/lspserver.vim
@@ -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"
diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim
index 4c72679..5971606 100644
--- a/autoload/lsp/symbol.vim
+++ b/autoload/lsp/symbol.vim
@@ -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>> = []
 
-- 
2.51.0