clojure-vim/acid.nvim

The "<C-]>" keybinding to jump to declaration throws an error

daveyarwood opened this issue · 4 comments

This is similar to #35, but the error message looks like potentially a different issue.

When I put my cursor over a symbol and press <C-]> to jump to declaration, I get this error:

error caught while executing async callback:
NvimError(b"Vim:E5108: Error while calling lua chunk for luaeval(): ...vim/bundle/acid.nvim//lua/acid/middlewares/go_to.lua:13: Vim(let):error caught in request handler '/home/dave/.vim/bundle/acid.nvim/rplugin/python3/acid:function:AcidFindFileInPath [[]]':",)
Traceback (most recent call last):
  File "/home/dave/.vim/bundle/acid.nvim/rplugin/python3/acid/__init__.py", line 38, in <lambda>
    nvim.async_call(lambda: handler_impl(msg, wc, key))
  File "/home/dave/.vim/bundle/acid.nvim/rplugin/python3/acid/__init__.py", line 21, in impl
    nvim.funcs.luaeval(lua_cmd, msg)
  File "/usr/local/lib/python3.5/dist-packages/pynvim/api/nvim.py", line 299, in call
    return self.request('nvim_call_function', name, args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pynvim/msgpack_rpc/session.py", line 102, in request
    raise self.error_wrapper(err)
pynvim.api.nvim.NvimError: b"Vim:E5108: Error while calling lua chunk for luaeval(): ...vim/bundle/acid.nvim//lua/acid/middlewares/go_to.lua:13: Vim(let):error caught in request handler '/home/dave/.vim/bundle/acid.nvim/rplugin/python3/acid:function:AcidFindFileInPath [[]]':"

the call was requested at
  File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "../../.vim/bundle/acid.nvim/rplugin/python3/acid/nrepl/__init__.py", line 68, in run
    callback(incoming, self, key)
  File "/home/dave/.vim/bundle/acid.nvim/rplugin/python3/acid/__init__.py", line 38, in handler
    nvim.async_call(lambda: handler_impl(msg, wc, key))

I couldn't reproduce this one either, though I tried with a java method and nothing happened - instead of showing the error.

If you could give me more details on this one, I'll be able to dig further.

Thanks in advance,
Henry

Trying it again today after updating, and it's working sometimes (even for jumping to a definition in a dependency library, or in clojure.core! Nice! 👍 )

It seems like it just fails when my cursor is over a Java inter-op form like System/getProperty. When I press <C-]>, I get the error I posted above involving AcidFindFileInPath, and acid completely stops working after that point, and I have to restart Neovim to get it back.

From /tmp/acid-log-handler.log:

2019-03-23 17:51:20,417 - [acid.nvim :DEBUG] - fpath is None
2019-03-23 17:51:20,420 - [acid.nvim :DEBUG] - Hitting cache for ns 'alda.util'
2019-03-23 17:51:27,329 - [acid.nvim :DEBUG] - fpath is None
2019-03-23 17:51:27,330 - [acid.pure :DEBUG] - Supplied path is /home/dave/code/alda-core/src/alda/util
2019-03-23 17:51:27,331 - [acid.pure :DEBUG] - Attempting reverse match: [/crs/: litu/adla/crs/eroc-adla/edoc/evad/emoh/] -> 9
2019-03-23 17:51:27,332 - [acid.pure :DEBUG] - Found path list: ['alda', 'util']
2019-03-23 17:51:27,338 - [acid.session :INFO] - sending data -> {'ns': 'alda.util', 'id': '917e2d8573fb4634b0690a68389c7c12', 'op': 'info', 'symbol': 'System/getProperty'}
2019-03-23 17:51:27,339 - [acid :INFO] - {'wc': 'c513c4a846f148308d644c9ec3005ca6-watcher'}
2019-03-23 17:51:27,351 - [acid :INFO] - Finding path
2019-03-23 17:51:27,354 - [acid.session :INFO] - stopped watching key 917e2d8573fb4634b0690a68389c7c12-e960de5b5fbf4dcaa097ee7f6c1e94c2-watcher
2019-03-23 17:51:27,355 - [acid :INFO] - {'modifiers': '#{:public :static}', 'returns': 'java.lang.String', 'class': 'java.lang.System', 'status': ['done'], 'argtypes': ['java.lang.String', 'java.lang.String'], 'arglists-str': '[java.lang.String java.lang.String]\n[java.lang.String]', 'member': 'getProperty', 'session': 'a51c17cc-eaff-4cf3-a6c3-5f77a61020ef', 'javadoc': 'http://docs.oracle.com/javase/11/docs/api/java/lang/System.html#getProperty-java.lang.String-java.lang.String-', 'id': '917e2d8573fb4634b0690a68389c7c12', 'file': [], 'throws': []}

Another thing I noticed: I'm used to jumping to tags via ctags, and the keybindings for that are <C-]> to jump to a definition, then <C-t> to pop the tag stack and return to where you were. I wonder if it would be possible for acid to push the definition spots to the tag stack, so that <C-t> works? (either that or override the <C-t> behavior and maintain its own tag stack?)

Can I close this one?

Yep -- since #54, acid.nvim isn't binding <C-]> anymore, so the issue is moot :)