Fork me on GitHub
#calva
<
2020-02-10
>
conan15:02:02

We're interested in forcing 2-space indent in Calva but can't work out how. Essentially we currently get this from the formatter:

(rf/reg-sub :user/me
            (fn [db] (:user/me db)))
but what we want is this:
(rf/reg-sub :user/me
  (fn [db] (:user/me db)))
I saw this comment suggesting it might be in the works: https://github.com/weavejester/cljfmt/issues/154#issuecomment-474238963 Is support for a Tonsky-style formatting in the works? I realise this is a dev channel so if I'm in the wrong place then I humbly apologise.

pez15:02:47

@conan, this is the right place to ask, and this is in the works. You can help, by engaging in testing of this PR: https://github.com/BetterThanTomorrow/calva/pull/546

conan15:02:56

oh amazing yes! thanks!

pez15:02:57

I just noticed that the build fails so there is no VSIX to download, but please see https://github.com/BetterThanTomorrow/calva/wiki/How-to-Hack-on-Calva to learn how to run the extension in debug mode.

conan15:02:11

will do, yeah i just got to the bottom and noticed that

otwieracz20:02:54

Any ideas why Calva is not able to follow aliases?

pez20:02:05

Have you evaluated the ns form?

otwieracz20:02:27

Its cljs file.

otwieracz20:02:41

So yes, I saved it and reloaded (I believe...).

pez20:02:28

That depends on wether you have enabled evaluate on save. But try to either evaluate the ns form, or load the file. I think it should make Calva follow the aliases...

otwieracz20:02:43

Seems like it's working now. I must have been doing something wrong!

otwieracz20:02:55

Now I am getting errors:

file not on classpath
{:file-path "/home/slawek/Projects/cljs/wires/src/main/wires/ui/wires.cljs"}
ExceptionInfo: file not on classpath
	shadow.cljs.repl/repl-load-file* (repl.clj:254)
	shadow.cljs.repl/repl-load-file* (repl.clj:227)
	shadow.cljs.devtools.server.worker.impl/do-repl-rpc (impl.clj:791)
	shadow.cljs.devtools.server.worker.impl/do-repl-rpc (impl.clj:751)
	shadow.cljs.devtools.server.worker.impl/eval16115/fn--16116 (impl.clj:831)
	clojure.lang.MultiFn.invoke (MultiFn.java:234)
	shadow.cljs.devtools.server.util/server-thread/fn--15683/fn--15684/fn--15692 (util.clj:285)
	shadow.cljs.devtools.server.util/server-thread/fn--15683/fn--15684 (util.clj:284)
	shadow.cljs.devtools.server.util/server-thread/fn--15683 (util.clj:257)
	java.lang.Thread.run (Thread.java:834)

No results from file evaluation.
when trying to evaluate cljs file with ctrl+alt+c enter

pez20:02:06

Does it work if you Select all, and then evaluate the current form?