Hi! Is it possible to "go to definition" on java classes? Im using version 2.0.150
Very fast develppment. almost every day a new version 🙂
@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.
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 🙂.
> @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.
We recently pin-pointed the problem here https://github.com/clojure-emacs/orchard/issues/103
Basically, it's a classloader issue that's a result of changes to dynapath. I hope Jeff or someone else will tackle this soon.
I know you have. Hope we will manage to keep you!
Should calva Ctrl+LeftArrow (or right), by default, do structural movement instead slurp/barf?
@claudius.nicolae, is that a suggestion or a question? 😃
@pez both; also ctrl+w entreched to "close tab" and ctrl+shift+w "reopen tab"
the defaults annoy me a bit, but after some custom settings I find Calva pretty usable
In any case, probably default keybindings are no longer up for change..
I saw the setting, but I don't want to eval on save. Ctrl+L
for now.
Is this Java navigation issue related to thing that I cannot navigate to methods like Integer/parseInt
in Calva?
no
It would be nice to have this feature since Cursive can do it
doubt we'll ever have that in an editor (as opposed to ide).
also, tab formatter moves my (comment
last comma up, and the ,)
trick doesn't seem to work (that @seancorfield shown, but he uses Clover)
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.
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.
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.
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.
Yeah, so decompilation is a bit out of our reach atm, of course. 😃
Thanks!
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.
vscode Java extension handled jar decompilation when I tried it. Maybe it would provide some tips how to do it
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. 😃
Great if we could use their API 🙂
The expand selection (ctrl+w) binding is discussed in this issue: https://github.com/BetterThanTomorrow/calva/issues/725. You can weigh in there.
Also this is related to your navigation concern: https://github.com/BetterThanTomorrow/calva/issues/666
As you can see, default shortcuts are are pretty tricky to get right. Of course, not impossible to improve, though.
I think the appropriate place to add this would be in clojure-lsp. It's a todo item in their docs:
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.
Let the Clojure team know what editor and extension you are using, Calva-friends. 😃
Long live custom keybindings! But really, if you want to be friendlier to new adopters these defaults should change.
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).
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?
customized to Ctrl+L, but ctrl+alt+enter sounds better
idea is: change some fn, then reload, then check the output of the tidbit in the repl
https://calva.io/paredit/ are very cool!
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.
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.
Many thanks, @gldidonna! I tried it and it is really that easy. Good Ux work from @vlaaad!
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
Does any of those ^ help you, @jarvinenemil?
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.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 smallYour 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).
I liked the bigger font 😄
@gldidonna, PR please? https://calva.io/reveal/
Sure 😄
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.
> if you want to be friendlier to new adopters these defaults should change Oh I mostly agree with you there
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
How do you start things when you use connect, @jarvinenemil?
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.
I meant when you don’t use jack-in. 😃
ah.. read it wrong, sorry a bit tired. Give me a sec
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 😁.
Me too. 😃