Skip to content

Commit 4c29598

Browse files
plumpycushon
authored andcommitted
Enable the google-java-format IntelliJ plugin by default.
Previously it was disabled by default, but I think more users would prefer this. MOE_MIGRATED_REVID=190939492
1 parent 98f7771 commit 4c29598

File tree

5 files changed

+13
-32
lines changed

5 files changed

+13
-32
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,23 @@ A [google-java-format IntelliJ
3333
plugin](https://plugins.jetbrains.com/plugin/8527) is available from the plugin
3434
repository.
3535

36-
The plugin will not be enabled by default. To enable it in the current project,
37-
go to "File→Settings...→google-java-format Settings" and check the "Enable"
38-
checkbox.
36+
The plugin will be enabled by default. To disable it in the current project, go
37+
to "File→Settings...→google-java-format Settings" (or "IntelliJ
38+
IDEA→Preferences...→Other Settings→google-java-format Settings" on macOS) and
39+
uncheck the "Enable google-java-format" checkbox.
3940

40-
To enable it by default in new projects, use "File→Other Settings→Default
41+
To disable it by default in new projects, use "File→Other Settings→Default
4142
Settings...".
4243

4344
When enabled, it will replace the normal "Reformat Code" action, which can be
4445
triggered from the "Code" menu or with the Ctrl-Alt-L (by default) keyboard
4546
shortcut.
4647

48+
The import ordering is not handled by this plugin, unfortunately. To fix the
49+
import order, download the [IntelliJ Java Google Style
50+
file](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml)
51+
and import it into File→Settings→Editor→Code Style.
52+
4753
### Eclipse
4854

4955
A [google-java-format Eclipse

idea_plugin/README.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

idea_plugin/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
plugins {
18-
id "org.jetbrains.intellij" version "0.2.17"
18+
id "org.jetbrains.intellij" version "0.3.1"
1919
}
2020

2121
task showProps {
@@ -39,7 +39,7 @@ intellij {
3939
pluginName = "google-java-format"
4040
updateSinceUntilBuild = true
4141
sameSinceUntilBuild = true
42-
version = "2017.3.3"
42+
version = "2018.1"
4343
}
4444

4545
patchPluginXml {

idea_plugin/src/com/google/googlejavaformat/intellij/CodeStyleManagerDecorator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
/**
3939
* Decorates the {@link CodeStyleManager} abstract class by delegating to a concrete implementation
4040
* instance (likely IJ's default instance).
41-
*
42-
* @author [email protected] (Brian Chang)
4341
*/
4442
@SuppressWarnings("deprecation")
4543
class CodeStyleManagerDecorator extends CodeStyleManager

idea_plugin/src/com/google/googlejavaformat/intellij/GoogleJavaFormatSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private void updateFormatterState() {
8181
}
8282

8383
static class State {
84-
public boolean enabled = false;
84+
public boolean enabled = true;
8585
public JavaFormatterOptions.Style style = JavaFormatterOptions.Style.GOOGLE;
8686
}
8787
}

0 commit comments

Comments
 (0)