8000 Remove AD_HOC_FORMATTING from the IntelliJ plugin. · google/google-java-format@25ce685 · GitHub
[go: up one dir, main page]

Skip to content

Commit 25ce685

Browse files
plumpygoogle-java-format Team
authored andcommitted
Remove AD_HOC_FORMATTING from the IntelliJ plugin.
I have a feeling this is causing a lot of the issues people are seeing where it's constantly trying to reformat and failing because of syntax errors. Hopefully this will make it only try to reformat when a user specifically requests it. PiperOrigin-RevId: 521657519
1 parent 401d5c9 commit 25ce685

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

idea_plugin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
plugins { id("org.jetbrains.intellij") version "1.13.2" }
17+
plugins { id("org.jetbrains.intellij") version "1.13.3" }
1818

1919
apply(plugin = "org.jetbrains.intellij")
2020

@@ -37,7 +37,7 @@ intellij {
3737

3838
tasks {
3939
patchPluginXml {
40-
version.set("${googleJavaFormatVersion}.1")
40+
version.set("${googleJavaFormatVersion}.2")
4141
sinceBuild.set("213")
4242
untilBuild.set("")
4343
}

idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatFormattingService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static Formatter createFormatter(Style style, boolean canChangeWhiteSpac
7474

7575
@Override
7676
public @NotNull Set<Feature> getFeatures() {
77-
return Set.of(Feature.AD_HOC_FORMATTING, Feature.FORMAT_FRAGMENTS, Feature.OPTIMIZE_IMPORTS);
77+
return Set.of(Feature.FORMAT_FRAGMENTS, Feature.OPTIMIZE_IMPORTS);
7878
}
7979

8080
@Override

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import com.google.googlejavaformat.java.JavaFormatterOptions;
2020
import com.intellij.openapi.components.PersistentStateComponent;
21-
import com.intellij.openapi.components.ServiceManager;
2221
import com.intellij.openapi.components.State;
2322
import com.intellij.openapi.components.Storage;
2423
import com.intellij.openapi.project.Project;
@@ -39,7 +38,7 @@ class GoogleJavaFormatSettings implements PersistentStateComponent<GoogleJavaFor
3938
}
4039

4140
static GoogleJavaFormatSettings getInstance(Project project) {
42-
return ServiceManager.getService(project, GoogleJavaFormatSettings.class);
41+
return project.getService(GoogleJavaFormatSettings.class);
4342
}
4443

4544
@Nullable

idea_plugin/src/main/resources/META-INF/plugin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
]]></description>
3636
<change-notes><![CDATA[
3737
<dl>
38+
<dt>1.16.0.2</dt>
39+
<dd>Disable AD_HOC_FORMATTING, which should stop the formatter from running so often when it wasn't specifically requested.
3840
<dt>1.16.0.1</dt>
3941
<dd>When the plugin isn't configured correctly, show the error on every
4042
format command. Previously it was only being shown at startup and going

0 commit comments

Comments
 (0)
0