Hey folks. I’m experimenting using inf-clojure
with some lein
projects.
I added this to my lein
profile:
:jvm-opts ["-Dclojure.server.repl={:port 5555 :accept clojure.core.server/repl}"]
Some questions on inf-clojure
+ emacs
:
• I’m running lein repl
and then using inf-connect
in Emacs. Is that correct? There’s no way to skip the lein repl
step, right?
• After starting a repl in one lein
project, I won’t be able to use another one with this config, as it would attempt to use the same port. Any practical solution for that? (w/o changing the project.clj
source code)
• The go-to definition functionality won’t work for stuff in m2
(it asks for creating the folder in the maven dir.) I’m using Doom Emacs, if that matters. What do I need to do in order to navigate source code from external libs? (to be honest, I’m not familiar with thisto worked in my previous setup anyway – maybe cider
knew how to handle it? If so, any solutions or workarounds for not using cider
?> I’m running lein repl and then using inf-connect in Emacs. Is that correct? There’s no way to skip the lein repl step, right?
You can also run lein repl
directly in Emacs.
This would also solve your other problem with the unique port number. inf-clojure
doesn't need a socket REPL per se, as it just runs the REPL process direction in Emacs.
> The go-to definition functionality won’t work for stuff in m2 (it asks for creating the folder in the maven dir.)
Sounds like some bug to me. Best to file a ticket.
> You can also run `lein repl` directly in Emacs.
Do you mean using inf-clojure
and selecting lein repl
?
If so, I’m able to connect to it, but something is adding extra whitespaces to the repl.
For example, this is the result of evaluating some namespace twice:
user=> #_=> #_=> #_=> nil
postman.aux.event=> #_=> #_=> #_=> nil
This does not happen when I manually start a lein repl and use inf-connect
. I’m wondering if this is a known issue.Also, [1] says that ‘terminal repls’ are discouraged: > It is highly recommended to use a cons pair like `("localhost" . 5555)` to connect to a socket REPL, terminal REPLs are inherently hard to work with and support will be deprecated in the foreseeable future. I’m wondering what exactly is a ‘terminal repl’ in this context. [1]: https://github.com/clojure-emacs/inf-clojure#caveats
> Sounds like some bug to me. Best to file a ticket. Okay, I’ll investigate it further.
Hmm, I missed that message about the future deprecation, and this was never on the table, so I guess I just didn't read carefully enough some PR. 😄
Yeah, I meant just selecting lein repl
in the list - new extra prompts likely indicate the evaluation of several expressions or something along those lines.
@dpsutton might be able to share more on the topic.
(I see that according to git blame
he added this to the README)
I probably reformatted the paragraph but that copy preceded me
That wording seems to have showed up in this commit: https://github.com/clojure-emacs/inf-clojure/commit/b53074a1eeae9e21f6f99f4d5a96bb294c7ba79a
Ah, okay. I'll just remove it then.
Hi, is anybody using inf-clojure with clojure-lsp? Can you share any config snippets?
@kumarshantanu This article is for CIDER https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/, but the setup for inf-clojure
should be more or less the same.
The important thing is decide which version of some functionality do you want in case it's provided by both inf-clojure
and lsp
- e.g. code completion. In the case of CIDER you'd be leaning more on CIDER's features and in the case of inf-clojure
probably people would like to lean more on lsp-mode
features.
@bozhidar Thanks. You intended to share an article link maybe?
https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide
Indeed. 😄