Neovim 0.11 should have built-in basic snippet support with vim.snippet
module.
Can I make it work for code completion expansion of built-in vim.lsp.omnifunc
? To be more specific, I need to set it up for Golang’s gopls Language server function arguments placeholders expansion:
-- from my nvim's init.lua
vim.lsp.config['gopls'] = {
cmd = { 'gopls' },
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
root_markers = { 'go.work', 'go.mod', '.git' },
settings = {
gopls = {
usePlaceholders = true,
}
},
}
vim.lsp.enable('gopls')
With usePlaceholders
option, completion from LSP server should also return snippet for function arguments (as placeholders). I know it works, on the same machine with Emacs + Eglot LSP client. And with the same gopls and project testing on, of course.
Any idea how to make it work, besides to rely on 3rd party plugins like LuaSnip?