Fork me on GitHub
#calva
<
2022-10-07
>
Mario Trost04:10:22

I use the local history extension for VS code, which create a .history folder with old versions of files. How can I make sure those don't get picked up by Calva as valid source files? When I Go To Definition I sometimes jump to those files and start editing them... I added an entry to ~/.config/clojure-lsp which I think is working, because first, without ever having run a Repl in a project, .history files do not appear when I Peek References. But when a Repl is started I sometimes land in these .history files, which I shouldn't. And once that happened the relevant .history file gets picked up even without a running Repl.

pez16:10:15

Where is this .history folder created? By default Calva prioritizes dynamic (REPL) definition lookup. I don't see how that could start finding files in the .history folder unless those has once been loaded/evaluated. That the static lookup finds them once they have been opened sounds like clojure-lsp will start indexing it when it is opened. You could run with static lookup being prioritized to see if that helps. There's a setting for it, I don't recall the name right now, but the settings search is pretty powerful.

Mario Trost17:10:37

.history is created inside the root directory, but I have a setup where root dir of the project is in the subfolder and it is a lein project. Will try giving Clojure LSP precedence, I remember you mentioning it here short time ago, will update it here when I find out more. Thanks for the reply! 🙂

Kari Marttila17:10:16

I decided to evaluate Calva. One Calva newbie question. https://calva.io/connect/ > Consider using Jack in to inform yourself on how to start your REPL to Calva's satisfaction. With Emacs/Cider and IntelliJ/Cursive I have always started the REPL in the command line and then connected the editor to this REPL. Is there something I lose as a developer experience with VSCode/Calva if I use the same practice with Calva, i.e. connecting without Jack-in?

Kari Marttila18:10:05

Yes, I understand that you can connect to a running REPL using Calva. But I'm interested if Calva benefits somehow that the REPL is started using Jack in?

pez18:10:51

No, you don’t lose anything. The reason for the recommendation is more involved to describe the steps, and that beginners often start the REPL w/o the necessary dependencies. As long as you get the dependencies right, it is equivalent/the same.

Kari Marttila18:10:01

Ah, ok. Good to know. Thanks @U0ETXRFEW!

🙏 1
pez19:10:42

We should clarify this on that docs page.

hoppy18:10:39

there is also a connect

Kari Marttila18:10:24

In Calva, is there a REPL editor and REPL output window like in Cursive? I mean, when I evaluate a form in the IntelliJ editor, Cursive echoes the evaluation to a REPL output window. In VSCode with Calva, I can see the evaluation in the code editor, but it would be nice to have the evaluation history in the REPL output window as in Cursive.

pez19:10:00

Yes, this window should open as part of the REPL connect procedure. It is a regular file, with some special treatment, created in .calva/output-window/. I wonder why it is not opening for you, but there is a command for opening it: Calva: Show Output/REPL Window.

pez19:10:22

There is a setting for automatically showing the output window on jack-in and connect. Check if you have somehow disabled that. It is enabled by default.

Kari Marttila19:10:44

The command Calva Paredit: Kill/Delete Sexp Forward does delete the sexp forward from the cursor, but it does not add the sexp to the clipboard (like Emacs "kill") to be pasted in some other place in the editor (like Emacs "yank"). Or am I missing something here?

pez19:10:58

That's correct. There is a setting Calva Paredit Kill Also Cuts to Clipboard that you can enable to get that behaviour for all Paredit kill commands. There is not kill ring though, so it isn't as powerful as with Emacs.