Fork me on GitHub
#calva
<
2021-07-01
>
stijn07:07:04

Hi, I'm new to Calva and wondering how you all use the Java integration. I have installed the Redhat Java Support plugin. Code completion works, but e.g. Go to definition does not. Is there something specific to setup in Calva or should I look at the Java plugin for documentation? One thing that is not clear to me is how does e.g. the Java plugin find dependencies etc, since it is obviously not a maven based project.

pez15:07:35

Sorry for the radio silence, @U0539NJF7. Go to definition should work at least for java “core” stuff, as long as you have the java sources installed. It depends a bit on which Java version you are using. I don’t know how the Java Support plugin interacts with things, but I doubt it is in play for Clojure files.

stijn13:07:46

Thanks, I will take a deeper look to see if sources are installed etc. Does it work for sources of downloaded dependencies as well?

Juλian (he/him)08:07:51

is there a way to make the calva-repl output automatically hide itself when not needed?

pez09:07:16

So, what would “not needed” be?

Juλian (he/him)09:07:06

after eval it should be shown, but when I continue to work on the source, it could be hidden again... for example, I press alt+enter to see the results, but then move the cursor or type something to continue coding, I wouldnt need it displayed any more. maybe I should look up vscode docs

pez09:07:49

Maybe consider having it always closed. And hover the eval results instead, when you are curious about more about it?

Juλian (he/him)09:07:02

that sounds reasonable, thanks

pez09:07:40

There is a keyboard shortcut for showing the hover.

Tomas Brejla10:07:58

hmm, good question, I'd like to have that feature as well I'm used to show-hide sidebar (ctrl+b), show-hide terminal (ctrl+`), it would be lovely to have similar "dockable panel with calva-repl editor window", assignable to show/hide shortcut) Since calva-repl is just an "ordinary editor", it's probably a question on vs-code itself, whether is offers such functionality.

Tomas Brejla10:07:46

perhaps it offers something as "editor bookmarks", "favorites" or some similar functionality that could help ? :thinking_face:

pez10:07:26

The specific ask here was for something automatic. I imagine it would be something like that the output window shows for a brief time after an evaluation, then it should hide.

Tomas Brejla10:07:47

Oh, you're right, there was this ask of automatic hiding. Personally I'd be perfectly fine with custom toggle keyboard shortcut, that would always bring up or hide the same file (output.calva-repl) at the same position in vscode, ie. same behavior as sidebar or terminal

pez10:07:09

The non-automatic way is to have the output window closed. Then after an evaluation use the command for showing the output window (default bound to ctrl+alt+c o. Then close it, at will. Or, using the hover instead, efter an evaluation use the command for showing the hover, cmd+k cmd+i on Mac, then esc to close the hover.

pez10:07:20

The VS Code API is super limited, and a bit broken, around controlling where file editors should open. But at least Calva makes an attempt to open the window in the same place as it was last closed from.

Tomas Brejla11:07:16

I never used ctrl+alt+c o . It does a good job opening the closed repl editor + it swiches focus. But once I press ctrl+alt+c o,again in that repl editor, it opens some "random" editor to the same editor group. Is there any "contract" or expectation of what should happen in this case? I wonder whether it would make sense to change the command in that way, that second press ctrl+alt+c o (ie executed from active repl window) would simply close that repl window? Perhaps it would deserve its own command ("Calva: TOGGLE visibility of the Current open repl.....").

pez15:07:59

So the command is Show Output/REPL Window when a source file is active, and Show File for the Current Output/REPL Window Namespace when the ouput window is active. Both are default bound to the same keyboard shortcut. Ideally, in the case where the REPL window is active it would activate the tab where that file is already opened, if it is opened, but: > The VS Code API is super limited, and a bit broken, around controlling where file editors should open.

Tomas Brejla15:07:53

understood, that's a pitty

pez15:07:00

Or, one of them at least.

pez15:07:13

If you have the REPL window in the same group as the source files (so not side-by-side) it behaves more like a toggle.