Fork me on GitHub
#calva
<
2020-06-29
>
dabrazhe19:06:44

Perhaps it's a more VSC question: how can I decrease indent of the paredit autoformat? The lines after tend to indent too far on the right in my rather small screen.

(let [current-time (->> (t/now) (f/unparse (f/formatters :rfc822)))
          msg (json/write-str
               {:message (str "The current time is, " current-time sp2
                              ;  "multiValueQueryStringParameters" lf (:multiValueQueryStringParameters eventparsed) lf
                              "queryStringParameters are " querypar sp2 sp2 lf
                              " )})] 
...

dabrazhe19:06:10

in this example I would like to have :message and multiValueQueryStringParameters be only 4 spaces off the previous line

pez19:06:32

The formatter is configurable using cljfmt configuration: https://calva.io/formatting/

Stas Morozevich20:06:23

Hi! Trying to get "go to definition" thing working. Have some interesting issues. Inside of app.core I can jump into my other user namespaces but not able to jump into some library namespaces (like reagent, bidi and so on). In app.hello or other namespaces I'm not even able to jump into any namespace. Getting this notification error: Unable to open 'routes.cljs': Invalid arguments. Environment information: Linux Ubuntu, shadow-cljs Minimal repo to reproduce this issue: https://github.com/tabomors/real-world-app-cljs Thank you for your help!

bringe17:06:03

Hello! I pulled down your repo and did these steps and I was able to use Go to Definition: 1. Ran npm install 2. Ran yarn start 3. Ran the Calva command "Connect to a Running REPL Server in the Project" 4. Selected shadow-cljs as the project type 5. Entered localhost:<port-of-shadow-cljs-nrepl-server> (the port was auto inserted for me but can be found in the output in the terminal from shadow-cljs 6. Selected the :app build to connect to 7. Opened app.core and put my cursor over r/render and hit F12 (Go to Definition), saw it jump to the render function in core.cljs of Reagent 8. Opened app.hello and put my cursor over routes/url-for and hit F12, saw it jump to url-for in app.routes

bringe17:06:50

Please try these steps above in that order if you did not before and see if it works. If it does not, then maybe there is something specific to your system going on.

Stas Morozevich19:06:18

Thanks for your time and for the answer! I have been doing this exactly like you described but unfortunately i have no luck

👍 3
pez21:06:45

It's a bug in Calva (might be upstream) that jump to definition doesn't work from within the ns form. If that's what you are trying to do. I tried the project, jacked in, choose to start app, connected to app. And once the web app was running I could jump around to library definitions (but not from the ns form, as per the bug).

Stas Morozevich07:07:52

Yeah, exacty. That's seems to be my case