From: Andreas Louv Date: Sun, 16 Apr 2023 18:14:22 +0000 (+0200) Subject: Move the "fname" argument to the end by using a lambda X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fc1c123e6b5b625d1e675e7be11d142e1810b12c;p=vim-lsp.git Move the "fname" argument to the end by using a lambda --- 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, 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, docsymbol: any) +export def DocSymbolReply(lspserver: dict, docsymbol: any, fname: string) var symbolTypeTable: dict>> = {} var symbolLineTable: list> = []