Fork me on GitHub
#calva
<
2021-03-06
>
Eric Uitbeijerse07:03:17

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

❤️ 9
pez08:03:43

PR welcome! 😍

Eric Uitbeijerse10:03:50

@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)?

pez11:03:20

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?

pez11:03:54

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.

Jan Ignatius12:03:46

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&amp;id=3d9da936-6132-488e-857d-0f603526f679&amp;width=3670&amp;userId=&amp;cache=v2), instead I have the "output.calva-repl" open. Did I mess up the setup somehow or is the guide out-of-date?

pez14:03:53

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`).

Jan Ignatius14:03:58

Right, using the alt+enter was the way that I verified that at least something worked with the setup. 🙂

pez14:03:03

Also, you don’t need to install the clj-kondo extension. It is included in Calva (sort of).

Jan Ignatius14:03:19

ah, it did complain about the existence of kondo

pez14:03:28

I wasn’t aware of that setup guide, btw. Nice find!

Jan Ignatius14:03:29

I'll remove the extension to avoid surprises.

pez14:03:07

Are you a beginner to Clojure too, maybe?

Jan Ignatius14:03:49

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.

Jan Ignatius14:03:34

I haven't touched programming in almost 20 years, not counting some small VB stuff with office suite.

pez14:03:59

It is a bit of a bother to set things up on Windows. I think most Clojure people use WSL there.

Jan Ignatius14:03:31

WSL should get a mention on http://clojure.org, I feel.

pez14:03:30

I need testers on a beginner’s feature I am working with. Up for it? 😃

Jan Ignatius14:03:49

Sure, I certainly fit the bill

agold14:03:17

For Clojure/Calva use with WSL, see this by Borkdude: https://blog.michielborkent.nl/2020/07/26/remote-wsl2-clojure/

pez14:03:24

Cool! Just a sec.

borkdude14:03:38

@email113 There is also #clj-on-windows

Jan Ignatius14:03:08

Thanks, I'll join the channel.

borkdude14:03:33

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

Jan Ignatius14:03:48

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 😉

borkdude14:03:58

And there is #scoop with lots of nice Clojure utils for the (Windows) command line

borkdude14:03:16

And there is #babashka for Clojure scripting which also works on Windows

pez14:03:00

@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

Jan Ignatius14:03:08

@borkdude I'll go through you repo with interest

pez14:03:42

You might need to rename the downloaded file from .zip to .vsix.

Jan Ignatius14:03:15

@pez Yeah, I can't point it directly to the url

3
pez14:03:17

Ah, now I understand. Would be cool to be able to install from a URL, but you’ll need to first download.

pez14:03:11

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/

Jan Ignatius14:03:12

Ok, I have it installed

pez14:03:07

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.

Jan Ignatius14:03:41

Very cool, I'll dig in and report back

Jan Ignatius14:03:13

Would you prefer comments/questions as PMs or just directly on this channel?

Jan Ignatius14:03:45

Or to the Forum thread?

pez14:03:57

Super duper. I totally appreciate it!

pez14:03:29

Forum thread, here, and as issues on this repo: https://github.com/BetterThanTomorrow/dram You can mix it up, whatever makes sense. 😃

pez14:03:12

Gotta admit I’d love me at least one comment on that forum post. Awfully silent there. 😃

Jan Ignatius15:03:03

Already found a typo and an area that should get a clarification .. just give me while

pez15:03:08

If you like you can fix the typo’s by PR. But I’ll take the feedback in any form with great gratitude 😃

Ilan Uzan15:03:13

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:)

Eric Uitbeijerse15:03:39

Same here after the last VSC update (on Windows). "ctrl+alt+c i" still works but it is not decorated anymore

bringe17:03:21

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.

Eric Uitbeijerse07:03:25

@U9A1RLFNV 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

bringe16:03:03

No worries for any delays! Thanks for the info

pez15:03:32

Sounds like a bug. Please report! 😃

👍 3
pez17:03:25

SockworkOrgange, haha. Guessing you might be my age? 😃

Ilan Uzan17:03:21

don't know, are you also 27 years old?:)

pez18:03:07

Haha. Double that!

Ilan Uzan18:03:57

@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"

pez19:03:40

Amazing. 😎

pez17:03:32

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:

Jan Ignatius20:03:04

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?

bringe20:03:33

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/

Jan Ignatius20:03:48

Thank you, I'll look into it.

bringe20:03:08

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

bringe20:03:14

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

bringe20:03:06

Another method is to def the variables in the expression, then run it in place as I mentioned above

bringe20:03:49

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

bringe20:03:19

This is part of the beauty of clojure repl dev

pez21:03:04

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.

Jan Ignatius06:03:37

Ok, I've added a feature request in Github