You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like they did this by making a new Java14InputAstVisitor which extends the normal JavaInputAstVisitor and then reflectively deciding whether or not to construct it depending on what java compiler version is on the classpath, as this affects whether org.openjdk.source.util.TreePathScanner has the extra visit methods or not:
visitBindingPattern
visitYield
visitSwitchExpression
visitInstanceOf
What did you want to happen?
I think we currently bundle com.google.errorprone:javac-shaded:9+181-r4173-1 in p-j-f, which means we're going to be a bit stuck on this front. Google switched away from this in google/google-java-format#447, and I think we need to do the same in order to be able to keep picking up new language features.
This will likely also require some tweaks to how p-j-f is used from the intellij plugin etc, as we'll need to ensure the relevant java modules (com.sun.tools.javac.{file,main,parser,tree,util,code,api}) are exposed using something like the --add-exports flag.
What happened?
Things like records, switch expressions, a new
instanceof
syntax and multiline strings are available in newer java compilers.Support for these features landed in upstream google-java-format in various commits, including google/google-java-format@4ddb914.
Seems like they did this by making a new
Java14InputAstVisitor
which extends the normalJavaInputAstVisitor
and then reflectively deciding whether or not to construct it depending on what java compiler version is on the classpath, as this affects whetherorg.openjdk.source.util.TreePathScanner
has the extra visit methods or not:What did you want to happen?
I think we currently bundle
com.google.errorprone:javac-shaded:9+181-r4173-1
in p-j-f, which means we're going to be a bit stuck on this front. Google switched away from this in google/google-java-format#447, and I think we need to do the same in order to be able to keep picking up new language features.This will likely also require some tweaks to how p-j-f is used from the intellij plugin etc, as we'll need to ensure the relevant java modules (com.sun.tools.javac.{file,main,parser,tree,util,code,api}) are exposed using something like the
--add-exports
flag.cc @fawind
The text was updated successfully, but these errors were encountered: