feat: Only show completion for available types (#36)

This commit is contained in:
danymat
2022-01-11 11:30:14 +01:00
parent a6ea2c1718
commit b1c5e39104

View File

@@ -132,9 +132,15 @@ function neogen.jumpable(reverse)
end end
function neogen.match_commands() function neogen.match_commands()
local language = neogen.configuration.languages[vim.bo.filetype]
if not language or not language.parent then
return { "func", "class", "type", "file" } return { "func", "class", "type", "file" }
end end
return vim.tbl_keys(language.parent)
end
function neogen.generate_command() function neogen.generate_command()
vim.api.nvim_command([[ vim.api.nvim_command([[
function! s:match_commands(arg, line, pos) function! s:match_commands(arg, line, pos)