Closed oryband closed 1 year ago
I'm going to need more information to work this one out. As far as I know nobody else is experiencing this. Which version of Neovim are you on and which OS? If anyone else has seen this can I get your version details too, thanks.
Also how do you start your REPL? Maybe your REPL stays around and then it doesn't end the NVIM process somehow? Does it exit when you don't start REPL?
@Olical @Invertisment I've updated the initial message with as much information as i could get, also attempting to answer your questions.
Disabling client-on-load configuration resolves the issue. Any idea what's going on?
{ "Olical/conjure",
ft = { "clojure" },
version = "4.40.x",
config = function()
vim.api.nvim_set_var("conjure#client_on_load", false)
end
},
Do you have babashka installed and up to date?
To me it sounds like the babashka auto started REPL is hanging when being asked to close. Not sure why though 🤔
I have babashka installed and available :!bb
returns repl printout but it doesn't look like Conjure is running it - there is no .nrepl-port and the default port 8794 is unavailable (why is that btw?)
The issue surfaces even without babashka - When connecting to standard JVM Clojure repl. When quitting nvim it still hangs. In practice it means I can't quit when connecting to a REPL
The issue still persists with this configuration (client on load is enabled)
{ "Olical/conjure",
ft = { "clojure" },
version = "4.40.x",
config = function()
vim.api.nvim_set_var("conjure#client#clojure#nrepl#connection#auto_repl#enabled", false)
end
},
I've found out I had a hanging .nrepl-port
file up my dir tree pointing to some random port 44479, i removed it and now auto-repl babashka is started and connected - but the problem persists. I don't think bb repl is related here since the issue also occurs if I connect to an existing JVM clojure repl.
I think that you should comment parts of your config until you find a problem.
I think that you should comment parts of your config until you find a problem.
I did - I'm just using default AstroNvim and the minimal configuration example I posted above
Notice the issue was introduced at 4.40.0 ; If I go back to 4.39.0 it doesn't reproduce and everything is fine
Help?
I still can't reproduce your issue, have you tried it without the ft = { "clojure" }
? The Clojure client's "on-load" function that you'd disabled to fix the issue only disables the initial connection to a .nrepl-port
file. That's the only thing it removes, so it's somehow related to that.
Would you be able to set g:conjure#debug = v:true
and capture the logs from startup? It'll have a few more details in there that might help.
@Olical Sure. Here's the output for v4.40.0 when opening a file called x.clj
, inputting text defn
and calling doc word on it. Notice the issue reproduces when I close nvim and I can't find documentation where I could read the debug log after closing nvim, so I'm not sure this would be helpful:
; Sponsored by @frenchy64 ❤
; --------------------------------------------------------------------------------
; No nREPL port file found
; Starting auto-repl: bb nrepl-server localhost:8794
; --------------------------------------------------------------------------------
; doc (word): defn
; --------------------------------------------------------------------------------
; localhost:8794 (connected): .nrepl-port
; debug: send
{:id "9b88028a-f0a5-424e-9b68-14c4d927da82" :op "describe"}
; debug: send
{:id "507e6d8b-5cce-43c9-9b6c-0564c9e67634" :op "ls-sessions"}
; debug: send
{:code "(ns conjure.internal (:require [clojure.pprint :as pp]))(defn pprint [val w opts] (apply pp/write val (mapcat identity (assoc opts :stream w))))"
:id "62778941-bfaf-4e54-949a-48e297588898"
:op "eval"}
; debug: receive
{:id "9b88028a-f0a5-424e-9b68-14c4d927da82"
:ops {:clone {}
:close {}
:complete {}
:describe {}
:eldoc {}
:eval {}
:info {}
:load-file {}
:lookup {}
:ls-sessions {}}
:session "none"
:status ["done"]
:versions {:babashka "1.3.176" :babashka.nrepl "0.0.6-SNAPSHOT"}}
; debug: receive
{:id "507e6d8b-5cce-43c9-9b6c-0564c9e67634"
:session "none"
:sessions {}
:status ["done"]}
; debug: send
{:id "94c6b528-f532-4df1-8eb7-0c6c3e70c7e4" :op "clone"}
; debug: receive
{:id "62778941-bfaf-4e54-949a-48e297588898"
:ns "conjure.internal"
:session "none"
:value "nil"}
; debug: receive
{:id "62778941-bfaf-4e54-949a-48e297588898"
:ns "conjure.internal"
:session "none"
:value "#'conjure.internal/pprint"}
; debug: receive
{:id "62778941-bfaf-4e54-949a-48e297588898" :session "none" :status ["done"]}
; debug: send
{:code "(require 'clojure.repl)"
:id "43a7fadb-5cb3-4603-a573-15d2eedc0437"
:nrepl.middleware.print/options {:associative 1 :length 500 :level 50}
:nrepl.middleware.print/print "conjure.internal/pprint"
:op "eval"}
; debug: send
{:code "(clojure.repl/doc defn)"
:column 1
:file "/home/ory/Documents/x.clj"
:id "be2db4a0-a233-40e7-8ebb-e58d76753211"
:line 1
:nrepl.middleware.print/options {:associative 1 :length 500 :level 50}
:nrepl.middleware.print/print "conjure.internal/pprint"
:op "eval"}
; debug: receive
{:id "94c6b528-f532-4df1-8eb7-0c6c3e70c7e4"
:new-session "95c8418f-9102-4733-93f5-3260158b3093"
:session "none"
:status ["done"]}
; debug: send
{:code "#?(:clj 'clj :cljs 'cljs :cljr 'cljr :default 'unknown)"
:id "c846f6b6-5bd3-4353-b2c1-1c9100299d77"
:op "eval"
:session "95c8418f-9102-4733-93f5-3260158b3093"}
; debug: receive
{:id "43a7fadb-5cb3-4603-a573-15d2eedc0437"
:ns "conjure.internal"
:session "none"
:value "nil"}
; debug: receive
{:id "43a7fadb-5cb3-4603-a573-15d2eedc0437" :session "none" :status ["done"]}
; debug: receive
{:id "be2db4a0-a233-40e7-8ebb-e58d76753211"
:out "-------------------------
"
:session "none"}
; debug: receive
{:id "be2db4a0-a233-40e7-8ebb-e58d76753211"
:out "clojure.core/defn
"
:session "none"}
; debug: receive
{:id "be2db4a0-a233-40e7-8ebb-e58d76753211"
:out "([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?])
"
:session "none"}
; debug: receive
{:id "be2db4a0-a233-40e7-8ebb-e58d76753211"
:out "Macro
"
:session "none"}
; debug: receive
{:id "be2db4a0-a233-40e7-8ebb-e58d76753211"
:out " Same as (def name (fn [params* ] exprs*)) or (def
name (fn ([params* ] exprs*)+)) with any doc-string or attrs added
to the var metadata. prepost-map defines a map with optional keys
:pre and :post that contain collections of pre or post conditions.
"
:session "none"}
; debug: receive
{:id "be2db4a0-a233-40e7-8ebb-e58d76753211"
:ns "conjure.internal"
:session "none"
:value "nil"}
; debug: receive
{:id "be2db4a0-a233-40e7-8ebb-e58d76753211" :session "none" :status ["done"]}
; -------------------------
; clojure.core/defn
; ([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?])
; Macro
; Same as (def name (fn [params* ] exprs*)) or (def
; name (fn ([params* ] exprs*)+)) with any doc-string or attrs added
; to the var metadata. prepost-map defines a map with optional keys
; :pre and :post that contain collections of pre or post conditions.
; debug: receive
{:id "c846f6b6-5bd3-4353-b2c1-1c9100299d77"
:ns "conjure.internal"
:session "95c8418f-9102-4733-93f5-3260158b3093"
:value "clj"}
; debug: receive
{:id "c846f6b6-5bd3-4353-b2c1-1c9100299d77"
:session "95c8418f-9102-4733-93f5-3260158b3093"
:status ["done"]}
; --------------------------------------------------------------------------------
; Assumed session: Scottish Terrier (Clojure)
I've set up the same version of AstroNvim as you, installed Conjure, opened a Clojure file, evaluated a form and exited just fine 🤔 I'm currently on Neovim 0.9.0 since that's what Arch is providing me with. Your debug log looks fine, nothing out of the ordinary there... I'll try out the rest of your config if I can from your dotfiles.
Managed to run your AstroNvim user config, eval and close. On the version of Conjure you were using and the very latest one. I think something else is at play here but I'm not sure what.
I've done everything I can I think though, I've run your exact Neovim config (not sure what it tried to install but looked a little scary 😅 ) and it works absolutely fine for me. I'm not sure what else it could be unless it requires a specific CPU architecture or something.
Or is it to do with snap? I see you mentioned that in your initial details. I'm just installing Neovim from the Arch package manager.
Our only difference that I can see (other than machine and OS things) is Neovim version. I'm not sure why that'd make a difference though.
@Olical you've solved it for me! I just updated to Neovim 0.9.0 and it solved the issue. Thanks for following up. Now I can update to the most recent Conjure version, it's central to my job.
WEIRD! So sorry you ran into this issue, I'm very glad it's working now. I honestly don't know what could've caused this or why I couldn't reproduce it despite literally using your nvim config repo. Hopefully whatever weirdness caused that doesn't crop up again!
If interested you can downgrade to the Nvim version i used and maybe it'll reproduce there.
On Fri, May 12, 2023, 00:46 Martynas M @.***> wrote:
[image: image] https://user-images.githubusercontent.com/1641263/237820316-28f81409-052e-4613-a5e9-217d8f5eed81.png
— Reply to this email directly, view it on GitHub https://github.com/Olical/conjure/issues/481#issuecomment-1544724516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA4FO7TCSYPUQZGF6T5OJTXFVM3XANCNFSM6AAAAAAXA4SQOY . You are receiving this because you modified the open/close state.Message ID: @.***>
When quitting vim (for example using
:q
), the window closes and I'm back to my terminal, but then it hangs and I do not get a prompt. My CPU % spikes to 100% and everything grinds to a halt unless I quickly press Ctrl-C or kill all nvim processes.Here's a minimal configuration where this reproduces: Note I'm using AstroNvim distribution v3.10.3, and I'm not connecting to any external REPL - just opening a clojure file (could it be it launches a REPL behind the scenes without me knowing?)