Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "K" keybinding to look up docs throws an error #35

Closed
daveyarwood opened this issue Mar 23, 2019 · 13 comments
Closed

The "K" keybinding to look up docs throws an error #35

daveyarwood opened this issue Mar 23, 2019 · 13 comments

Comments

@daveyarwood
Copy link
Contributor

After the port to lua, I was able to install acid, run a REPL in another terminal, and then use it from Neovim by running :AcidRequire and then eval-ing forms with cpp.

However, when I put my cursor over a symbol and press K to look up the docs, I get this error:

error caught while executing async callback:
NvimError(b"Vim:E5108: Error while calling lua chunk for luaeval(): ...me/dave/.vim/bundle/acid.nvim//lua/acid/features.lua:120: attempt to concatenate field 'name' (a nil value)",)
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(): ...me/dave/.vim/bundle/acid.nvim//lua/acid/features.lua:120: attempt to concatenate field 'name' (a nil value)"

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))
@hkupty
Copy link
Member

hkupty commented Mar 23, 2019

Hi @daveyarwood, Thanks for the issue.

I tried to reproduce it here but I couldn't.
Can you give me more context?
Also, there's a log file: /tmp/acid-log-handler.log

You can find what acid sent and what it got back, that can be helpful so I can understand when the nrepl can send the message without name.

Cheers,
Henry

@daveyarwood
Copy link
Contributor Author

After updating acid, I'm getting a different error now from the one I posted above.

When I put my cursor over a reference to a function (stream-seq) that I defined earlier in the same file and press K, I get this error:

error caught while executing async callback:
NvimError(b'Vim:E5108: Error while calling lua chunk for luaeval(): ...im/bundle/acid.nvim//lua/acid/middlewares/floats.lua:58: Expected 3 arguments',)
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(): ...im/bundle/acid.nvim//lua/acid/middlewares/floats.lua:58: Expected 3 arguments'

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))

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

2019-03-23 17:54:07,341 - [acid.nvim :DEBUG] - fpath is None
2019-03-23 17:54:07,343 - [acid.nvim :DEBUG] - Hitting cache for ns 'alda.parser'
2019-03-23 17:54:07,346 - [acid.session :INFO] - sending data -> {'symbol': 'stream-seq', 'id': '37f59c00b7e04079972e3522f856fc83', 'op': 'eldoc', 'ns': 'alda.parser'}
2019-03-23 17:54:07,398 - [acid.session :INFO] - stopped watching key 37f59c00b7e04079972e3522f856fc83-31b0f83a9275498cb23f827f50c89e04-watcher
2019-03-23 17:54:07,400 - [acid :INFO] - {'name': 'stream-seq', 'session': 'c7714bac-4b3f-499a-a294-7d2a3540b71e', 'id': '37f59c00b7e04079972e3522f856fc83', 'docstring': 'Coerces a channel into a lazy sequence that can be lazily consumed or\n   realized at will.', 'eldoc': [['ch']], 'status': ['done'], 'type': 'function', 'ns': 'alda.parser'}

@hkupty
Copy link
Member

hkupty commented Apr 9, 2019

Is this one still happening?

@daveyarwood
Copy link
Contributor Author

I'm unable to test, as after updating, I'm still experiencing a variant of #56, so I can't successfully invoke :AcidRequire.

@daveyarwood
Copy link
Contributor Author

daveyarwood commented Apr 9, 2019

Running acid.nvim on the fix/get-ns-issue branch to circumvent #56, I still get the same error I posted above when I use K.

@hkupty hkupty mentioned this issue Apr 12, 2019
@hkupty
Copy link
Member

hkupty commented Apr 12, 2019

Asking for docs on java methods return the data differently from the response to a clojure symbols docs request, so the fn should be more flexible now.

Please check and let me know if I can close this issue.

Best

@daveyarwood
Copy link
Contributor Author

Hmm, after updating, I get this error when I run :AcidRequire:

Error detected while processing :
E5105: Error while calling lua chunk: ...me/dave/.vim/bundle/acid.nvim//lua/acid/features.lua:91: Vim(let):no request handler registered for "/home/dave/.vim/bundle/acid.nvim/rplugin/python3/acid:function:AcidGetNs"

@hkupty
Copy link
Member

hkupty commented Apr 13, 2019

😩

@hkupty
Copy link
Member

hkupty commented Apr 13, 2019

From that fix to HEAD, this is the only commit that changes rplugin: 3f195e5

I'll investigate further, but apparently #56 is back.

@hkupty
Copy link
Member

hkupty commented Apr 13, 2019

Looks like #57 worked because of this actually: ebfb32a.

I know how to fix that then.

@daveyarwood
Copy link
Contributor Author

K is working nicely after updating just now 👍 💯

@daveyarwood
Copy link
Contributor Author

It's working both for Clojure functions and Java interop forms.

Nicely done!

@hkupty
Copy link
Member

hkupty commented Apr 13, 2019

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants