From: Yegappan Lakshmanan Date: Wed, 16 Nov 2022 06:14:22 +0000 (-0800) Subject: Address a few FIXMEs X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5205964bd3b812dc24f9a867d002f74192325d10;p=vim-lsp.git Address a few FIXMEs --- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 36056aa..45df1d2 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -43,7 +43,7 @@ enddef # New LSP diagnostic messages received from the server for a file. # Update the signs placed in the buffer for this file -def ProcessNewDiags(lspserver: dict, bnr: number) +export def ProcessNewDiags(lspserver: dict, bnr: number) if opt.lspOptions.autoPopulateDiags DiagsUpdateLocList(lspserver, bnr) endif @@ -67,14 +67,6 @@ def ProcessNewDiags(lspserver: dict, bnr: number) DiagsRefreshSigns(lspserver, bnr) enddef -# FIXME: Remove this function once the Vim bug (calling one exported function -# from another exported function in an autoload script is not working) is -# fixed. Replace the calls to this function directly with calls to -# ProcessNewDiags(). -export def UpdateDiags(lspserver: dict, bnr: number) - ProcessNewDiags(lspserver, bnr) -enddef - # process a diagnostic notification message from the LSP server # Notification: textDocument/publishDiagnostics # Param: PublishDiagnosticsParams diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index c26355a..292b581 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -222,7 +222,7 @@ def LspLeftInsertMode() if lspserver->empty() || !lspserver.running return endif - diag.UpdateDiags(lspserver, bnr) + diag.ProcessNewDiags(lspserver, bnr) enddef # Add buffer-local autocmds when attaching a LSP server to a buffer diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 20b753c..fe4a7af 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -960,8 +960,8 @@ def DidSaveFile(lspserver: dict, bnr: number): void # Notification: 'textDocument/didSave' # Params: DidSaveTextDocumentParams var params = {textDocument: {uri: util.LspBufnrToUri(bnr)}} - # FIXME: should concern 'params.text' on - # 'lspserver.caps.textDocumentSync.save.includeText' too? + # FIXME: Need to set "params.text" when + # 'lspserver.caps.textDocumentSync.save.includeText' is set to true. lspserver.sendNotification('textDocument/didSave', params) enddef diff --git a/autoload/lsp/util.vim b/autoload/lsp/util.vim index 9b083c2..7cd4c40 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -83,7 +83,7 @@ export def LspUriRemote(uri: string): bool enddef # Convert a Vim filename to an LSP URI (file://) -def ConvertFilenameToUri(fname: string): string +export def LspFileToUri(fname: string): string var uri: string = fname->fnamemodify(':p') var on_windows: bool = false @@ -108,17 +108,9 @@ def ConvertFilenameToUri(fname: string): string return uri enddef -# FIXME: Remove this function once the Vim bug (calling one exported function -# from another exported function in an autoload script is not working) is -# fixed. Replace the calls to this function directly with calls to -# ConvertFilenameToUri(). -export def LspFileToUri(fname: string): string - return ConvertFilenameToUri(fname) -enddef - # Convert a Vim buffer number to an LSP URI (file://) export def LspBufnrToUri(bnr: number): string - return ConvertFilenameToUri(bnr->bufname()) + return LspFileToUri(bnr->bufname()) enddef # Returns the byte number of the specified LSP position in buffer 'bnr'.