Fork me on GitHub
#vim
<
2018-12-03
>
tylerw17:12:31

Has anyone tried replant.vim using the latest Neovim (e.g., NVIM v0.3.2-941-gb0ebf61d3) and pynvim (0.3.1)? I don't get anything back using ReplantListResources and the namespace refresh blows up with an error.

dominicm19:12:46

@tylerw sorry to hear that. I'm using these without issue, can you tell me: - cider version - java version - clojure version

tylerw19:12:10

deps.edn:

{:aliases {:repl {:main-opts ["-m" "repl"]
                  :extra-paths ["dev"]
                  :extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"}
                               nrepl/nrepl {:mvn/version "0.5.0"}
                               cider/cider-nrepl {:mvn/version "0.18.0"}
                               refactor-nrepl {:mvn/version "2.4.0"}}}}
 :deps {org.clojure/clojure {:mvn/version "RELEASE"}}
 :paths ["src" "resources"]}

tylerw19:12:43

Java:

java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

tylerw19:12:05

Clojure is 1.10.0-RC3

tylerw19:12:57

I'm a bit out of practice, and I'm doing Advent of Code to get back into Clojure, so I fully expect I've configured something wrong. But I did try to start from a blank slate

tylerw19:12:03

The error I get when I attempt to refresh is:

Error detected while processing function replant#ui#refresh[1]..replant#send#message_callback:
line    2:
E117: Unknown function: G_replant_send_message_callback
E15: Invalid expression: G_replant_send_message_callback(l:port, a:msg, a:callback)

dominicm20:12:38

@tylerw clojure 1.10 doesnt work with cider 18, can you try 19 snapshot?

😢 4
dominicm20:12:30

Or try 1.9 of clojure

tylerw20:12:10

@dominicm No luck, tried both cider 18 and 19-snapshot with clojure 1.10 and 1.9

dominicm20:12:46

@tylerw, sorry, just looked at your error. :UpdateRemotePlugins then restart nvim

tylerw21:12:15

could've sworn I'd done that, but I evidently I hadn't. Anyway, I am getting a new error now:

Error detected while processing function replant#ui#refresh[1]..replant#send#message_callback[2]..G_replant_send_message_callback[1]..remote#define#request:
line    2:
error caught in request handler '/Users/tyler/.config/nvim/plugged/vim-replant/rplugin/python3/replant:function:G_replant_send_message_callback [['59048', {'op': 'refresh', 'id': 'replant--f135fe2a-2b1c-4
bf1-b825-e00b44f0af8d'}, 'replant#handle_refresh_msg']]':
Traceback (most recent call last):
  File "/Users/tyler/.config/nvim/plugged/vim-replant/rplugin/python3/replant/__init__.py", line 46, in send_message_callback
    self.nvim.call(callback, m)
  File "/usr/local/lib/python3.7/site-packages/pynvim/api/nvim.py", line 299, in call
    return self.request('nvim_call_function', name, args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pynvim/msgpack_rpc/session.py", line 102, in request
    raise self.error_wrapper(err)
pynvim.api.nvim.NvimError: b'Vim(call):E716: Key not present in Dictionary: error'

dominicm21:12:27

@tylerw what clojure/cider combination?

dominicm21:12:17

I should probably make that code safer.

tylerw21:12:58

I get the same thing for all 4 combos Clojure {1.9,RELEASE} and cider {18,19-SNAPSHOT}

dominicm21:12:29

if has_key(a:msg, 'status') && s:contains(a:msg['status'], 'error') call replant#handle_plain_stack(a:msg['error']) endif This is the code that's broken

dominicm21:12:38

I assume all errors involve a stack

tylerw21:12:14

yeah, hmm. I'll dig into it

dominicm21:12:42

However, I don't know what's being sent, so I'm not sure how to handle it.

tylerw21:12:44

I wonder how I can find out what's erroring out if a:msg does not contain an error key

dominicm21:12:56

Happy to merge any PR you send

dominicm21:12:22

Stick an echom string(a:msg) before that line

tylerw21:12:33

ok. well thanks for all your help anyway!

dominicm21:12:34

Or, inside the if, rather

tylerw21:12:54

This is what it prints, not particularly helpful

{'id': 'replant--14bf0567-1613-4152-95c2-2b011212def4', 'op': 'refresh-all', 'session': '48e1bec3-2f25-43c4-ae83-67792a743928', 'status': ['done', 'unknown-op', 'error']}

dominicm21:12:55

@tylerw I'm really curious to know what the error message ends up looking like. If you only have time to add the echom, paste the message here and I should be able to fix it 12h from now.

dominicm21:12:11

Unknown-op? Ha!

dominicm21:12:28

You need to load the cider middleware into nrepl 😊

dominicm21:12:42

The easy way is to use vim-jack-in

tylerw21:12:36

ugh, really? The nREPL docs suggest .nrepl.edn now, I tried that:

❯ cat .nrepl.edn
{
 :bind         "localhost"
 :handler      "cider.nrepl/cider-nrepl-handler"
 :middleware   ["refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware"]
}

dominicm21:12:55

That might be unreleased, uncertain

tylerw21:12:45

ok, I'll try vim-jack-in or something else. at least I know what the issue (probably) is now

tylerw21:12:48

I appreciate your help

dominicm21:12:28

That's no problem.

dominicm21:12:08

I would love to have a better model which made it easier to expose useful errors. I want ex-info!

tylerw21:12:33

....and it works with vim-jack-in's :Clj

dominicm21:12:12

Great! 😊