]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Address a few FIXMEs
authorYegappan Lakshmanan <yegappan@yahoo.com>
Wed, 16 Nov 2022 06:14:22 +0000 (22:14 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Wed, 16 Nov 2022 06:14:22 +0000 (22:14 -0800)
autoload/lsp/diag.vim
autoload/lsp/lsp.vim
autoload/lsp/lspserver.vim
autoload/lsp/util.vim

index 36056aabc5f8a2221e9d7b17a4e4462ea0400d1e..45df1d285fa3e70c8e9a96b87108287cb47a2cb3 100644 (file)
@@ -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<any>, bnr: number)
+export def ProcessNewDiags(lspserver: dict<any>, bnr: number)
   if opt.lspOptions.autoPopulateDiags
     DiagsUpdateLocList(lspserver, bnr)
   endif
@@ -67,14 +67,6 @@ def ProcessNewDiags(lspserver: dict<any>, 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<any>, bnr: number)
-  ProcessNewDiags(lspserver, bnr)
-enddef
-
 # process a diagnostic notification message from the LSP server
 # Notification: textDocument/publishDiagnostics
 # Param: PublishDiagnosticsParams
index c26355a99da67d41384f2d88b52da66aeab90e5c..292b581764eaccc72310f3ec85778d88afffbfb2 100644 (file)
@@ -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
index 20b753c3d0d246a8919f653c8cdc6af967e0c58f..fe4a7afb9881d81b8e18b66e65405a1575924d18 100644 (file)
@@ -960,8 +960,8 @@ def DidSaveFile(lspserver: dict<any>, 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
 
index 9b083c275df1b9f5bc6419cba3d817900879c344..7cd4c40cd82b913611b82b74fef5ef23513e0789 100644 (file)
@@ -83,7 +83,7 @@ export def LspUriRemote(uri: string): bool
 enddef
 
 # Convert a Vim filename to an LSP URI (file://<absolute_path>)
-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://<absolute_path>)
 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'.