cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.11k stars 77 forks source link

Added reformat action to public api #2358

Closed AndreasArvidsson closed 2 months ago

AndreasArvidsson commented 2 months ago

Checklist

AndreasArvidsson commented 2 months ago

Nice! I don't think we need tests, because the talon action is already tested

* [ ]  Would be good to add an example to the docs of how to use it in a command which takes a formatter via spoken form

I was planning to do that, but I can't find anywhere in our documentation where we have "recipes". Where should I place this?

EDIT: I've added an example to the customization file: https://github.com/cursorless-dev/cursorless/blob/e18c727177fac24d43cf8617ae3b8beecac37e55/docs/user/customization.md#L186-L194

AndreasArvidsson commented 2 months ago

@pokey I don't like that precommit removes trailing whitespaces from markdown files. I prefer to have it as two separate lines.

auscompgeek commented 2 months ago

I don't like that precommit removes trailing whitespaces from markdown files. I prefer to have it as two separate lines.

You can use a backslash to hard line break in Markdown: https://spec.commonmark.org/0.31.2/#hard-line-breaks

pokey commented 2 months ago

@pokey I don't like that precommit removes trailing whitespaces from markdown files. I prefer to have it as two separate lines.

Sorry I'm not following. Why do you want the trailing whitespace?

pokey commented 2 months ago

Ah right I wasn't familiar with that syntax. And yeah I'd def go for the backslash if you want a hard line break.

Although I'll generally always just go for two new lines to give a paragraph break. Eg that's what I would have done here

AndreasArvidsson commented 2 months ago

I've always used the syntax with trailing whitespaces for new lines, but of course since it's markdown you can do everything multiple ways :p