Fork me on GitHub
#calva
<
2021-01-14
>
dangercoder08:01:23

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

roelof08:01:05

Very fast develppment. almost every day a new version 🙂

calva 2
pez08:01:07

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

dangercoder09:01:49

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
pez11:01:07

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

bozhidar10:01:56

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

bozhidar10:01:29

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

👍 2
bozhidar10:01:07

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

clyfe12:01:52

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

pez13:01:37

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

clyfe13:01:52

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

clyfe13:01:48

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

clyfe13:01:06

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

pez14:01:03

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.

clyfe15:01:10

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.

bringe16:01:59

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

bringe16:01:45

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

bringe17:01:29

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

clyfe18:01:58

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

clyfe18:01:40

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

pez19:01:48

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?

clyfe19:01:20

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

clyfe19:01:45

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

bringe21:01:38

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

bringe21:01:22

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

clyfe08:01:26

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

👍 1
Janne Sauvala14:01:36

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

Janne Sauvala14:01:58

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

clyfe14:01:24

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

pez14:01:31

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.

clyfe14:01:50

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.

pez14:01:38

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

Janne Sauvala15:01:39

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

pez15:01:34

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 @U9A1RLFNV in this loop. He has gone all static analysis crazy lately. 😃

Janne Sauvala15:01:14

Great if we could use their API 🙂

bringe17:01:01

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

bringe17:01:12

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.

clyfe14:01:49

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

pez14:01:32

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.

pez18:01:29

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

🎉 1
pez20:01:45

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.

dangercoder20:01:50

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.

gabo20:01:01

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.

gabo20:01:30

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

dangercoder21:01:00

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

dangercoder21:01:11

I liked the bigger font 😄

pez21:01:48

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

gabo21:01:19

Sure 😄

dangercoder21:01:07

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.

pez21:01:22

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

dangercoder21:01:18

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.

pez21:01:48

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

dangercoder21:01:40

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

dangercoder22:01:53

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

pez22:01:25

Me too. 😃

gabo01:01:59

A little late but here's the PR https://github.com/BetterThanTomorrow/calva/pull/949 (I branched out from published since in was only a doc change, hope that's ok)

pez16:01:14

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

🙌 1
😊 1
practicalli10:01:40

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

pez11:01:20

Does any of those ^ help you, @jarvinenemil?