This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-16
Channels
- # announcements (62)
- # babashka (12)
- # babashka-sci-dev (73)
- # beginners (16)
- # biff (10)
- # calva (65)
- # cider (13)
- # clerk (8)
- # clojure (31)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-spec (24)
- # clojure-uk (5)
- # clojuredesign-podcast (18)
- # clojurescript (18)
- # dev-tooling (2)
- # emacs (30)
- # etaoin (4)
- # gratitude (3)
- # hyperfiddle (20)
- # integrant (2)
- # jobs (4)
- # kaocha (7)
- # malli (1)
- # observability (11)
- # off-topic (11)
- # pathom (12)
- # podcasts-discuss (7)
- # portal (12)
- # quil (3)
- # re-frame (6)
- # releases (1)
- # sql (22)
- # squint (5)
- # testing (79)
- # tools-deps (3)
- # xtdb (20)
Is there some way to Copy the *CONNECT* Command Line to Clipboard
?
Similar to Copy the *JACK-IN* Command Line to Clipboard
?
Hi! No, there isn’t. Calva just connects, there is no command involved. What is it you want to do where you saw this need?
Hi @U0ETXRFEW,
Calva: I am able to successfully activate a fullstack-workflow to a fullstack https://github.com/boscodsouza82/shadow-flow-storm-basic, when I use Calva-CONNECT
.
CIDER: I am not able to activate the cljs-workflow for the above mentioned fullstack project, when I use CIDER-CONNECT-CLJ&CLJS
.
Hence I was wondering about the difference between the 2 connect commands.
Please guide.
That’s probably not going to solve the issue though. In what way does the cider-connect not work? Do you get any error message somewhere?
> Have you tried launching the project using Calva’s jack-in command?
Yes, it works.
Via Jack-In, the project gets launched like this,
npx shadow-cljs -d cider/cider-nrepl:0.28.5 watch :dev-test
The clear difference between Jack-In and Connect 'launches' is the cider-nrepl injection.
But both Jack-In and Connect work fine, i.e. both clj and cljs interactive-programming workflows work fine.
In what way does the cider-connect not work?1. clj repl - works
2. clj buffers - work
3. cljs repl - works
4. cljs buffers - do not work
, also show 'cider - not connected' in the emacs-modeline of the cljs buffers.
For now, I have solved the emacs-cider problem by using this cider-nrepl injected version of the project launch. i.e. npx shadow-cljs -d cider/cider-nrepl:0.28.5 watch :dev-test
But my CIDER setup doesn't work with the plain project launch i.e. npx shadow-cljs watch :dev-test
. Calva magically does work. Hence I am left wondering. Not blocked, but wondering.
Could be an error in my setup. I did try the fresh install of emacs, cider etc. Still the same problem persists. Hence, I put the query here, hoping for the off chance that someone else too might be facing/investigating/solving it. Bright side, I am not completely blocked. 🙂
It’s interesting that Calva works without the dependencies injected, but that CIDER doesn’t. Could it be something with which that you need to tell CIDER to use the :dev-test
build?
I will try to articulate my problem statement better, as my understanding of Calva & Cider logging improves.
> Could it be something with which that you need to tell CIDER to use the :dev-test
build?
Doesn't seem like it. Both Calva and Cider ask me for the same inputs for cljs i.e. host, port, target-name.
Whether some error happens in Cider after this stage, that I can't answer objectively. I will first need to improve my understanding of Cider logging/error-logging.
Will post back once I have some more deterministic input. Could take some time though.
> Could it be something with which that you need to tell CIDER to use the :dev-test
build?
I am quite new to Cider, so I will look again in this direction that you have suggested.
The concept of builds is specific to some ClojureScript build tools, like Figwheel and shadow-cljs. So shadow-cljs in your case. The watch command you have there will start the :dev-test build and its repl. The last step in Calva’s connection process is to figure out which build to connect to and connect to it. I don’t quite recall if we skip to ask if there is only one build in shadow-cljs.edn.
It could be that the cljs-repl you have working in CIDER is not the repl for the build, but rather one of shadow-cljs built-in repls.
If so it is connected to some cljs app, but not the one you are building. If that makes sense.
> If so it is connected to some cljs app, but not the one you are building. If that makes sense. This could be the case, as I am not very clear about how these various repls work...but it will clear up soon.
okay, I will ask for a suitable cider+shadow fullstack hello-world. I couldn't find any in google.
See also this article https://blog.agical.se/en/posts/shadow-cljs-clojure-cljurescript-calva-nrepl-basics/
Thank you @U0ETXRFEW. I have been through the Agical article a few times. Afaik, these don't have guidance for Cider. Still, I will try the project you shared and report back if Cider behaves any differently. Meanwhile, I also found this today. Hope it helps clarity the right way for Cider+Shadow, https://www.youtube.com/watch?v=Ykztwp2DXjs
Though. If you can’t get the repls connected with the shadow-w-backend project, I think it’s time to ask for help in #C0617A8PQ. Sounds like something obvious is lacking.
Also @U0ETXRFEW, Calva (like you) has been a great help for me while getting into Clojure/Script professionally. The main reason I am also focusing on Cider is because Emacs affords a much more streamlined structural-editing workflow (I have found comfort in https://github.com/emacsmirror/symex). I haven't found a good equivalent in the VSCode world, and I am not all fluent in bending VSCode to my will. 🙂
> Sounds like something obvious is lacking. I just hope it's not an error on my side. Hence, doing the diligence.
Makes sense. But I think you have made your diligence. People in #C0617A8PQ will be happy to help you.
> People in #C0617A8PQ will be happy to help you. Okay, I will ask there as well. Just let me go through the video once.
@U0ETXRFEW, I will again say it now, even though I will repeat this again in the future. Just generally, Calva is a big help!
When I press Enter with the cursor being after (filter leap-year? )| the inserted line contains four spaces and two tabs as the image shows. I would like to have nothing or two/three tabs. NO spaces, I'm a tab indenter.
Clojure formatting generally does not use tabs, so I think the best option for you is to disable format-on-type for Clojure files. Paste this in the Settings search box to find the setting: <@U0343N85GCV>:editor.formatOnType @lang:clojure formatontype
One step closer to a world with no, or at least very few, right parentheses. Left parens and tabs will be enough.
I think you’re going to have a better time with Clojure if you follow the Clojure way with things. 😃
Hmm, a lot of experience in those words. Parinfer is not available, so what can I do (-:
Tried it. The trouble with parinfer is, it is going in both directions. My starting point is left brackets and tabs for indentation. Right brackets are allowed, but not necessary. This is my modest attempt so far. Standalone, Run on Save. https://github.com/ChristerNilsson/2023/blob/main/042-cli2clj/cli2clj.py
This will work even in notepad. Hopefully this can be integrated in a lisp IDE in the future. All that is needed is a small program like this, between reading the file and parsing it. The current balanced version we are using today also works of course. Maybe you know if there is a hook hidden somewhere in clojure, calva or code.
Run on Save will be ok, but it is a pity to lose the data.
When i do Alt+Enter there is some parsing done. I need to transform the lines with missing right parenteses, by adding the missing right parentheses. They will never be seen in the IDE, not even greyed out like in Parinfer.
I see. Calva has some code that does that too, but it’s not really accessible via some API.
This is like leaving json and going to yaml. Maybe the left parens could also be chucked out, but keeping them seems easier atm.
There is a VS Code command called runCommands
that you can bind to a keyboard shortcut. You would need to make your thing there run on a command. Not sure what VS Code has for that, but if there is such a command, you can string that command and Calva’s evaluate command together with runCommands
.
Thanks! Thanks again! I will check this out.
If VS Code doesn’t provide a command for executing your program on the file, you can always create an extension that provides the command. Or, thinking about it a bit more, #C03DPCLCV9N can probably be used for it. Then it would maybe make sense to write the whole add-missing-closing-brackets as a Joyride script. And use runCommands for stringing together the Joyride command and Calva’s evaluate command.
I guess only top level fragments will be sent to joyride?
YAMLScript seemed to be too extreme for my taste. I think going half way is a good compromise. 🙂