{"id":15134539,"url":"https://github.com/dubreuia/intellij-plugin-save-actions","last_synced_at":"2025-04-04T13:11:26.492Z","repository":{"id":24946602,"uuid":"28364230","full_name":"dubreuia/intellij-plugin-save-actions","owner":"dubreuia","description":"Supports configurable, Eclipse like, save actions, including \"organize imports\", \"reformat code\" and \"rearrange code\".","archived":false,"fork":false,"pushed_at":"2023-08-15T08:59:49.000Z","size":1561,"stargazers_count":528,"open_issues_count":72,"forks_count":102,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-03-28T12:07:02.590Z","etag":null,"topics":["androidstudio","clion","eclipse","intellij","java","jetbrains","phpstorm","pycharm","webstorm"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dubreuia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-12-22T23:03:55.000Z","updated_at":"2025-03-13T06:14:20.000Z","dependencies_parsed_at":"2023-02-14T22:17:00.720Z","dependency_job_id":"99de2a43-8d18-49b3-bc59-836198e6cb0a","html_url":"https://github.com/dubreuia/intellij-plugin-save-actions","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubreuia%2Fintellij-plugin-save-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubreuia%2Fintellij-plugin-save-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubreuia%2Fintellij-plugin-save-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubreuia%2Fintellij-plugin-save-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dubreuia","download_url":"https://codeload.github.com/dubreuia/intellij-plugin-save-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182348,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["androidstudio","clion","eclipse","intellij","java","jetbrains","phpstorm","pycharm","webstorm"],"created_at":"2024-09-26T05:22:38.182Z","updated_at":"2025-04-04T13:11:26.468Z","avatar_url":"https://github.com/dubreuia.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **⚠️ This project has been archived and is looking for a maintainer ⚠️**\n\n# Save Actions Plugin\n\n[![JetBrains Plugin](./docs/badge-jetbrains-website.svg)](https://plugins.jetbrains.com/plugin/7642-save-actions)\n[![JetBrains Supported](./docs/badge-jetbrains-supported.svg)](https://www.jetbrains.com/?from=intellij-save-actions-plugin)\n[![Travis CI Build Status](https://travis-ci.org/dubreuia/intellij-plugin-save-actions.svg?branch=main)](https://travis-ci.org/dubreuia/intellij-plugin-save-actions)\n[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/dubreuia/intellij-plugin-save-actions?branch=main\u0026svg=true)](https://ci.appveyor.com/project/dubreuia/intellij-plugin-save-actions)\n[![Codecov Code Coverage](https://codecov.io/gh/dubreuia/intellij-plugin-save-actions/branch/main/graph/badge.svg)](https://codecov.io/gh/dubreuia/intellij-plugin-save-actions)\n\nSupports configurable, Eclipse like, save actions, including \"optimize imports\", \"reformat code\", \"rearrange code\", \"compile file\" and some quick fixes like \"add / remove 'this' qualifier\", etc. The plugin executes the configured actions when the file is synchronised (or saved) on disk.\n\nUsing the save actions plugin makes your code cleaner and more uniform across your code base by enforcing your code style and code rules every time you save. The settings file (see [files location](#files-location)) can be shared in your development team so that every developer has the same configuration.\n\nThe code style applied by the save actions plugin is the one configured your settings at \"File \u003e Settings \u003e Editor \u003e Code Style\". For some languages, custom formatter (Dartfmt, Prettier, etc.) may also be triggered by the save actions plugin. See the [Editor Actions](#editor-actions) configuration for more information.\n\nThank you to JetBrains for supporting the Save Actions plugin: they provide an open-source license, which is necessary to build, test and deploy this plugin. Check out their products at [https://www.jetbrains.com](https://www.jetbrains.com/?from=intellij-save-actions-plugin).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Save Actions Plugin icon light\" title=\"Save Actions Plugin icon light\" src=\"./docs/icon-save-actions.svg\" width=\"200\" height=\"200\"\u003e\n\u003c/p\u003e\n\n## Content\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n- [Compatibility](#compatibility)\n- [Files location](#files-location)\n- [Contributions](#contributions)\n- [Links](#links)\n- [Licence](#licence)\n\n## Features\n\n### All JetBrains products\n\n- Optimize imports\n- Run on file save, shortcut, batch (or a combination)\n- Run on multiple files by choosing a scope\n- Reformat code (whole file or only changed text)\n- Rearrange code (reorder methods, fields, etc.)\n- Include / exclude files with regex support\n- Works on any file type (Java, Python, XML, etc.)\n- Launch any editor action using \"quick lists\"\n- Uses a settings file per project you can commit (see [Files location](#files-location))\n- Available keymaps and actions for activation (see [Keymap and actions](#keymap-and-actions))\n\n![Save actions plugin settings page](https://github.com/dubreuia/intellij-plugin-save-actions/blob/main/docs/intellij-save-actions-plugin-settings-page.png)\n\n### Java IDE products\n\nWorks in JetBrains IDE with Java support, like Intellij IDEA and AndroidStudio.\n\n- Compile project after save (if compiling is available)\n- Reload debugger after save (if compiling is available)\n- Eclipse configuration file `.epf` support (see [Eclipse support](#eclipse-support))\n- Automatically fix Java inspections (see [Java quick fixes](#java-fixes))\n\n![Save actions plugin settings page for Java](https://github.com/dubreuia/intellij-plugin-save-actions/blob/main/docs/intellij-save-actions-plugin-settings-page-java.png)\n\n## Installation\n\n### IDE (recommended)\n\nInstall it from your IDE (Intellij IDEA, PyCharm, etc.):\n\n- \"File \u003e Settings \u003e Plugins \u003e Browse repositories... \u003e Search 'Save Actions' \u003e Category 'Code tools'\"\n\n### JetBrains plugin repository\n\nAll versions of the plugin are available from the [JetBrains plugin repository](https://plugins.jetbrains.com/plugin/7642). You can download the jar and add it to your IDE (you won't get updates thought):\n\n- \"File \u003e Settings \u003e Plugins \u003e Install plugin from disk...\"\n\n## Usage\n\nThe plugin can trigger automatically or manually on IDE actions (standard actions) or plugin actions. Most actions needs to be enabled individually (see [activation](#activation)).\n\n### IDE actions\n\nThe plugin will trigger automatically on any of these IDE actions (needs to be activated with \"Activate save actions on file save\" in [activation](#activation))):\n\n- **Frame deactivation**, which is when the editor loses focus, configured in \"File \u003e Settings \u003e Appearance \u0026 Behavior \u003e System Settings \u003e Save files on frame deactivation\" .\n- **Application idle**, which is when the IDE isn't used for a period of time, configured in \"File \u003e Settings \u003e Appearance \u0026 Behavior \u003e System Settings \u003e Save files automatically if application is idle for x sec\".\n- **Save All**, which is bound by default to \"CTRL + S\". Some IDE might use \"CTRL + S\" for the single **Save Document** action, on which the plugin will NOT trigger. This is by design, see issue [#222](https://github.com/dubreuia/intellij-plugin-save-actions/issues/222).\n\n### Plugin actions\n\nThe plugin actions are grouped under the menu \"Code \u003e Save Actions\". You can associate a keymap to any action in \"Settings \u003e Keymap \u003e Search 'save actions'\".\n\n- **Enable Save Actions (default: not binded)** will activate or deactivate the plugin by changing the configuration.\n- **Execute Save Actions on shortcut (default: \"CTRL + SHIFT + S\")** will trigger the plugin manually (needs to be activated with \"Activate save actions on shortcut\" in [activation](#activation)).\n- **Execute Save Actions on multiple files (default: not binded)** will show a popup to select the files (or a scope) on which to trigger the plugin (needs to be activated with \"Activate save actions on batch\" in [activation](#activation)).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Save Actions Plugin Action menu\" title=\"Save Actions Plugin Action menu\" src=\"./docs/intellij-save-actions-plugin-action-menu.png\" width=\"371\" height=\"77\"\u003e\n\u003c/p\u003e\n\n## Configuration\n\nThe configurations are located in \"File \u003e Settings \u003e Other Settings \u003e Save Actions\".\n\n### Activation\n\nYou can quickly toggle the plugin activation by using the \"Enable Save Action\" action. Use \"CTRL + SHIFT + A\" then search for it. It will also show if it is currently activated or not.\n\n| Name                               | Description\n| ---                                | ---\n| Activate save actions on file save | Enable / disable the plugin on file save. Before saving each file, it will perform the configured actions below\n| Activate save actions on shortcut  | Enable / disable the plugin on shortcut, by default \"CTRL + SHIFT + S\" (configured in \"File \u003e Keymaps \u003e Main menu \u003e Code \u003e Save Actions\")\n| Activate save actions on batch     | Enable / disable the plugin on batch, by using \"Code \u003e Save Actions \u003e Execute on multiple files\"\n| No action if compile errors        | Enable / disable no action if there are compile errors. Applied to each file individually\n\n### Global\n\n| Name                               | Description\n| ---                                | ---\n| Optimize imports                   | Enable / disable import organization (configured in \"File \u003e Settings \u003e Code Style \u003e Java \u003e Imports\")\n| Reformat file                      | Enable / disable formatting (configured in \"File \u003e Settings \u003e Code Style\"). See \"Reformat only changed code\" for more options\n| Reformat only changed lines        | Enable / disable formatting for only changed lines, which will work only if a VCS is configured\n| Rearrange fields and methods       | Enable / disable re-ordering of fields and methods (configured in \"File \u003e Settings \u003e Code Style \u003e Java \u003e Arrangement\")\n\n### Build\n\n| Name                               | Description\n| ---                                | ---\n| *\\[experimental\\]* Compile file    | Enable / disable compiling of the modified file. The compiler might compile other files as well. **Warning: this feature is experimental, please post feedback in the github issues**\n| *\\[experimental\\]* Reload file     | Enable / disable reloading of the files in the running debugger, meaning the files will get compiled first. The compiler might compile other files as well. **Warning: this feature is experimental, please post feedback in the github issues**\n| *\\[experimental\\]* Execute action  | Enable / disable executing of an action using quick lists (using quick lists at \"File \u003e Settings \u003e Appearance \u0026 Behavior \u003e Quick Lists\"). See [Editor Actions](#editor-actions) for more information **Warning: this feature is experimental, please post feedback in the github issues**\n\n#### Editor Actions\n\nSome languages requires specific actions, such as Dartfmt or Prettier:\n\n- For Dart developers, enable \"Use the dartfmt tool when formatting the whole file\" option in \"File \u003e Settings \u003e Editor \u003e Code Style \u003e Dart \u003e Dartfmt\".\n- For Prettier (https://prettier.io/) users, read below.\n\nUsing the \"Execute action\" configuration, the plugin can launch arbitrary editor actions. While not all actions will work, it can be used to launch external tools, specific runs, etc. This feature is experimental, you can post your feedback on issue [#118](https://github.com/dubreuia/intellij-plugin-save-actions/issues/118).\n\nThe actions are implemented in the form of \"quick lists\", an IDE function that is used to define a list of actions that can be then executed. Quick lists can be configured at \"File \u003e Settings \u003e Appearance \u0026 Behavior \u003e Quick Lists\", and once configured, one can be selected and used in the plugin, using the \"Execution action\" configuration drop down list.\n\n### File\n\n| Name                               | Description\n| ---                                | ---\n| File path inclusions               | Add / remove file path inclusions (by default, everything included). The Java regular expressions match the whole file name from the project root. Include only Java files: `.*\\.java`. \n| File path exclusions               | Add / remove file path exclusions to ignore files (overrides inclusions). The Java regular expressions match the whole file name from the project root. Exclude 'Main.java' only in root folder: `Main\\.java`. Exclude file 'Foo.java' only in folder 'src': `src/Foo\\.java`. Exclude all xml files in any folder: `.*/.*\\.xml`\n| Use external Eclipse configuration | Add external configuration file \".epf\" to read settings from. This will update the current settings and use only the \".epf\" file content. Use \"reset\" button to remove\n\n### Java fixes\n\nIf a quick fix adds something that is removed by another quick fix, the removal wins.\n\n| Name                                                                     | Description\n| ---                                                                      | ---\n| Add final modifier to field                                              | The field `private int field = 0` becomes `private final int field = 0`\n| Add final modifier to local variable or parameter                        | The local variable `int variable = 0` becomes `final int variable = 0`\n| Add final modifier to local variable or parameter except if implicit     | The local variable `int variable = 0` becomes `final int variable = 0`, but not if it is implicit like in try with resources `try (Resource r = new Resource())`\n| Add static modifier to methods                                           | The method `private void method()` becomes `private static void method()` if the content does not references instance fields\n| Add this to field access                                                 | The access to instance field `field = 0` becomes `this.field = 0`\n| Add this to method access                                                | The access to instance method `method()` becomes `this.method()`\n| Add class qualifier to static member access                              | The access to class field `FIELD = 0` becomes `Class.FIELD` for a class named Class. Exclusive with \"Add class qualifier to static member access outside declaring class only\".\n| Add class qualifier to static member access outside declaring class only | The access to class field `FIELD = 0` becomes `Class.FIELD` for a class named class, but only if the static member is outside declaring class. Exclusive with \"Add class qualifier to static member access\".\n| Add missing @Override annotations                                        | The method `void method()` becomes `@Override void method()` if it overrides a method from the parent class\n| Add blocks to if/while/for statements                                    | The statement `if (true) return false` becomes `if (true) { return false; }` (a block), also working for `for` and `while` statements\n| Add missing serialVersionUID field for Serializable classes              | The class `class Class implements Serializable` will get a new field `private static final long serialVersionUID` with generated serial version uid\n| Remove unnecessary this to field and method                              | The access to instance field `this.field = 0` becomes `field = 0`, also working for methods\n| Remove final from private method                                         | The method `private final void method()` becomes `private void method()`\n| Remove unnecessary final to local variable or parameter                  | The local variable `int final variable = 0` becomes `int variable = 0`\n| Remove explicit generic type for diamond                                 | The list creation `List\u003cString\u003e list = new ArrayList\u003cString\u003e()` becomes `List\u003cString\u003e list = new ArrayList\u003c\u003e()`\n| Remove unused suppress warning annotation                                | The annotation `@SuppressWarning` will be removed if it is unused (warning: \"unchecked\" doesn't work properly see [#87](https://github.com/dubreuia/intellij-plugin-save-actions/issues/87))\n| Remove unnecessary semicolon                                             | The statement `int variable = 0;;` becomes `int variable = 0;`\n| Remove blocks from if/while/for statements                               | The statement `if (true) { return false; }` becomes `if (true) return false;`, also working for `for` and `while` statements\n| Change visibility of field or method to lower access                     | The field `public int field = 0` becomes `private int field = 0` if it is not used outside class, also working for methods\n\n## Compatibility\n\nBuilt for SDK version 2016.3, 2018.3, 2019.3, using JDK 8, those are the currently supported products, and is not expected to work in other products:\n\n- \u003cimg src=\"./docs/icon-intellij-idea.svg\" width=\"30\"\u003e Intellij IDEA (ultimate and community)\n- \u003cimg src=\"./docs/icon-pycharm.svg\" width=\"30\"\u003e PyCharm (professional and community)\n- \u003cimg src=\"./docs/icon-phpstorm.svg\" width=\"30\"\u003e PHPStorm\n- \u003cimg src=\"./docs/icon-android-studio.svg\" width=\"30\"\u003e AndroidStudio\n- \u003cimg src=\"./docs/icon-webstorm.svg\" width=\"30\"\u003e WebStorm\n- \u003cimg src=\"./docs/icon-rubymine.svg\" width=\"30\"\u003e RubyMine\n- \u003cimg src=\"./docs/icon-clion.svg\" width=\"30\"\u003e CLion\n\nSee issue [#18](https://github.com/dubreuia/intellij-plugin-save-actions/issues/18) for a beta packaging that you can try in other products.\n\n### Backward compatibility\n\n- For SDK 2016.3, the latest version is [Release 1.6.0+2016.3](https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v1.6.0%2B2016.3) (not maintained anymore).\n- For SDK 2018.3, 2019.3 and EAP (not released on plugin repository) the latest version is in the [releases](https://github.com/dubreuia/intellij-plugin-save-actions/releases).\n\n### Eclipse configuration support\n\nThe save-actions plugin supports Eclipse configuration `.epf` files by the [Workspace Mechanic](https://marketplace.eclipse.org/content/workspace-mechanic) Eclipse plugin (Java IDE only). You can specify a path to an Eclipse configuration file in the \"Eclipse support\" settings section to import it. The plugin will load the content of the file in the plugin configuration, and disable the plugin configuration options (the checkbox will be grayed out). Use the \"reset\" button to remove the import.\n\nThe plugin will stay in sync with your Eclipse configuration file. Not every features are present on either side, but the ones that are in common are supported.\n\nYou can find an example of [an Eclipse configuration `.epf` file](src/test/resources/com/dubreuia/model) in the test resources.\n\n```properties\n# @title Save Actions\n# @description Save Actions\n# @task_type LASTMOD\nfile_export_version=3.0\n/instance/org.eclipse.jdt.ui/editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true\n/instance/org.eclipse.jdt.ui/sp_cleanup.format_source_code=true\n/instance/org.eclipse.jdt.ui/sp_cleanup.format_source_code_changes_only=false\n/instance/org.eclipse.jdt.ui/sp_cleanup.organize_imports=true\n/instance/org.eclipse.jdt.ui/sp_cleanup.remove_trailing_whitespaces=true\n...\n```\n\n### Other plugin compatibility\n\nSome things to note when using other plugins with the Save Actions plugin:\n\n- [IdeaVim](https://plugins.jetbrains.com/plugin/164-ideavim): Since the Save Actions plugin do not trigger on the \"Save Document\" action (see [usage](#usage)), using `:w` to save in IdeaVim won't trigger the plugin, but using `:wa` will, since it calls the \"Save All\" action. See issue [#222](https://github.com/dubreuia/intellij-plugin-save-actions/issues/222)).\n- [detekt](https://plugins.jetbrains.com/plugin/10761-detekt): Using the detekt plugin breaks the Save Actions plugin, see issue [#270](https://github.com/dubreuia/intellij-plugin-save-actions/issues/270).\n\n## Files location\n\n- **idea.log**: The log file the save actions plugin writes in. It contains debug information, prefixed with `com.dubreuia.SaveActionManager`. If you are using default locations, it would be in `~/.IntelliJIdeaVERSION/system/log/idea.log`.\n- **saveactions_settings.xml**: The settings file is saved by project in the `.idea` folder. That file can be committed in git thus shared in your development team. If you are using the default locations, it would be in `~/IdeaProjects/PROJECT_NAME/.idea/saveactions_settings.xml`\n\n## Contributions\n\n### Project management\n\nThere are 2 boards to track the issues (bug or features):\n\n- **[Agile Board - Save Actions - Ideas](https://github.com/dubreuia/intellij-plugin-save-actions/projects/2)** - Tracks your and our ideas for new features and the discussions around them. All the issues here are \"closed\"\n- **[Agile Board - Save Actions - Boards](https://github.com/dubreuia/intellij-plugin-save-actions/projects/3)** - Tracks the issues that are urgent enough and specified enough to be implemented. All the issues here are \"open\" except those that got implemented and will be release in next version, those are \"closed\" (and stay closed if they work once released).\n\nWhen you submit an issue, it will be triaged into either board.\n\n### Contributors\n\nBig thanks to all the contributors submitting issues, testing, and especially submitting pull requests. See [contributors graph](https://github.com/dubreuia/intellij-plugin-save-actions/graphs/contributors) :hearts:\n\n### Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n### Releasing\n\nSee [RELEASING](RELEASING.md).\n\n## Links\n\n### JetBrains plugin page\n\nThe plugin is in the [JetBrains plugin repository](https://plugins.jetbrains.com/plugin/7642-save-actions), please take the time to [rate it](https://plugins.jetbrains.com/plugin/7642-save-actions)! \n\n### Issues\n\nThe plugin does not work? You want more features? You can [ask me on twitter](https://twitter.com/dubreuia) or [create an issue on github](https://github.com/dubreuia/intellij-plugin-save-actions/issues).\n\n## Licence\n\n[MIT License](LICENSE.txt)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubreuia%2Fintellij-plugin-save-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdubreuia%2Fintellij-plugin-save-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubreuia%2Fintellij-plugin-save-actions/lists"}