-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more settings to IJ Plugin UI (#503)
Summary: As discussed on Slack, this PR exposes the existing settings (`FormattingOptions`) in the IJ plugin UI. This brings the IJ plugin in line with the Gradle one. There is also a migration from the old settings (`enabled` as a boolean) to the new ones (`enableKtfmt` as an enum) that allows us to drop a bunch of legacy code and use better, Kotlin-friendly APIs. I (manually) tested both migrating from old settings (enabled and disabled) and starting anew, and it works fine. I have already used a similar strategy in the detekt plugin, and it worked well there, too. ## The new Custom option https://github.com/user-attachments/assets/215f7e05-86a5-46d1-9cd7-4495fd3395d1 When selecting the Custom option, users can freely choose a max line length, indent/continuation indent size, and whether ktfmt should be managing imports and trailing commas. The UI will display validation errors if the numeric values are invalid (not shown above). It also allows to use one of the presets as starting points for customizing, which I expect will be a pretty common use case — e.g., I may want to use Meta's style, but with longer lines. Pull Request resolved: #503 Reviewed By: cortinico Differential Revision: D61204964 Pulled By: hick209 fbshipit-source-id: 974baaa7118535b5aa08563b4c242c0e32535696
- Loading branch information
1 parent
a1ffe3d
commit 7fceb85
Showing
5 changed files
with
325 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.