EclipseCodeFormatter
EclipseCodeFormatter copied to clipboard
Make EclipseCodeFormatter plugin work on the fly
From IntelliJ IDEA documentation (link):
IntelliJ IDEA automatically applies a code style you've configured in the Code Style settings as you edit, and in most cases you don't need to call the Reformat Code action explicitly.
Currently, when writing the code IDEA applies its own formatting, so to make EclipseCodeFormatter plugin do his job I have to call Reformat Code option manually or use Intellij Save Actions Plugin to trigger code formatting on Save Action.
It would be very helpful to make EclipseCodeFormatter plugin work on the fly when you write the code.
Example: Initial code
public boolean isEnabled() {
return bookmarksTableEditor.getTable().getSelectedRowCount() == 1
&& bookmarksTableEditor.getTable().getSelectedRow() != bookmarksTableEditor.getTable()
.getRowCount() - 1;
}
Actual behaviour after pressing Enter before .getTable()
public boolean isEnabled() {
return bookmarksTableEditor.getTable().getSelectedRowCount() == 1
&& bookmarksTableEditor.getTable().getSelectedRow() != bookmarksTableEditor
.getTable()
.getRowCount() - 1;
}
Expected behaviour after pressing Enter before .getTable()
. Currently, this behaviour can be achieved by manually calling Reformat Code option
public boolean isEnabled() {
return bookmarksTableEditor.getTable().getSelectedRowCount() == 1
&& bookmarksTableEditor.getTable().getSelectedRow() != bookmarksTableEditor
.getTable()
.getRowCount() - 1;
}
Last time it did something on the fly, was for Live Templates, at it resulted in a wrong caret and selection position, because that is calculated according to IntelliJ style. So I don't think it is feasible.