This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-15
Channels
- # announcements (1)
- # babashka (81)
- # beginners (48)
- # calva (49)
- # clj-kondo (52)
- # cljdoc (7)
- # cljs-dev (39)
- # clojure (33)
- # clojure-australia (18)
- # clojure-europe (48)
- # clojure-italy (2)
- # clojure-morsels (2)
- # clojure-nl (3)
- # clojure-uk (6)
- # clojurescript (5)
- # community-development (2)
- # conjure (6)
- # cursive (3)
- # data-science (29)
- # datalog (4)
- # datomic (14)
- # events (1)
- # fulcro (1)
- # graphql (18)
- # gratitude (2)
- # helix (11)
- # introduce-yourself (2)
- # java (15)
- # keyboards (2)
- # lsp (6)
- # luminus (4)
- # membrane (32)
- # minecraft (1)
- # missionary (7)
- # nextjournal (2)
- # off-topic (28)
- # portal (28)
- # releases (1)
- # ring (1)
- # shadow-cljs (3)
- # sql (6)
- # xtdb (23)
Hello everyone! does anybody knows a shortcut of Calva or VSCode to jump with the cursor to the beginning of the current line? i know about cursorLineStart but it doesn't do what i want when the code is formatted and i'm on a line that is tabbed. For example, if i'm in the middle of the third line i want to jump to the begenning of default-style symbol (not the real beginning of the row, only where text starts):
(defn headers []
(let [default-header-text-class "text-xs leading-4 font-medium tracking-wider text-left text-gray-500 uppercase "
default-style {:padding-top "12px"
:padding-left "10px"
:padding-bottom "12px"}]))
and in second place, about shortcuts too.... is there any for trimming white spaces between words? i know the tab key solves it most of the time but occurs that when i want to disindent a line below the current one i press the del key and the line goes back up but it stays like this:
(defn headers []
(let [default-header-text-class "text-xs leading-4 font-medium tracking-wider text-left text-gray-500 uppercase "
default-style {:padding-top "12px" :padding-left "10px"
:padding-bottom "12px"}]
so i would like to trim whitespaces between "12px" and :padding-left (i don't know why tab key doesn't work here)
Any help is welcome... and thanks in advance! :)Calva uses a fork of https://github.com/weavejester/cljfmt, so you may find some help there. I’m not sure if that is possible with some cljfmt setting or not. @U0ETXRFEW probably knows more about this.
cljfmt doesn’t trim whitespace between things on the same line. For that particular case you can try the command Format and Align Current Form, but it also does other things so might not always be what you want.
For moving the cursor to where text starts on the line there is a VS Code command cursorHome
on mac it is default bound to cmd+left
.
cursorHome
worked perfect for me to jump to the beginning of the first word thanks! :), but Format and Align Current Form didn't, instead of trimming white spaces it returned :padding-left to the line below again
Ah, I didn’t figure that was not what you wanted. Anyway, that’s for the better. We might be removing that command soon. Maybe you can use Join next line (or whatever the command is named when you want to move :padding-left "10px"
up. With the cursor somewhere on the default-style
line. That would leave only one space, I think. (I might still be misunderstanding what you want to do of course. 😄)
yes it worked 🙂 thank you very much.... the command is editor.action.joinLines
it starts in the app.core namespace instead of user, and i can't seem to switch namespaces either
trying to run (println "hello")
throws a syntax error at me saying it's Unable to resolve symbol: hello in this context
i've opened the project's folder in vscode, the remote container thing started lein repl headless for me, and i connected
Load the file means to trigger the nrepl op load-file
which in turn triggers a Clojure (load-file)
(and some more, that I’m not completely sure what it is). It is needed to initialize the REPL to know about even core stuff. It’s mentioned here: https://calva.io/try-first/ and probably should be mentioned elsewhere as well.
> the remote container thing started lein repl headless for me, and i connected The REPL needs to be started with some dependencies met for Calva to work. There’s a command for copying out the command line that Calva would use to start the REPL, mentioned here https://calva.io/connect/
the syntax error above was different though, it's because for some reason when my repl prompt prints, there's a newline afterwards. unless i move to the line of the prompt, the syntax error above happens
no actually never mind the above, the syntax error thing with (println "hello")
still happens, even if i "jack in" and calva installs the cider middleware and all that
aaaah never mind, figured it out. i was using ctrl+enter to execute while having the cursor inside the string
That makes sense. I think that in the REPL window we lose the decorations showing what has been evaluated.
I usually recommend people to not use the REPL window much at all for evaluating stuff. Calva embraces Rich Comments rather: https://calva.io/rich-comments/
You have a project with a repl running for it inside of a docker container, and you’re trying to connect Calva to the repl in the container, from outside the container?
I haven’t used a setup like that, but let’s see if someone else here has that can help out.
If you get no movement on this soon, feel free to create an issue with an example project and reproducible steps, including the docker details, and maybe we can help you figure it out.
Hello. I’ve a question around shadow cljs. When I jack in I have the option to pick a build, so I end up picking frontend based on this config
{:source-paths
["src"]
:dependencies
[]
:builds
{:frontend {:target :browser
:asset-path "/js"
:output-path "/public/js"
:modules {:main {:entries [main.core]}}}}}
However, despite doing so, I am unable to connect to a runtime. I have connected to the server by opening localhost:9630 on a browser
I’m a little unclear as to what needs to be done.
1. Jack in
2. Select a build
3. Hit localhost:9630
4. ....
that’s open too
I think I’ll try the dev-http
option instead of doing it manually
Shadow lets you specify an additional option that launches a file server
reloading worked. Not sure what the problem was
dev-http
works too. Quite convenient as well
If I select a browser-repl
build though, it does connect to the runtime