- This is forked from https://github.com/palantir/palantir-java-format, and I added one commit
- The commit adds the ability to package this gradle project as a
shadow jar. - Having a
shadow jaris necessary to use this formatter in VS code.
Run this command to generate a shadow jar
./gradlew shadowJarIt will create a jar file in build/libs/palantir-java-format-<version>.
In VS code, set these settings
"palantir-java-format.allDepsJarPath": "/Users/aarij/Desktop/palantir-java-format/palantir-java-format/build/libs/palantir-java-format-2.58.0.dirty-all-deps.jar",
"palantir-java-format.additionalArgs": "--palantir"Now, VS code will know how to format your Java files.
Note: In IntelliJ, the version of the formatter will be set in one of your build files. It will be something like this.
com.palantir.javaformat:gradle-palantir-java-format:2.58.0
You want to make sure this repo is the same version as your dependency. For example, you would have to checkout the commit at this tag to get the right version of the formatter.
- https://github.com/palantir/palantir-java-format/releases/tag/2.58.0
- If you don't do this, the formatted files may slightly mismatch.
