Skip to content

Commit

Permalink
Switch to DocumentFormattingService interface
Browse files Browse the repository at this point in the history
Upgrade to IntelliJ IDEA 2022.3.2 and change the formatter to be an
implementation of `DocumentFormattingService`.

This significantly simplifies the plugin and hopefully removes some of
the compatibility issues that have happened in the past.

Closes gh-359
  • Loading branch information
philwebb committed Feb 8, 2023
1 parent 759dfdf commit 91d1381
Show file tree
Hide file tree
Showing 27 changed files with 527 additions and 1,247 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ or use the https://repo.spring.io/javaformat-eclipse-update-site/[update site].

=== IntelliJ IDEA
The IntelliJ IDEA plugin provides custom formatter support for IntelliJ IDEA.
The plugin is automatically activated whenever the Maven or Gradle plugins are discovered in a project build script.
The plugin is automatically activated whenever the Maven or Gradle plugins are discovered in a project build script or if a `.springjavaformatconfig` file.
A Spring Java Format icon (image:spring-javaformat-intellij-idea/spring-javaformat-intellij-idea-plugin/src/main/resources/spring-javaformat/formatOn.png[title="Icon"]) will also be displayed in the status bar to indicate the formatter is active.
You can use the standard `code` -> `reformat code` action to format the code.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@
<name>Spring JavaFormat IntelliJ IDEA Plugin</name>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
<java.version>11</java.version>
<java.version>17</java.version>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>spring-javaformat-formatter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>spring-javaformat-formatter-eclipse-runtime</artifactId>
Expand All @@ -32,6 +27,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>spring-javaformat-formatter</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Provided -->
<dependency>
<groupId>io.spring.javaformat</groupId>
Expand All @@ -41,14 +41,20 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.spring.javaformat.intellij.idea</groupId>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>13.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.spring.javaformat.intellij.idea</groupId>
<artifactId>app</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.spring.javaformat.intellij.idea</groupId>
<artifactId>platform-api</artifactId>
<artifactId>jps-model</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
Expand All @@ -66,7 +72,7 @@
</dependency>
<dependency>
<groupId>io.spring.javaformat.intellij.idea</groupId>
<artifactId>idea</artifactId>
<artifactId>util_rt</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
Expand All @@ -78,7 +84,7 @@
</dependency>
<dependency>
<groupId>io.spring.javaformat.intellij.idea</groupId>
<artifactId>maven-server-api</artifactId>
<artifactId>maven-server</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -110,6 +116,18 @@
<artifactId>picocontainer</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<version>1.6.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>8.5.11</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
Expand Down

This file was deleted.

Loading

0 comments on commit 91d1381

Please sign in to comment.