Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format on save doesn't work #1556

Closed
isacjunior opened this issue Feb 22, 2022 · 9 comments · Fixed by #1559
Closed

Format on save doesn't work #1556

isacjunior opened this issue Feb 22, 2022 · 9 comments · Fixed by #1559

Comments

@isacjunior
Copy link
Contributor

isacjunior commented Feb 22, 2022

Using the current version of Calva my format on saves stopped working. I install the latest version of clojure-lsp and calva.

versions:

calva v2.0.244
clojure-lsp 2022.02.01-20.02.32
clj-kondo 2022.02.09

settings:

"calva.fmt.configPath": "CLOJURE-LSP",
"calva.clojureLspPath": "/usr/local/bin/clojure-lsp",
"editor.formatOnSave": true,

error:

Fetching formatting settings from clojure-lsp failed. Check that you are running a version of clojure-lsp that provides "cljfmt-raw" in serverInfo.

Running the Clojure-lsp Server Info I see the cljfmt-raw field.

 "cljfmt-raw": "{:indents {assoc-in-some [[:block 1] [:block 1] [:block 1] [:block 1]], facts [[:block 1] [:block 1] [:block 1] [:block 1]], with-responses [[:block 0] [:block 0] [:block 0] [:block 0]], provided [[:inner 0] [:inner 0] [:inner 0] [:inner 0]], as-delegate [[:block 2] [:block 2] [:block 2] [:block 2]], lambda-expr [[:inner 0]], |fn [[:inner 0]], assoc-if [[:block 1] [:block 1] [:block 1] [:block 1]], defglobal-native [[:inner 0]], profile [[:block 2] [:block 2] [:block 2] [:block 2]], with-scopes [[:block 1] [:block 1] [:block 1] [:block 1]], consume! [[:block 0] [:block 0] [:block 0] [:block 0]], defint [[:block 0] [:block 0] [:block 0] [:block 0]], as-delegate-with-lift [[:block 2] [:block 2] [:block 2] [:block 2]], defglobal-library [[:inner 0]], |if-not [[:block 1]], |when [[:block 1]], let-entities [[:block 2] [:block 2] [:block 2] [:block 2]], |with-state [[:block 1]], constraint-fn [[:block 2] [:block 2] [:block 2] [:block 2]], as-customer [[:block 1] [:block 1] [:block 1] [:block 1]], for-all [[:block 1] [:block 1] [:block 1] [:block 1]], flow [[:block 1] [:block 1] [:block 1] [:block 1]], against-background [[:inner 0] [:inner 0] [:inner 0] [:inner 0]], quick-check [[:block 1] [:block 1] [:block 1] [:block 1]], against-backgroud [[:block 0]], logged-call [[:block 1] [:block 1] [:block 1] [:block 1]], run-recipe [[:inner 0] [:inner 0] [:inner 0] [:inner 0]], log-messages [[:block 0] [:block 0] [:block 0] [:block 0]], profiled [[:block 1] [:block 1] [:block 1] [:block 1]], |def-expr [[:inner 0]], as-admin [[:block 1] [:block 1] [:block 1] [:block 1]], try-type [[:block 0] [:block 0] [:block 0] [:block 0]], |if [[:block 1]], future-facts [[:block 1] [:block 1] [:block 1] [:block 1]], some-with-open [[:block 1] [:block 1] [:block 1] [:block 1]], not-join [[:block 1]], fact [[:block 1] [:block 1] [:block 1] [:block 1]], expand-routes [[:inner 1] [:inner 1] [:inner 1] [:inner 1]], flow-with-defaults [[:block 1] [:block 1] [:block 1]], if-expr [[:block 1]], |let [[:block 1]], idempotent-start [[:block 1] [:block 1] [:block 1] [:block 1]], idempotent-stop [[:block 1] [:block 1] [:block 1] [:block 1]], as-of [[:block 1] [:block 1] [:block 1] [:block 1]], with-fn-validation [[:block 0] [:block 0] [:block 0] [:block 0]], defuf [[:block 1] [:block 1] [:block 1] [:block 1]], rethrow [[:block 1] [:block 1] [:block 1] [:block 1]], flow-as-of [[:block 1] [:block 1] [:block 1] [:block 1]], assoc-some [[:block 1] [:block 1] [:block 1] [:block 1]], future-fact [[:block 1] [:block 1] [:block 1] [:block 1]], tabular [[:inner 0] [:inner 0] [:inner 0] [:inner 0]], as-customer-with-lift [[:block 1] [:block 1] [:block 1] [:block 1]], non-test-action [[:inner 0] [:inner 0] [:inner 0] [:inner 0]], data-fn [[:block 1] [:block 1] [:block 1] [:block 1]], let-expr [[:block 1]], assoc [[:block 1] [:block 1] [:block 1] [:block 1]], assoc-in-if [[:block 1] [:block 1] [:block 1] [:block 1]], flow-without-validation [[:block 1] [:block 1] [:block 1] [:block 1]], ignore-conflict [[:inner 0] [:inner 0] [:inner 0] [:inner 0]], with-cid [[:block 1] [:block 1] [:block 1] [:block 1]], let-flow [[:block 1] [:block 1] [:block 1] [:block 1]], embeds [[:block 0] [:block 0] [:block 0] [:block 0]], system-map [[:block 0] [:block 0] [:block 0] [:block 0]], defhandler [[:block 2] [:block 2] [:block 2] [:block 2]]}}",
@TiLogic
Copy link

TiLogic commented Feb 22, 2022

I have the same issue. Downgrading the extension to v2.0.243 fixed the issue for me.

Instructions can be found here.

@bpringe
Copy link
Member

bpringe commented Feb 23, 2022

CC @PEZ

@breno12321
Copy link
Contributor

Same problem here, the downgrade worked

@PEZ
Copy link
Collaborator

PEZ commented Feb 23, 2022

I found where I had introduced this regression, @TiLogic @breno12321. Thanks for reporting! This VSIX has the fixes: https://18227-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.245-1556-format-on-save-74268175.vsix

@PEZ
Copy link
Collaborator

PEZ commented Feb 23, 2022

@isacjunior I think you were hit with two errors. This ^ fixes the format-on-save one, but reading your cljfmt from clojure-lsp is not addressed. Can you file a separate issue for that? Please include your clojure-lsp config, if you can share it. Otherwise just the cljfmt options from it will probably do.

@PEZ PEZ changed the title Format on save doesn't work using clojure-lsp Format on save doesn't work Feb 23, 2022
@TiLogic
Copy link

TiLogic commented Feb 23, 2022

@PEZ Thank you for resolving this so quickly!

@PEZ
Copy link
Collaborator

PEZ commented Feb 24, 2022

Thanks @TiLogic!

However, I think this is is more broken than ever now.

@PEZ PEZ reopened this Feb 24, 2022
@PEZ
Copy link
Collaborator

PEZ commented Feb 24, 2022

@isacjunior
Copy link
Contributor Author

Now it worked. 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants