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

Added reformat action to public api #2358

Merged
merged 5 commits into from
May 25, 2024
Merged

Added reformat action to public api #2358

merged 5 commits into from
May 25, 2024

Conversation

AndreasArvidsson
Copy link
Member

Checklist

  • [/] I have added tests
  • I have updated the docs and cheatsheet
  • I have not broken the cheatsheet

@AndreasArvidsson AndreasArvidsson requested a review from pokey as a code owner May 25, 2024 07:50
Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented May 25, 2024

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:

### Example of custom formatter command
The below command will allow you to say `camel form blue air`.
_You can disable the default Cursorless reformat command by prefixing the spoken form in the `actions.csv` with a dash. `-format, applyFormatter`_
```talon
<user.formatters> form <user.cursorless_target>:
user.cursorless_reformat(cursorless_target, formatters)
```

@AndreasArvidsson
Copy link
Member Author

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

@pokey pokey added this pull request to the merge queue May 25, 2024
Merged via the queue into main with commit 4c6fc54 May 25, 2024
15 checks passed
@pokey pokey deleted the public_reformat branch May 25, 2024 09:38
cursorless-bot pushed a commit that referenced this pull request May 25, 2024
## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@auscompgeek
Copy link
Member

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
Copy link
Member

pokey commented May 25, 2024

@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
Copy link
Member

pokey commented May 25, 2024

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
Copy link
Member Author

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

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

Successfully merging this pull request may close these issues.

3 participants