mirror of
https://github.com/vale981/apheleia
synced 2025-03-05 09:31:40 -05:00
Determine indent level from more modes (#258)
Pass CSS, GraphQL, HTML, Ruby, Svelte, and YAML mode indent setting to formatters that make use of it through `apheleia-formatters-js-indent`. `prettier-markdown` and `prettier-scss` attempt to make use of this too, but `markdown-mode` and `scss-mode` don't have such a setting that I can tell. Left the uses in place for `indent-tabs-mode` support anyway. BTW the `apheleia-formatters-js-indent` name and its description does not seem quite spot on, as it was already being (partially unsuccessfully) (ab?)used by some modes for which "JavaScript like"ness is a bit of a stretch :) Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
This commit is contained in:
parent
4a87523f80
commit
022cf17464
2 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,8 @@ The format is based on [Keep a Changelog].
|
||||||
* Use `perltidy` as default formatter for `cperl-mode` ([#260]).
|
* Use `perltidy` as default formatter for `cperl-mode` ([#260]).
|
||||||
* The `perltidy` formatter now supports Emacs indentation and line length
|
* The `perltidy` formatter now supports Emacs indentation and line length
|
||||||
settings ([#261]).
|
settings ([#261]).
|
||||||
|
* Indent level is now determined for `graphql-mode`, `html-mode`, `ruby-mode`,
|
||||||
|
`ruby-ts-mode`, `svelte-mode`, and `yaml-mode` ([#258]).
|
||||||
|
|
||||||
### Formatters
|
### Formatters
|
||||||
* [`dprint`](https://dprint.dev) for various (depending on
|
* [`dprint`](https://dprint.dev) for various (depending on
|
||||||
|
@ -31,6 +33,7 @@ The format is based on [Keep a Changelog].
|
||||||
[#209]: https://github.com/radian-software/apheleia/pull/209
|
[#209]: https://github.com/radian-software/apheleia/pull/209
|
||||||
[#229]: https://github.com/radian-software/apheleia/pull/229
|
[#229]: https://github.com/radian-software/apheleia/pull/229
|
||||||
[#257]: https://github.com/radian-software/apheleia/pull/257
|
[#257]: https://github.com/radian-software/apheleia/pull/257
|
||||||
|
[#258]: https://github.com/radian-software/apheleia/pull/258
|
||||||
[#260]: https://github.com/radian-software/apheleia/pull/260
|
[#260]: https://github.com/radian-software/apheleia/pull/260
|
||||||
[#261]: https://github.com/radian-software/apheleia/pull/261
|
[#261]: https://github.com/radian-software/apheleia/pull/261
|
||||||
[#263]: https://github.com/radian-software/apheleia/pull/263
|
[#263]: https://github.com/radian-software/apheleia/pull/263
|
||||||
|
|
|
@ -38,6 +38,8 @@ always returns nil to defer to the formatter."
|
||||||
(cperl-mode 'cperl-indent-level)
|
(cperl-mode 'cperl-indent-level)
|
||||||
(css-mode 'css-indent-offset)
|
(css-mode 'css-indent-offset)
|
||||||
(css-ts-mode 'css-indent-offset)
|
(css-ts-mode 'css-indent-offset)
|
||||||
|
(graphql-mode 'graphql-indent-level)
|
||||||
|
(html-mode 'sgml-basic-offset)
|
||||||
(js-jsx-mode 'js-indent-level)
|
(js-jsx-mode 'js-indent-level)
|
||||||
(js-ts-mode 'js-indent-level)
|
(js-ts-mode 'js-indent-level)
|
||||||
(js-mode 'js-indent-level)
|
(js-mode 'js-indent-level)
|
||||||
|
@ -50,11 +52,15 @@ always returns nil to defer to the formatter."
|
||||||
(robot-mode 'robot-mode-basic-offset)
|
(robot-mode 'robot-mode-basic-offset)
|
||||||
(perl-mode 'perl-indent-level)
|
(perl-mode 'perl-indent-level)
|
||||||
(python-mode 'python-indent-offset)
|
(python-mode 'python-indent-offset)
|
||||||
|
(ruby-mode 'ruby-indent-level)
|
||||||
|
(ruby-ts-mode 'ruby-indent-level)
|
||||||
(scss-mode 'css-indent-offset)
|
(scss-mode 'css-indent-offset)
|
||||||
|
(svelte-mode 'svelte-basic-offset)
|
||||||
(web-mode 'web-mode-indent-style)
|
(web-mode 'web-mode-indent-style)
|
||||||
(tsx-ts-mode 'typescript-ts-mode-indent-offset)
|
(tsx-ts-mode 'typescript-ts-mode-indent-offset)
|
||||||
(typescript-mode 'typescript-indent-level)
|
(typescript-mode 'typescript-indent-level)
|
||||||
(typescript-ts-mode 'typescript-ts-mode-indent-offset))))
|
(typescript-ts-mode 'typescript-ts-mode-indent-offset)
|
||||||
|
(yaml-mode 'yaml-indent-offset))))
|
||||||
|
|
||||||
(when-let ((indent (and indent-var
|
(when-let ((indent (and indent-var
|
||||||
(boundp indent-var)
|
(boundp indent-var)
|
||||||
|
|
Loading…
Add table
Reference in a new issue