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

reformat a selection or a function reformat all file #34

Open
grumpyf0x48 opened this issue Aug 1, 2020 · 1 comment
Open

reformat a selection or a function reformat all file #34

grumpyf0x48 opened this issue Aug 1, 2020 · 1 comment

Comments

@grumpyf0x48
Copy link

When you select a code block or an entire function and do Code -> Reformat Code, the entire file is reformatted !

It was working fine with previous Plugin: Bash Support.

@jansorg
Copy link
Contributor

jansorg commented Jun 12, 2021

The difference to legacy BashSupport is that an external formatter (i.e. shfmt) is used. This formatter is only supporting to format all of the code passed to it.

The next major version of BashSupport Pro, 2.0, will improve this situation (it's already available in the preview versions).
If text is selected, then this range is expanded to the next complete Bash construct and is then send to the formatter.
Formatting content which isn't valid on its own, e.g. a in a b c of for a in a b c; do echo $a; done would reformat the for loop, for example. But that's mostly the same as formatters of other languages in IntelliJ.

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

No branches or pull requests

2 participants