calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
dangercoder 2021-01-14T08:54:23.000800Z

Hi! Is it possible to "go to definition" on java classes? Im using version 2.0.150

roelof 2021-01-14T08:55:05.001400Z

Very fast develppment. almost every day a new version 🙂

2
pez 2021-01-14T08:59:07.002800Z

@jarvinenemil my experience is that it works on some java things, but not all. Haven’t quite figured it out. Maybe @bozhidar can tell us some of what to expect.

dangercoder 2021-01-14T09:00:49.004200Z

Cool, thank you guys for all the work you've put into making Calva possible. I've been following the progress along from the shadows for quite some time 🙂.

2❤️
bozhidar 2021-01-14T10:02:56.004400Z

> @jarvinenemil my experience is that it works on some java things, but not all. Haven’t quite figured it out. Maybe @bozhidar can tell us some of what to expect.

bozhidar 2021-01-14T10:03:29.004800Z

We recently pin-pointed the problem here https://github.com/clojure-emacs/orchard/issues/103

2👍
bozhidar 2021-01-14T10:04:07.005700Z

Basically, it's a classloader issue that's a result of changes to dynapath. I hope Jeff or someone else will tackle this soon.

Christian 2021-01-14T10:30:40.006300Z

I just installed calva and clj-kondo. Should I uninstall clj-kondo?

1✅
pez 2021-01-14T11:53:07.006900Z

I know you have. Hope we will manage to keep you!

clyfe 2021-01-14T12:48:52.008900Z

Should calva Ctrl+LeftArrow (or right), by default, do structural movement instead slurp/barf?

pez 2021-01-14T13:01:37.009400Z

@claudius.nicolae, is that a suggestion or a question? 😃

clyfe 2021-01-14T13:29:52.010200Z

@pez both; also ctrl+w entreched to "close tab" and ctrl+shift+w "reopen tab"

clyfe 2021-01-14T13:31:48.011400Z

the defaults annoy me a bit, but after some custom settings I find Calva pretty usable

clyfe 2021-01-14T13:34:06.011900Z

In any case, probably default keybindings are no longer up for change..

clyfe 2021-01-15T08:38:26.033600Z

I saw the setting, but I don't want to eval on save. Ctrl+L for now.

1👍
Janne Sauvala 2021-01-14T14:01:36.013Z

Is this Java navigation issue related to thing that I cannot navigate to methods like Integer/parseInt in Calva?

clyfe 2021-01-14T14:03:06.013100Z

no

Janne Sauvala 2021-01-14T14:04:41.013300Z

@christiaaan Yes, clj-kondo plugin should be now redundant

1☝️
Janne Sauvala 2021-01-14T14:09:58.013500Z

It would be nice to have this feature since Cursive can do it

clyfe 2021-01-14T14:12:24.013700Z

doubt we'll ever have that in an editor (as opposed to ide).

clyfe 2021-01-14T14:15:49.015500Z

also, tab formatter moves my (comment last comma up, and the ,) trick doesn't seem to work (that @seancorfield shown, but he uses Clover)

pez 2021-01-14T14:46:32.015600Z

This is on purpose. tab does a “full” reformat of the current form, while the as-you-type reformat leaves the paren-trail alone. This is the first time I hear someone mention it. But we can make the .) trick work as well, because that makes sense. Please file an issue about it.

pez 2021-01-14T14:48:31.015800Z

So, enlighten me here, why would it be so hard with Integer/parseInt? As I said above, I haven’t really figured the nuances out here.

pez 2021-01-14T14:57:03.016400Z

Yes, they are. Everything in Calva is always up for change. Not that we just change things willy-nilly, but with Calva the users are treated as actors who can adapt to change. See https://github.com/BetterThanTomorrow/calva/wiki#the-tao-of-calva for more about that. Anyway, I am assuming you are on Windows? That’s where ctrl+arrows navigate, if I have understood things correctly. I was unaware about this when designing the default shortcuts. This, in combination with a decision to try unify Calva shortcuts across plattforms has caused quite some grief. I think we should challenge that decision some.

clyfe 2021-01-14T14:57:50.016600Z

I believe supporting that would entail jar decompilation (or at least reflection) and creating a text mirror of it to be shown in the editor.

pez 2021-01-14T14:59:38.016800Z

Yeah, so decompilation is a bit out of our reach atm, of course. 😃

pez 2021-01-14T15:00:31.017Z

Thanks!

clyfe 2021-01-14T15:01:10.017200Z

I'm on Linux actually, but I use ctrl+w to close (and with shift to reopen) extensively in multiple UIs (mainly web browsing and code editing). Afaict, calva prefers editing to movement, and I think movement should come first.

Janne Sauvala 2021-01-14T15:07:39.019700Z

vscode Java extension handled jar decompilation when I tried it. Maybe it would provide some tips how to do it

pez 2021-01-14T15:11:34.019900Z

I once reach out to that team about using their extension’s API. I think I might have worded things strangely because they never responded. But anyway, that extension might have an API we can use for this. If someone wants to investigate that, it would be quite awesome. Let’s bring in @brandon.ringe in this loop. He has gone all static analysis crazy lately. 😃

Janne Sauvala 2021-01-14T15:14:14.020100Z

Great if we could use their API 🙂

bringe 2021-01-14T16:55:59.020500Z

The expand selection (ctrl+w) binding is discussed in this issue: https://github.com/BetterThanTomorrow/calva/issues/725. You can weigh in there.

bringe 2021-01-14T16:56:45.020800Z

Also this is related to your navigation concern: https://github.com/BetterThanTomorrow/calva/issues/666

bringe 2021-01-14T17:00:29.021100Z

As you can see, default shortcuts are are pretty tricky to get right. Of course, not impossible to improve, though.

bringe 2021-01-14T17:04:01.021400Z

I think the appropriate place to add this would be in clojure-lsp. It's a todo item in their docs:

bringe 2021-01-14T17:06:12.021800Z

No idea the details though, so if anyone knows, help is appreciated. It's low priority for me atm, with other clojure-lsp-related things being higher on my list. nrepl/orchard may have some answers too, of course.

pez 2021-01-14T18:34:29.022200Z

Let the Clojure team know what editor and extension you are using, Calva-friends. 😃

2🎉
clyfe 2021-01-14T18:38:58.022300Z

Long live custom keybindings! But really, if you want to be friendlier to new adopters these defaults should change.

clyfe 2021-01-14T18:59:40.022500Z

Also, Load current file: `alt+ctrl+c enter` is so far off, that's my most used command (I usually put a tidbit at the end that runs stuff).

pez 2021-01-14T19:08:48.022700Z

Interesting. Both that you find it far of and that you put that tidbit there. ctrl+alt+enter is reasonably free, maybe that would be quite natural?

clyfe 2021-01-14T19:09:20.022900Z

customized to Ctrl+L, but ctrl+alt+enter sounds better

clyfe 2021-01-14T19:10:45.023100Z

idea is: change some fn, then reload, then check the output of the tidbit in the repl

lread 2021-01-14T19:11:50.023900Z

https://calva.io/paredit/ are very cool!

12❤️
pez 2021-01-14T20:15:45.024800Z

Thanks! It is almost as much work behind that page as with implementing the commands. No, not really, but the way Paredit commands compose on primitives and on each other, some of them were super quick to implement. I still want to make the drag/push commands more helpful in maps and binding boxes. I failed last time I tried, but maybe soon I’ll be smart enough to figure it out.

dangercoder 2021-01-14T20:29:50.026500Z

Anyone found a good way to use Jack-in together with Reveal and deps.edn? I'm currently relying on connecting to a running nrepl through connect.

pez 2021-01-15T16:08:14.041600Z

Many thanks, @gldidonna! I tried it and it is really that easy. Good Ux work from @vlaaad!

1😊1🙌
practicalli-john 2021-01-16T10:50:40.067Z

I added a link to several configuration options to the PR incase they are of interest https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L507-L542

pez 2021-01-16T11:06:20.067700Z

Does any of those ^ help you, @jarvinenemil?

gabo 2021-01-14T20:55:01.026700Z

I've been adding:

:reveal
  {:extra-deps {vlaaad/reveal {:mvn/version "1.2.185"}}
   :jvm-opts   ["-Dvlaaad.reveal.prefs={:font-size,17}"]
   :main-opts  ["-m" "nrepl.cmdline"
                "--middleware" "[vlaaad.reveal.nrepl/middleware,cider.nrepl/cider-middleware]"]}
to the aliases of the project's deps.edn file, and then jacking in selecting the Clojure CLI option, and then the alias :reveal.

gabo 2021-01-14T20:56:30.026900Z

you don't need the :jvm-opts key, it could be:

:reveal
  {:extra-deps {vlaaad/reveal {:mvn/version "1.2.185"}}
   :main-opts  ["-m" "nrepl.cmdline"
                "--middleware" "[vlaaad.reveal.nrepl/middleware,cider.nrepl/cider-middleware]"]}
but I find the font too small

dangercoder 2021-01-14T21:06:00.027100Z

Your alias works perfectly with the Clojure-CLI option. I guess I might have some issues since I am trying Clojure-CLI+Shadow-cljs (it makes Reveal grey all the time).

dangercoder 2021-01-14T21:06:11.027300Z

I liked the bigger font 😄

pez 2021-01-14T21:07:48.027500Z

@gldidonna, PR please? https://calva.io/reveal/

gabo 2021-01-14T21:11:19.027800Z

Sure 😄

dangercoder 2021-01-14T21:12:07.028Z

Jack-in with: Clojure CLI + Shadow-Cljs won't work for me when using the reveal alias. Going to dig into it a little bit.

bringe 2021-01-14T21:17:38.028200Z

> if you want to be friendlier to new adopters these defaults should change Oh I mostly agree with you there

bringe 2021-01-14T21:18:22.028400Z

Regarding loading the current file, have you tried enabling eval on save? Maybe you don't want this though, but would make ctrl+s (or whatever save is bound to for you) eval the file

pez 2021-01-14T21:22:22.028600Z

How do you start things when you use connect, @jarvinenemil?

dangercoder 2021-01-14T21:26:18.028800Z

1. Make sure that shadow-cljs is running, shadow-cljs start from the shell. 2. Run Calva Jack In - Clojure CLI + shadow-cljs, choosing my aliases (the reveal alias is one of them). The REPL:s starts fine but Reveal is not connecting to the nrepl that has been started. I think that the main options gets overrided somehow.

pez 2021-01-14T21:31:48.029200Z

I meant when you don’t use jack-in. 😃

dangercoder 2021-01-14T21:32:40.029400Z

ah.. read it wrong, sorry a bit tired. Give me a sec

dangercoder 2021-01-14T22:12:53.029600Z

Actually the thing I tried before did not work with connect and Clojure CLI+shadow-cljs+reveal. I think that the reason the jack-in is not working is due to the nrepl middleware not getting loaded properly for Reveal. Going to look into it tomorrow, I want this setup to work 😁.

pez 2021-01-14T22:15:25.029900Z

Me too. 😃