Skip to content

Doesn't connect to repl with neovim #3

Description

@grinderrz

macOS

$ cat src/user.clj
(ns user)

(def x "X")
$ clj '-J-Dclojure.server.repl={:port 5432 :accept clojure.core.server/repl}' -r  
Clojure 1.9.0  
user=> x  
"X"  
user=>  
$ nvim --version
NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/config -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/src/nvim/auto -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/include
Compiled by brew@HighSierra.local

Features: +acl +iconv +jemalloc +tui
...
$ nvim src/user.clj
:VimpireBite 127.0.0.1:5432

results in

Error detected while processing function vimpire#connection#RegisterPrefix[3]..vimpire#co
nnection#Start[1]..vimpire#connection#Connect:
line    2:
E475: Invalid argument: rpc option must be true

After fixing this with adding "rpc": v:true

     function! vimpire#connection#Connect(this, initCallback)
         return sockconnect("tcp", a:this.server,
-                    \ {"on_data":
+                    \ {"rpc": v:true,
+                    \  "on_data":
                     \  vimpire#connection#Dispatch(a:this, a:initCallback)})
     endfunction

There's no error anymore:

$ nvim src/user.clj
:VimpireBite 127.0.0.1:5432

:VimpireRepl

this opens 2 buffers with


Clojure

in first and

Could not determine the Namespace of the file.

This might have different reasons. Please check, that the server
is running and that the file does not contain syntax errors. The
interactive features will not be enabled.

Reason:
Vim(let):E716: Key not present in Dictionary: actions[a:action], a:bindings)

Call to sockconnect(...) now returns 2 (which is considered success), but call to "on_data" callback never happens for some reason. So we never finish initialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions