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

Formatter config from lsp #1548

Merged
merged 11 commits into from
Feb 20, 2022
Merged

Formatter config from lsp #1548

merged 11 commits into from
Feb 20, 2022

Conversation

PEZ
Copy link
Collaborator

@PEZ PEZ commented Feb 19, 2022

What has Changed?

  • Added a special treatment of calva.fmt.configPath === 'CLOJURE-LSP' where Calva will pick the cljfmt config from clojure-lsp.
  • Fixed bug with not honoring :align-associative? true in config
  • Changed default keybindings for Tab Dedent and Infer parens

Doing this I also cleaned up some of the code around how cljfmt config is provided to Calva's formatter. Hopefully this is a tad less confusing now.

Resolves #1545
Resolves #1535

NB: Latest clojure-lsp does not have the necessary support for Calva to pick up config there. To test it you'll need to use a clojure-lsp build from master.

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and either tested it there if so, or mentioned it in the PR.
  • Added to or updated docs in this branch, if appropriate
  • Tests
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
    • Tested the VSIX built from the PR (so, after you've submitted the PR). You'll find the artifacts by clicking Show all checks in the CI section of the PR page, and then Details on the ci/circleci: build test.
  • Referenced the issue I am fixing/addressing in the description of this PR
  • Created the issue I am fixing/addressing, if it was not present.
  • Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • Confirmed that there are no linter warnings or errors (use the eslint extension or run npm run eslint).

Ping @PEZ, @bpringe

PEZ added 11 commits February 20, 2022 08:37
Accepts special cljfmt path setting CLOJURE-LSP which will
enable this behaviour.

Change to always feed the formatter with JS options object
This will probably need to be reverted, because it breaks metadata
We will probably also need to ask for clojure-lsp feeding us the
cljfmt config as a string containing the EDN.
@PEZ PEZ force-pushed the formatter-config-from-lsp branch from fc8d0cd to 30acd3a Compare February 20, 2022 07:41
@PEZ PEZ merged commit 36d3f04 into dev Feb 20, 2022
@PEZ PEZ deleted the formatter-config-from-lsp branch February 20, 2022 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to read cljfmt config from clojure-lsp Map key/value pair aligning is not working on format
1 participant