nvim-snippy
nvim-snippy copied to clipboard
Visual indicators for empty placeholders (tab stops)
Description
Is snippy expected to fill empty tab stops with placeholder text? Using lua-language-server, most of the snippets already have placeholder text at the tab stops, but the function () snippet does not. Because of that I couldn't tell where the tab stops were:

Steps to Reproduce
snippy config:
return {
"dcampos/nvim-snippy",
config = function()
local loaded, snippy = pcall(require, "snippy")
if not loaded then return end
vim.api.nvim_create_autocmd("CompleteDone", {
group = vim.api.nvim_create_augroup("snippy", { clear = true }),
callback = function() snippy.complete_done() end,
})
snippy.setup({
mappings = {
is = {
["<tab>"] = "next",
["<s-tab>"] = "previous",
},
},
})
end,
}
- Set up lua-language-server and omnicomplete
- In a Lua file type
local functhen trigger omnicomplete with<c-x><c-o> - Select the
function ()snippet from the pop-up menu then hit<esc>or<c-y>
Expected Result
The tab stops would have placeholder text to indicate where the tab stops are.
Actual Result
There's no placeholder text for tab stops.
Additional Context
No response
Hi,
Is snippy expected to fill empty tab stops with placeholder text? Using lua-language-server, most of the snippets already have placeholder text at the tab stops, but the
function ()snippet does not.
I don't think the snippet engine should do that, personally, because sometimes the user really may want to have an empty placeholder for some tab stops. Maybe the language server could be changed to add the placeholders?
Because of that I couldn't tell where the tab stops were
Yes, I agree it would be nice to have some visual indicators. Currently, neovim still doesn't support "inline" virtual text (which they call "anticonceal"), but when it does, I think we could add some character to act like a virtual cursor for every empty tab stop, much like in VSCode.
Currently, the only way to "find" the tab stops is by pressing <tab> (or whichever mapping you may use).
I'm already eager for anticonceal, and I love the idea of potentially using it for this. Thanks for the explanation! It seems for now I'll just need to be conscious of not always having placeholders to work from.