[mini.completion] Confusion between completefunc
and omnifunc
#811
-
Embarrassingly, I've spent the last 3 hours trying to figure out why completion behaves differently when the local H ={}
H.test1 = function() end
H.test2 = function() end
H.test3 = function() end When
When
I've added print statements all over And to continue the
I suppose my expectation of how it should work is probably due to some fundamental misunderstanding about vim's completion function vs omni function. I tried reading help pages, but have not found the answer. It's not for the lack of trying. Can you help elaborate for me? I prefer the behavior when the source in |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Here is a minimal configuration one can test with: -- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps'
local path_package = vim.fn.stdpath("data") .. "/site/"
local mini_path = path_package .. "pack/deps/start/mini.nvim"
if not vim.loop.fs_stat(mini_path) then
vim.cmd('echo "Installing `mini.nvim`" | redraw')
local clone_cmd = {
"git",
"clone",
"--filter=blob:none",
"https://github.com/echasnovski/mini.nvim",
mini_path,
}
vim.fn.system(clone_cmd)
vim.cmd("packadd mini.nvim | helptags ALL")
vim.cmd('echo "Installed `mini.nvim`" | redraw')
end
-- Set up 'mini.deps' (customize to your liking)
require("mini.deps").setup({ path = { package = path_package } })
MiniDeps.add("williamboman/mason.nvim")
MiniDeps.add("williamboman/mason-lspconfig.nvim")
MiniDeps.add("neovim/nvim-lspconfig")
require("mini.completion").setup({
lsp_completion = {
source_func = "omnifunc",
auto_setup = true,
},
})
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls" }
})
require("lspconfig").lua_ls.setup({
on_attach = function(client, bufnr)
-- vim.bo[bufnr].omnifunc = "v:lua.MiniCompletion.completefunc_lsp"
end,
}) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the detailed description with explicit steps and setup!
I can reproduce even with by slightly tweaking my own setup. Plan to take a look closer in the near future.
It is surely can be an issue in 'mini.completion'. That said, I also am not aware of the obvious difference between how 'completefunc' and 'omnifunc' operates. |
Beta Was this translation helpful? Give feedback.
-
This should be solved on latest |
Beta Was this translation helpful? Give feedback.
This should be solved on latest
main
.