This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-15
Channels
- # announcements (1)
- # asami (29)
- # babashka (31)
- # beginners (48)
- # calva (39)
- # cljsrn (4)
- # clojure (56)
- # clojure-dev (51)
- # clojure-doc (3)
- # clojure-europe (40)
- # clojure-gamedev (13)
- # clojure-italy (22)
- # clojure-nl (3)
- # clojure-uk (5)
- # cursive (9)
- # datomic (184)
- # events (7)
- # fulcro (8)
- # graalvm (2)
- # jobs (1)
- # malli (6)
- # meander (1)
- # nrepl (5)
- # off-topic (10)
- # pathom (9)
- # polylith (33)
- # portal (2)
- # re-frame (7)
- # reagent (12)
- # releases (3)
- # remote-jobs (3)
- # reveal (27)
- # shadow-cljs (34)
- # sql (1)
- # vim (7)
- # xtdb (62)
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 https://github.com/BetterThanTomorrow/calva/pull/1381 for some more details. • https://16010-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.226-pez-253-parinfer-4a1356b6.vsix for your convenience.
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: • https://16010-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.226-pez-253-parinfer-4a1356b6.vsix 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.
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.)
So. Ups and downs for this struggling tool smith. I might have fixed the CRLF bug. Can you test, @U013YN3T4DA? https://16036-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.226-pez-253-parinfer-610b4a2f.vsix
@U0ETXRFEW, after installing the vsx, what version should show for calva?
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….
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: https://16046-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.226-pez-253-parinfer-71362ef0.vsix 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.
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.
Once some tests have run, the UI looks like this:
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
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.
@U0ETXRFEW does Calva know about the distinction between “src” and “test” folders?
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…
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.
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.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.
Okay. I’ll remember this next time it happens. Thanks very much!
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"}}
:aliases
{:dev
{:extra-paths ["dev"]
:extra-deps
{djblue/portal {:mvn/version "0.16.3"}}}}}
It seems I have solved the blocking bugs. Here’s something closing in on a release candidate, I think: https://16046-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.226-pez-253-parinfer-71362ef0.vsix 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.