glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.57k stars 144 forks source link

"TypeError: nvim.call_atomic is not a function" on Nvim HEAD #1603

Closed justinmk closed 2 months ago

justinmk commented 2 months ago

What I tried to do

use nvim 0.10 HEAD which has deprecated nvim_call_atomic()

https://github.com/neovim/neovim/pull/28433

What happened

If I try to use latest Nvim HEAD which has marked nvim_call_atomic() as deprecated, firenvim fails and this error is reported in devtools console:

index.js:6714 TypeError: nvim.call_atomic is not a function

If I remove FUNC_API_DEPRECATED_SINCE(12) from nvim source and rebuild nvim, then firenvim works.

justinmk commented 2 months ago

It looks like this is the only use of nvim_call_atomic in firenvim: https://github.com/glacambre/firenvim/blob/e99aa603f5311a850be1d02759b0ec62ce3990a3/src/frame.ts#L118-L128

That could be replaced with nvim_exec_lua.

justinmk commented 2 months ago

Just to be clear, nvim_call_atomic() was not removed in Nvim HEAD, it was only marked as deprecated. So I'm wondering if firenvim might be filtering-out deprecated API functions, when it generates bindings ?

glacambre commented 2 months ago

@justinmk Thanks a lot for the early report/warning. The problem indeed was that depecrated functions were ignored by Firenvim (ironically, this saved Firenvim from breaking when https://github.com/neovim/neovim/commit/f31db30975479cb6b57247f124a65f4362f80bfe was merged, there was another bug in Firenvim's API that got triggered by this).

I'll attempt to fix a couple of other issues today and and then publish a new release to the chrome/firefox add-on stores this evening.