autoload/lsp/diag.vim | 10 +--------- autoload/lsp/lsp.vim | 2 +- autoload/lsp/lspserver.vim | 4 ++-- autoload/lsp/util.vim | 12 ++---------- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 36056aabc5f8a2221e9d7b17a4e4462ea0400d1e..45df1d285fa3e70c8e9a96b87108287cb47a2cb3 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 @@ -65,14 +65,6 @@ return endif 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 diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index c26355a99da67d41384f2d88b52da66aeab90e5c..292b581764eaccc72310f3ec85778d88afffbfb2 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -222,7 +222,7 @@ var lspserver: dict = buf.CurbufGetServer() 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 20b753c3d0d246a8919f653c8cdc6af967e0c58f..fe4a7afb9881d81b8e18b66e65405a1575924d18 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -960,8 +960,8 @@ # 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 9b083c275df1b9f5bc6419cba3d817900879c344..7cd4c40cd82b913611b82b74fef5ef23513e0789 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -83,7 +83,7 @@ return uri =~# '^\w\+::' || uri =~# '^[a-z][a-z0-9+.-]*://' 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 @@ 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'.