diff options
author | Michael Plump <plumpy@google.com> | 2023-04-03 22:10:40 -0700 |
---|---|---|
committer | google-java-format Team <google-java-format-dev+copybara@google.com> | 2023-04-03 22:11:14 -0700 |
commit | 25ce685ffbc1143f3e7d93c8655e8590cfaaf61b (patch) | |
tree | 7ce85f9467a967d07577840377df77a861c70d77 | |
parent | 401d5c96946c856353a0edf83631f694303ae3ee (diff) | |
download | google-java-format-25ce685ffbc1143f3e7d93c8655e8590cfaaf61b.tar.gz |
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
4 files changed, 6 insertions, 5 deletions
diff --git a/idea_plugin/build.gradle.kts b/idea_plugin/build.gradle.kts index a05b0cb..474c24d 100644 --- a/idea_plugin/build.gradle.kts +++ b/idea_plugin/build.gradle.kts @@ -14,7 +14,7 @@ * limitations under the License. */ -plugins { id("org.jetbrains.intellij") version "1.13.2" } +plugins { id("org.jetbrains.intellij") version "1.13.3" } apply(plugin = "org.jetbrains.intellij") @@ -37,7 +37,7 @@ intellij { tasks { patchPluginXml { - version.set("${googleJavaFormatVersion}.1") + version.set("${googleJavaFormatVersion}.2") sinceBuild.set("213") untilBuild.set("") } diff --git a/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatFormattingService.java b/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatFormattingService.java index 150a739..9d2d7a5 100644 --- a/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatFormattingService.java +++ b/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatFormattingService.java @@ -74,7 +74,7 @@ public class GoogleJavaFormatFormattingService extends AsyncDocumentFormattingSe @Override public @NotNull Set<Feature> getFeatures() { - return Set.of(Feature.AD_HOC_FORMATTING, Feature.FORMAT_FRAGMENTS, Feature.OPTIMIZE_IMPORTS); + return Set.of(Feature.FORMAT_FRAGMENTS, Feature.OPTIMIZE_IMPORTS); } @Override diff --git a/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatSettings.java b/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatSettings.java index ad740b2..ee187c0 100644 --- a/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatSettings.java +++ b/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/GoogleJavaFormatSettings.java @@ -18,7 +18,6 @@ package com.google.googlejavaformat.intellij; import com.google.googlejavaformat.java.JavaFormatterOptions; import com.intellij.openapi.components.PersistentStateComponent; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.project.Project; @@ -39,7 +38,7 @@ class GoogleJavaFormatSettings implements PersistentStateComponent<GoogleJavaFor } static GoogleJavaFormatSettings getInstance(Project project) { - return ServiceManager.getService(project, GoogleJavaFormatSettings.class); + return project.getService(GoogleJavaFormatSettings.class); } @Nullable diff --git a/idea_plugin/src/main/resources/META-INF/plugin.xml b/idea_plugin/src/main/resources/META-INF/plugin.xml index d59c3c2..42011a2 100644 --- a/idea_plugin/src/main/resources/META-INF/plugin.xml +++ b/idea_plugin/src/main/resources/META-INF/plugin.xml @@ -35,6 +35,8 @@ ]]></description> <change-notes><![CDATA[ <dl> + <dt>1.16.0.2</dt> + <dd>Disable AD_HOC_FORMATTING, which should stop the formatter from running so often when it wasn't specifically requested. <dt>1.16.0.1</dt> <dd>When the plugin isn't configured correctly, show the error on every format command. Previously it was only being shown at startup and going |