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

feat: add mix fmt external format processor #2578

Merged

Conversation

yordis
Copy link
Contributor

@yordis yordis commented Apr 8, 2022

Fixes #997

Changelog

Enhancements

  • Add mix format external formatter.
    Requires project or module SDK be set in order to run. If the SDK is not available, only the internal formatter will be used. The internal formatter is still used for file subsection formatting and new line indenting as mix format works at the file-level.
    • Allow mix format external formatter to be disabled.

      1. Preferences
      2. Editor > Code Style > Elixir
      3. Click the mix format tab
      4. Expand the General group
      5. Uncheck "Format files with mix format".

Bug Fixes

  • Remove CodeStyleSettingsProvider because it is redundant with LanguageCodeStyleSettingsProvider

@yordis yordis force-pushed the add-mix-fmt-external-format-processor branch from f698242 to 78b711d Compare May 23, 2022 21:20
@KronicDeth KronicDeth force-pushed the add-mix-fmt-external-format-processor branch 2 times, most recently from e112efe to 76f04b1 Compare May 27, 2022 22:08
@KronicDeth KronicDeth added this to the 13.1.0 milestone May 27, 2022
@KronicDeth KronicDeth force-pushed the add-mix-fmt-external-format-processor branch 2 times, most recently from 983226a to c574e8f Compare May 27, 2022 22:50
@KronicDeth KronicDeth marked this pull request as ready for review May 27, 2022 22:52
yordis and others added 3 commits May 29, 2022 22:56
Fixes KronicDeth#997

To format manually:

With the keyboard

* Mac: ⌥⇧⌘L
* Linux/Windows: Ctrl+Alt+Shift+L

From the menus

1. Code
2. Reformat File
3. Click Run in the "Reformat File" dialog

To tun on format on save:

1. Preferences
2. Tools > Actions on Save.
3. Check "Reformat code".
4. Make sure "All file types" is set or at least "Files: Elixir" is set.

Autosave

JetBrains IDEs have autosave turned on by default, but you can adjust the settings:

1. Preferences
2. Appearance & Behavior > System Settings.
3. Check or uncheck the settings in the Autosave section.
While I disagree with using a non-community-standard style, some users prefer it and having the settings allows the internal formatter settings to remain working.

1. Preferences
2. Editor > Code Style > Elixir
3. Click the `mix format` tab
4. Expand the General group
4. Uncheck "Format files with `mix format`".
@KronicDeth KronicDeth force-pushed the add-mix-fmt-external-format-processor branch from 724e791 to 45fd95e Compare May 30, 2022 03:58
@KronicDeth KronicDeth merged commit af1ce84 into KronicDeth:main May 30, 2022
CHANGELOG.md Show resolved Hide resolved
@yordis yordis deleted the add-mix-fmt-external-format-processor branch August 8, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Elixir 1.6 task format for code formatting
2 participants