Fork me on GitHub
#calva
<
2020-03-25
>
hindol.adhya06:03:21

@pez What do you think about having toggles in the settings pane as before, and create a cljfmt.edn on the fly hidden from the end user?

pez06:03:27

I considered keeping the toggles, but thought it would blur things when you wanted to have custom indents. But maybe there is a clean way to do it.

hindol.adhya06:03:02

You are right, forgot about the custom indents.

slawek09807:03:05

@pez where to report feat-lsp bugs?

slawek09807:03:14

@pez there are some issues with autocompletion:

pez07:03:52

Yeah, currently this build just throws in the lsp there and ocnce the repl is connected there will be a doubling of a lot of providers. You can report all the quirks on the PR: https://github.com/BetterThanTomorrow/calva/pull/572

ullrich.schaefer14:03:10

Quick question about Calva + cljfmt. When I pass this code through lein cljfmt check it is valid, but if I format it in Calva it aligns all the values as columns. Is this something that’s caused by Calva? And most importantly, can I disable it? πŸ˜„

(def example
  {:one-long-key :a-value
   :one-short :b-value})
Result after formatting in Calva
(def example
  {:one-long-key :a-value
   :one-short    :b-value})

ullrich.schaefer14:03:50

My Calva config:

"calva.paredit.defaultKeyMap": "strict",
    "calva.syncReplNamespaceToCurrentFile": true,
    "calva.fmt.configPath": "./cljfmt.edn",
    "calva.fmt.newIndentEngine": true,
    "calva.fmt.formatAsYouType": true,
    "calva.showDocstringInParameterHelp": true,
    
I emptied my cljfmt.edn to test wether it’s related.

pez14:03:57

Ah, you are already using a custom config.

ullrich.schaefer14:03:47

Yes, we have a CI script that checks formatting using cljfmt and I want Calva to use the same rules :)

pez15:03:33

Oh, yeah, that looks like the bug πŸ˜ƒ

pez15:03:05

I'll have a look tonight.

hindol.adhya12:03:29

@ I reported that one. It's not related to your problem. Mine was about how cljfmt treats a destructuring as a map.

hindol.adhya12:03:39

Your issue is, Calva/cljfmt is arranging your map in columns even when you have :align-associative turned off.

hindol.adhya12:03:48

What happens when you put this in your cljfmt.edn?

{:align-associative? false}

ullrich.schaefer12:03:09

@ Thanks! That seems to actually work ❀️

hindol.adhya12:03:07

Cool! Then my best guess is cljfmt moved from off-unless-stated to on-unless-stated on this option.

pez12:03:04

Calva's cljfmt hasn't moved at all. It is a quite old fork (which adds the algnments that @ so hates πŸ˜ƒ )

ullrich.schaefer12:03:14

Which cljfmt version is used inside Calva?

hindol.adhya12:03:52

I kinda wish someone would just impose https://tonsky.me/blog/clojurefmt/ on everyone and be done with it. No configuration allowed! Like Golang.

pez13:03:22

[pez/cljfmt "0.0.4-SNAPSHOT"]. Don't recall exactly where I forked off. But basically the only change from then master is that I merged in this PR: https://github.com/weavejester/cljfmt/pull/77

pez14:03:42

Looks like a bug. Maybe you can work around it by using an exlpicit config: https://calva.readthedocs.io/en/dev/formatting.html

pez14:03:51

And please report the bug! πŸ˜ƒ