Yesterday I got an update of VSC (on Windows 10) and clojure-lsp would not get past the initialization phase anymore. Following the recent instructions from @borkdude fix the issue!. Thx @borkdude š. (Perhaps you should add this to the Calva doc because now I only remembered because it was mentioned so recently)
rm -rf .lsp/sqlite.db
rm -rf .clj-kondo/.cache
mv .clj-kondo/config.edn .clj-kondo/config.backup.edn
PR welcome! š
@pez, I'm not sure how this works, can/should I raise the PR myself (happy to do it, just want to be sure that it is ok for me to do that)?
Not sure what you mean by raising the PR. But what we usually do is to first create an issue, then file a PR addressing that issue. In this case the issue is extra good because it will serve as documentation as well, for people checking issues when running into problems. See How to Hack on Calva on the wiki if you are unfamiliar with the ceremony involved. Though I seem to recall you have filed PRs before?
I think the descriptions around how to hack on the docs is a bit lacking. So if you set things up such that you can run the docs web server locally, please consider updating the wiki with what might be missing.
Made the issue here: https://github.com/BetterThanTomorrow/calva/issues/1056.
Hi. I'm a beginner and followed a https://www.notion.so/Beginner-Clojure-Environment-Setup-Windows-36f70c16b9a7420da3cd797a3eb712fa#6a53854de58d4f07ba6319d868fba29c to get my VSCode+Calva+Win10+WSL2(Ubuntu20.04) dev environment up and running. Everything seems to be running and I can evaluate my code via REPL, but I noticed that in my setup, I'm missing the "CLJ REPL" named editor (as visible https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F69456039-0a80-40fa-8f64-ad8f0371348f%2FUntitled.png?table=block&id=3d9da936-6132-488e-857d-0f603526f679&width=3670&userId=&cache=v2), instead I have the "output.calva-repl" open. Did I mess up the setup somehow or is the guide out-of-date?
Hello and welcome, @email113! That guide is a bit out of date. We have replaced that REPL window with the output repl you see now. Since you are a beginner I want to give you the tips of not using the output repl window so much as a repl. Most often it is more effective to type that kind of code into (comment ā¦)
forms in the clojure files and evaluate them from there (`alt+enter`).
Right, using the alt+enter was the way that I verified that at least something worked with the setup. š
Also, you donāt need to install the clj-kondo
extension. It is included in Calva (sort of).
ah, it did complain about the existence of kondo
I wasnāt aware of that setup guide, btw. Nice find!
I'll remove the extension to avoid surprises.
Are you a beginner to Clojure too, maybe?
I almost gave up on the setup when I started reading http://clojure.org. That page leaves the impression that Windows is not a viable dev platform at all. Unless one is willing to use alpha-grade sw.
I haven't touched programming in almost 20 years, not counting some small VB stuff with office suite.
It is a bit of a bother to set things up on Windows. I think most Clojure people use WSL there.
WSL should get a mention on http://clojure.org, I feel.
I need testers on a beginnerās feature I am working with. Up for it? š
Sure, I certainly fit the bill
For Clojure/Calva use with WSL, see this by Borkdude: https://blog.michielborkent.nl/2020/07/26/remote-wsl2-clojure/
Cool! Just a sec.
@email113 There is also #clj-on-windows
Thanks, I'll join the channel.
Windows is very much a second grade citizen when it comes to tooling in Clojure, but there are options.
E.g. I made https://github.com/borkdude/deps.clj which offers a binary which is a drop-in replacement for the clojure CLI which works in cmd.exe
I was going through the available channels on this Slack but I stopped after the first five pages and still being on the "C"s š
And there is #scoop with lots of nice Clojure utils for the (Windows) command line
And there is #babashka for Clojure scripting which also works on Windows
@email113 If you install this VSIX in vscode (Extensions pane -> meatballs menu -> Install from VSIX), there is a new command there: Fire up the Getting Started REPL. https://11740-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.177-1040-getting-started-repl-365e39c5.vsix
@borkdude I'll go through you repo with interest
You might need to rename the downloaded file from .zip
to .vsix
.
@pez Yeah, I can't point it directly to the url
Ah, now I understand. Would be cool to be able to install from a URL, but youāll need to first download.
Itās very much work in progress. You can read a tad more about it here: https://clojureverse.org/t/dram-is-an-interactive-beginners-clojure-guide-in-the-making/7268/
Ok, I have it installed
Awesome. Run that command and wait a few seconds and you should have a REPL started and three files to REPL your way through. The third one is pretty big, and will grow even more as I finish up some kind of v1
.
Very cool, I'll dig in and report back
Would you prefer comments/questions as PMs or just directly on this channel?
Or to the Forum thread?
Super duper. I totally appreciate it!
Forum thread, here, and as issues on this repo: https://github.com/BetterThanTomorrow/dram You can mix it up, whatever makes sense. š
Gotta admit Iād love me at least one comment on that forum post. Awfully silent there. š
Already found a typo and an area that should get a clarification .. just give me while
If you like you can fix the typoās by PR. But Iāll take the feedback in any form with great gratitude š
hi guys, for some reason the "ctrl+alt+c i" shortcut does not appear to have any affect. "alt + enter" works, setting breakpoints with #break or debugging with #dbg works - only this shortcut doesn't work.. I am working on kubuntu 20.04 - will appreciate any help:)
Same here after the last VSC update (on Windows). "ctrl+alt+c i" still works but it is not decorated anymore
Hey Eric, would you mind chiming in on this issue with more details, such as Windows version (like 10 home/pro, etc), and whether it happens with lein or deps projects. https://github.com/BetterThanTomorrow/calva/issues/1055 I'm not certain they're related but want to investigate more before making separate issues. I can't reproduce this issue on Windows 10 Pro or Manjaro Linux with VS Code 1.54.1. Both decorations and the debugger work as expected in both.
@brandon.ringe sorry for the delay, it's windows 10 enterprise using Lein. Happy to provide more details but please allow for some delay as Clojure is a hobby project for me so I'm not working on it every day. Version: 1.54.1 (user setup) Commit: f30a9b73e8ffc278e71575118b6bf568f04587c8 Date: 2021-03-04T22:38:31.419Z Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19041
No worries for any delays! Thanks for the info
Sounds like a bug. Please report! š
https://github.com/BetterThanTomorrow/calva/issues/1055 done:) thanks!
Dear Calva friends. Hereās a new VSIX for the Getting Started REPL feature for you to test. The update here is that if you have tried the feature before with earlier dev builds, youāll get prompted about wether to create a new temp dir or reuse the existing one + files. This since the guides might have been updated, but you might want to keep any experiments youāve conducted in the already downloaded files. https://11848-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.177-1040-getting-started-repl-87bf4858.vsix The prompt looks like so:
SockworkOrgange, haha. Guessing you might be my age? š
don't know, are you also 27 years old?:)
Haha. Double that!
@pez the name isn't a reference to Clockwork Orange, it's a reference to an homage to Clockwork Orange done in "Me, Earl and the Dying Girl"
Amazing. š
Is it possible to see the intermediate results of a evaluation with Calva. E.g. I would like to better understand what happens on each step of:
(as->Ā 15Ā $
Ā Ā Ā Ā `(rangeĀ 1Ā $Ā 3)`
Ā Ā Ā Ā `(interposeĀ ":"Ā $))`
Can I somehow inspect e.g. the output of range?
You may be able to use the debugger by placing #dbg before that top level form, if it is a top level form:Ā https://calva.io/debugger/
Thank you, I'll look into it.
You could also use a spy function as seen here: https://clojure.github.io/tools.logging/#clojure.tools.logging/spy. Just need to add clojure.tools.logging as a dep in your project
Many times for small experiments like this though, you can copy an expression out into a comment form, replace variables, and run it there. Or, if there aren't variables in it you can run it directly from where it exists by placing the cursor before or after it and running the command to evaluate the current form
Another method is to def
the variables in the expression, then run it in place as I mentioned above
So you could eval (def $ 100)
then place your cursor here:
(as->Ā 15Ā $
Ā Ā Ā Ā (rangeĀ 1Ā $Ā 3)|
Ā Ā Ā Ā (interposeĀ ":"Ā $))
And evaluate the current form (not top level) - ctrl+enter
This is part of the beauty of clojure repl dev
I think CIDER has an Evaluate up to (or some such) command. It evaluates the thread up to where the cursor is. Please file an issue with that feature request on Calva, @email113.