Fork me on GitHub
#calva
<
2022-01-08
>
introom03:01:08

Seeing an indentation issue as noted in the picture: Basically Calva does not indent the function arguments in the picture.

introom03:01:38

Or is it a desired behavior?

bringe04:01:49

I believe that is intended behavior.

Tero Matinlassi10:01:49

https://guide.clojure.style/#one-space-indent recommends a single space for indenting function arguments when there are no arguments on the same line as function name

Célio17:01:18

I’m taking a stab at https://github.com/BetterThanTomorrow/calva/issues/1451, so I’ve been trying to find out if there’s already some code in Calva for resolving the project’s source/class path. Apparently there’s no such code yet, is that right? I hope I’m missing something there, otherwise I’ll have to write code for that 😁

Célio18:01:42

I guess I can use getProjectRootUri and parse either deps.edn or project.clj at that location, then build the source/class path where I can lookup resources requested by the sideloader.

pez19:01:02

We don't have any code for that in Calva. Maybe you can query clojure-lsp for it?

Célio19:01:06

Thanks, I was searching through clojure-lsp’s source code but couldn’t find anything. I’ll keep looking.

ericdallo20:01:54

you can use the rawServerInfo LSP command which calva already uses it somewhere IIRC, it contains a project-root-uri

pez20:01:06

It's the classpath we need, right? If clojure-lsp can't provide it, we also have deps.clj bundled.

ericdallo20:01:58

we can easily provide the classpath on rawServerInfo as we already have that info on clojure-lsp

ericdallo20:01:23

if you think it makes sense to use I can commit this addition to the output of rawServerInfo

pez10:01:06

It makes perfect sense to me.

Célio18:01:42

That would be fantastic @UKFSJSM38 thanks so much!

Célio19:01:14

Looks like source paths are already included in the server info output, it’s just classpath info like dependency jars, etc, that are not yet included.

ericdallo19:01:38

Yes, it's a one line fix, I will commit this night to be available on next release and master clojure-lsp

Célio19:01:59

No worries, I was just nosing around the source code:nose: and playing with it a little bit 😄

🙂 1
ericdallo15:01:53

Just made a commit adding the :classpath on clojure-lsp serverInfo command :)

🙌 4
Célio20:01:01

Thanks a lot @UKFSJSM38! I just ran a quick test here, the classpath is coming out as nil for me, even when I tap (:classpath db-value) from inside the server-info fn. Does this happen to you too? I’m debugging “the clojure way” as described here https://clojure-lsp.io/development/

Célio21:01:06

Nevermind, the classpath came out fine when I called initialize on a different project root 👍

👍 1