Closed ihasdapie closed 3 years ago
Does omni without the coc work fine for you? If yes, it's most likely issue with coc.
Omni works fine without coc, so maybe the problem is on coc's end. Still I find it odd that there's an unknown function error.
I pushed a small change. Can you give it a test?
function! org#complete(findstart, base) abort
let l:cmd = printf("orgmode.omni(%s, '%s')", a:findstart, a:base)
return luaeval(l:cmd)
endfunction
setlocal omnifunc=org#complete
^ This workaround works perfectly with coc-omni
.
Looking into coc-omni
the it seems to be an upstream problem with coc.nvim
's workspace
not picking up on v:lua
variables.
I think I'll also open up an issue on the coc.nvim
repo to see if this is the case.
// coc-sources/packages/omni/index.js
doComplete: async function (opt) {
let {nvim} = workspace
let func = await nvim.eval('&omnifunc') // here
if (!func) return null
let {line, colnr, col} = opt
let startcol = col
try {
startcol = await nvim.call(func, [1, ''])
The above wrapper function would enable orgmode.nvim
to work with coc.nvim
out of the box, which is important to people like me who use coc.nvim
for it's maturity & relative feature richness.
However I understand that wrapping it in a viml function would go against the "write vim plugins in lua and keep it that way" philosophy, and that the above solution is really just a janky patch
I did something similar in last commit https://github.com/kristijanhusak/orgmode.nvim/commit/9b412b3a8356d15423f953f90d56c38b8917f290, isn't it working for you?
Oh I didn't see that, let me try
Yup, works great. Thanks!
Describe the bug
I haven't found the time to migrate over the nvim's built in lsp & nvim-compe and so I'm trying to use coc-omni with orgmode.nvim. However it doesn't work. Is the problem with this plugin or on coc-omni's side?
Steps to reproduce
Expected behavior
Omni func is callable & works?
Emacs functionality
No response
Screenshots and recordings
OS / Distro
Manjaro
Neovim version/commit
0.5
Additional context
No response