Fork me on GitHub
#inf-clojure
<
2021-04-04
>
apt03:04:11

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?

bozhidar13:04:20

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

apt16:04:07

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

apt16:04:34

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

apt16:04:27

> Sounds like some bug to me. Best to file a ticket. Okay, I’ll investigate it further.

bozhidar06:04:13

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. 😄

bozhidar06:04:05

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.

bozhidar06:04:06

@U11BV7MTK might be able to share more on the topic.

bozhidar06:04:09

(I see that according to git blame he added this to the README)

dpsutton13:04:32

I probably reformatted the paragraph but that copy preceded me

bozhidar07:04:32

Ah, okay. I'll just remove it then.

Shantanu Kumar11:04:30

Hi, is anybody using inf-clojure with clojure-lsp? Can you share any config snippets?

bozhidar13:04:05

@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.

bozhidar13:04:26

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.

Shantanu Kumar13:04:38

@bozhidar Thanks. You intended to share an article link maybe?

bozhidar13:04:59

Indeed. 😄