Fork me on GitHub

Update on the Parinfer work. We still haven’t figured out why structural editing is broken for some Windows/CRLF users in the Parinfer builds. However some work has been done on making Calva help inform you of the current state of the document structure and indentation. When either of those are not as they should, bracket inference will not happen, in order not to change the code in funny ways. • See for some more details. • for your convenience.

👍 2

Since posting that, there’s a new build with some various fixes, chief among which is that we consider if the document is readonly before nagging about indentation or structure issues. Here: • I think I’ve seen it missbehave such that perfectly writeable documents are marked as readonly. Please let me know if you see this too.

👍 1

Oh by the way, I clicked the button to never show the warning anymore. Is there some way to reset that?


Yes, it’s a setting. See the PR description for what it is named. (Or just fuzzy-search calvafmt in the Settings view.)


It actually misbehaves a lot around the parinfer health status…


Oh right sorry for not reading that properly…


Haha, I really didn’t want you to take it like that! 😃


I know 🙂


So. Ups and downs for this struggling tool smith. I might have fixed the CRLF bug. Can you test, @U013YN3T4DA?


@U0ETXRFEW, after installing the vsx, what version should show for calva?


is that correct ?


if so, I'm still seeing behavior


parens changing to other chars at top of file, parens completely dissapearing at bottom of file


You should see something like this. It doesn’t show the full version there, but if you hover the Calva extension in the side panel you should see the full version, containing the commit ID 610b4a….


oh yeah, got it


the latest seems to be installed, but WSL hasn't picked it up


looking promising, not in WSL with the update vsix! 🙂


yeah, i'm not getting the weird behavior at all in the any of the files I was seeing it in before


It seems I have solved the blocking bugs. Here’s something closing in on a release candidate, I think: These two issues need to be addressed first, I think: • The structure/indent check is sometimes not run. so this information is not accurate enough. Don’t know how much troubles that will affect for real, since mostly things will stay correctly structured and indented… • We should relax the nagging about structure/indent problems in the output window.

Marc O'Morain11:11:46

I’ve been looking some more at enabling the Test Explorer for Calva, and I’ve run into an interesting situation. The screenshot here shows default view when you look at the Test Explorer if you write an “empty” integration with that view. In order to populate that list, the extension should add items to it. The typical way to do this is by scanning the workspace. This is how a go or python test explorer plugin would do it. In Clojure, the correct way to populate this would be to find all vars in the project that have test metadata. This implies that the extension should load all files in the project (src and test), which is not something I would expect Calva to do.

Marc O'Morain11:11:14

Once some tests have run, the UI looks like this:


Looks sweet!


Could we just show the vars that are loaded? And possibly have some convenience commands like: • Load test for this file • Load implementation files for this test file • Load all files in the project

Marc O'Morain12:11:56

I think I see a few options: • Do nothing, and the test explorer panel will be in that empty state (which bizarrely says “Configure Python Tests” until some tests are run though the Calva REPL) • When the UI is empty, create a single “Dummy” test in the UI. This would have a name like “Find Tests”, and running it would do the work to evaluate the tests namespaces and find test vars. Or maybe we call it “Run All Tests”. This is a bit gross, since it’s mis-using the API. • When the REPL connects, automatically evaluate all namespaces to find all tests. I don’t like this, since it’s a big behavioural change, and is surprising behaviour.

Marc O'Morain12:11:56

@U0ETXRFEW does Calva know about the distinction between “src” and “test” folders?

Marc O'Morain12:11:36

Something like the Python Test Explorer will find all files test files on the file system to show in the Test Explorer.


It could be something that clojure-lsp can help with. Calva does no analysis of the projects…

🙂 1
Luke Johnson21:11:59

Thanks for a wonderful tool in Calva. I regularly have troubles getting my output tab to render correctly. When I connect (to an existing repl in my project), the output file doesn’t update. It only shows

; This is the Calva evaluation results output window.
; TIPS: The keyboard shortcut `ctrl+alt+c o` shows and focuses this window
;   when connected to a REPL session.
; Please see  for more info.
; Happy coding! ♥️
The REPL is connected, but I can’t eval anything inline or send things to the REPL output. I usually delete the output file, delete my .cpcache, and restart my server, and VS Code. Some combination of those usually fixes it and evals are output correctly. Today, I’ve tried 3 times and it’s not working. I couldn’t find a troubleshooting page about it, and while I didn’t read through every issue on Github, I couldn’t find anything obviously connect to my problem. How can I get my output.calva-repl file to actually show output?


Hi there. I’m sorry it is acting up on you. I don’t know what’s going on. Deleting .cpcache and restarting stuff shouldn’t be necessary (and I don’t understand how it even fixes things). How do you start the REPL? Take us through the steps and maybe we can start to have some guesses.

Luke Johnson23:11:57

I start my server in a separate terminal process which exposes an nREPL port. I use Calva to “Connect to a running REPL in your project”, choose “deps.edn + shadow-cljs” and then connect to my alias. Normally, as I do this, I see output in the output window.

; Connecting ...
; Hooking up nREPL sessions...
; Connected session: clj
But sometimes, randomly but semi-regularly, that output won’t show. The REPL link at the bottom of VSCODE turns orange, as if I am connected, though.


Do you let shadow pick up dependencies from deps.edn?


How do you start your server?

Luke Johnson15:11:14

Sorry for not getting back sooner @U0ETXRFEW. Here’s the clojure command to start my server

clojure \
	-M:dev:test:nrepl:cljs-deps \  <= only adds dependencies, including cider-nrepl
	-e '(user/go)' \               <= starts integrant
	-m shadow.cljs.devtools.cli \  <= starts shadow server and nrepl server
	watch app test
shadow-cljs finds cider-nrepl on the classpath and starts the nREPL server with that middleware. But all our dependencies are stored in our deps.edn.


It is quite strange. That all looks fine, and the fact that it works sometimes after restarting things says it is fine, I guess. I’m don’t know how to troubleshoot… Can you see if there are messages going to and from the nREPL server when it stops working? There’s a command for starting the logging Calva Diagnostics something nREPL something.

Luke Johnson20:11:52

Okay. I’ll remember this next time it happens. Thanks very much!

Luke Johnson02:11:41

Today, I was working in a different project and had the same problem (repl connected but output not updating). This time, I started a REPL using Calva. This project doesn’t use shadow-cljs and is very minimal deps.edn

{:paths ["src" "resources"]
 :deps  {org.clojure/clojure {:mvn/version "1.10.3"}}

  {:extra-paths ["dev"]
   {djblue/portal {:mvn/version "0.16.3"}}}}}