radian-software / apheleia

🌷 Run code formatter on buffer contents without moving point, using RCS patches and dynamic programming.
MIT License
517 stars 73 forks source link

Determine indent level from more modes #258

Closed scop closed 6 months ago

scop commented 7 months ago

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 :)

scop commented 7 months ago

Reworked against current main branch.

raxod502 commented 6 months ago

At least we got that pesky variable renamed though with the refactor!