Open roxma opened 7 years ago
FWIW, the Java language server (https://github.com/eclipse/eclipse.jdt.ls) utilizes the completion textedit feature.
Regarding the additionalTextEdits
, I have since exposed another function LanguageClient_workspace_applyEdit()
https://github.com/autozimu/LanguageClient-neovim/commit/e5f91c7d9afbc976208d0bbeb2c4f8218052e995
After completion is done, following pseudo code should do the work
# assume the completed item is comp_item
if comp_item.get('additionalTextEdits') and self.nvim.funcs.exists('*LanguageClient_workspace_applyEdit'):
bufname = self.nvim.current.buffer.name
self.nvim.funcs.LanguageClient_workspace_applyEdit({bufname: comp_item.additionalTextEdits})
The only issue for me is that I'm not sure where should I put this action to.
@roxma Is anything blocking this issue? Does @autozimu's code work?
As per https://github.com/autozimu/LanguageClient-neovim/pull/121
Current vim snippet plugin's snippet syntax is different from lsp snippet.
NCM will use the well-defined lsp snippet syntax as the standard, and transform it into local snippet format.
The completion textedit should be useful for completion with auto importing, I guess. Yet I haven't seen a language server with this capability.