This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (3)
- # aws (5)
- # beginners (71)
- # boot (7)
- # calva (74)
- # cider (6)
- # clj-kondo (2)
- # cljs-dev (5)
- # clojars (6)
- # clojure (84)
- # clojure-dev (7)
- # clojure-europe (1)
- # clojure-italy (23)
- # clojure-nl (43)
- # clojure-sanfrancisco (1)
- # clojure-spec (4)
- # clojure-uk (173)
- # clojurebridge (1)
- # clojurescript (14)
- # cursive (44)
- # datomic (9)
- # duct (2)
- # emacs (2)
- # fulcro (4)
- # graalvm (4)
- # graphql (27)
- # hoplon (6)
- # keechma (50)
- # off-topic (3)
- # other-languages (8)
- # pathom (2)
- # pedestal (14)
- # planck (5)
- # re-frame (3)
- # reitit (6)
- # ring (2)
- # robots (2)
- # spacemacs (9)
- # tools-deps (15)
- # vim (44)
I think I am on to what causes ^ #193 ^. But things are a bit too involved for my small brain and I lose the track all the time. If someone has some time to do some pair programming with me, I think we will have this solved much faster. Anyone?
The source of the bug was quite fundamental. (A bit like cutting of the branch you are sitting on.) I just tried my work project with the new build and it had fixed the problems I had there.
You can help test these fixes if you install the alpha build: https://github.com/BetterThanTomorrow/calva/blob/dev/alpha-build/clojure4vscode-2.0.0-SNAPSHOT.vsix
This build also contains something that might make @hoppy happy. 😃 And also some Calva beginner’s help in the REPL window, to ease the starting curve. If you have suggestions for that please let me know, here or by PR.
I choose to use a setting for opting out of the lein-figwheel browser auto-open. Considered a prompt, but it would make the prompt path fo jack-in/connect a bit long and I figured you always want one or the other behaviour for a particular project anyway.
The main blocking issues now are windows related and found by @slack1038: https://github.com/BetterThanTomorrow/calva/issues/195 https://github.com/BetterThanTomorrow/calva/issues/192
Jack in works — but can’t evaluate a top level form - evaluating from the REPL gives me the dreaded “Cannot resolve symbol + in this context”
I still see the “select cljs repl type” when I try to connect to an existing nrepl session
Hooking up nREPL sessions... Connected session: clj Creating cljs repl session... Connecting to: shadow-cljs... Failed connecting. (Calva needs a REPL started before it can connect.)
I do not really dare to try figure these things out for each project. I think I would miss too often, so am using the prompts. The prompts remember your choices though. So from the first time on it is mostly a series of hitting
enter on the prompts.
I have to first evaluate the file to even get a simple
(+ 1 2) to work, I guess somehow the first namespace isn’t selected?
But today is a holiday so I’m helping my wife do some other things! I will check back tomorrow 🙂
Great job figuring all this out — tackling CLJS repls is a huge undertaking. I hope I can help more somehow in the future 😊
Awesome. Holiday here as well. My wife is not too happy I am using it for Calva, but I’l try to make up for it. 😃
Maybe I should make auto-loading the files the default behaiour, and people can opt out. It is a bit confusing with nothing working before that load…
I’m confused though on why does there have to be auto-loading of something, when even trying to evaluate a simple form. I’d expect that the first evaluation happens in the user namespace.
@pez, I report that it seems solid enough, and the not starting browser repl option works like a champ. Still a little obscure to understand when your cljs is done builiding, but that's managable
@hoppy see if there is output in the Calva Connection Log that tells better about what is going on and if, indeed we spawn of the browser window too early.
Regarding those Jack-in issues on Windows, I am a bit in the dark because I am not using Windows myself. Not sure how I should tackle it.
@pez We are basically launching the browser window as soon as the CLJ build is done, and the CLJS build is just starting. It's probably 90 seconds ahead of time in my situation
There are some macros on which calva fmt will indent with a single space but should be 2 spaces according to clojure style guide. Am I right? Is there a way to tweak this?
There’s no way to tweak that atm. But it shouldn’t be too hard to add support for
Any pointers to where I could modify the formatter code to support this? It’s currently my biggest drawback when collaborating on a project at our organization. Lots of unnecessary indent changes when I edit through files makes it hard to assert the scope of my changesets.
So, there are actually two formatters in Calva, the new one and the old one. The reason for that is that the new one misbehaves more often than the old one, while the new one is still in service in the REPL window. The old formatter is using
clj-fmt and can be fed those config maps. The new formatter is accepting the same config format. I have been planning to find some time to fix the new formatter before I add this config feature, but if you are in more of hurry than is allowed by “when PEZ has the time”, please don’t wait for me. I’ll be right back with some code places to have a look at…
The new formatter lives in the
repl-indicator project, in this file: https://github.com/BetterThanTomorrow/repl-interactor/blob/master/src/client/indent.ts
The work here would involve to read a
clj-fmt indent config map and merge that onto the default
The old formatter is written in ClojureScript and lives in
calva/cljs-lib/src/calva/fmt/formatter.cljs. It can be fed the indent config map quite directlly. I’m not sure if it should get it from
calva/calva-fmt/ts/format.ts or slurp up a file given a path…
To consume the indent config map for feeding to the new formatter (and possibly to the old, if that path is chosen) you have
calva/cljs-lib/src/calva/js_utils.cljs at your service. See
calva/nrepl/jack-in.ts:162 for an example of parsing EDN.
I’ll be offline for a while now, but would be happy to have a voice chat when we are both online.
Windows users. Help a poor Mac dude. I have installed Windows 10 in a VM and installed vscode, java and the powershell clj that I found when googling how to run clojure on Windows. However, Calva can’t find the executable. (Trying with a cli/deps project). How do I start such a project on windows?
i would guess that you cant even use cli/deps in powershell directly if that is the case then you have to add the folder where the executable is to the path enviroment 🙂
Jack-in works now like a charm 🙂 even with my wierd project setup 🙂 but when i close the cljs-repl window i can still see it in the task manager same goes when i close the window with the running java process (known issue) connecting with a running nrepl works also really nice and i have no problems switching between multiple nrepls 🙂