-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AST getAll[Supported]Versions and isSupportedVersion #3567
Conversation
eclipse-jdt/eclipse.jdt.ui#1948 is an example of usage of new API. |
@iloveeclipse IIRC you added the similar API in JavaCore so would you please take a look. |
@@ -1193,7 +1204,7 @@ private AST(int level, boolean previewEnabled) { | |||
false/*isPreviewEnabled*/); | |||
break; | |||
default: | |||
if (level < JLS2_INTERNAL && level > JLS_Latest) { | |||
if (!ALL_VERSIONS.contains(level)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be SUPPORTED_VERSIONS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using SUPPORTED_VERSIONS should happen in #3533 together with switching the mapping to prevent inconsistencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I've never worked within AST area, so no idea what is supposed to be supported or not. So would be nice if someone familiar with AST could review too,
I'll wait Monday and push it if no one jumps in. |
New methods to ease finding all/supported JLS versions. Supported JLS versions helpers are needed in order ease limiting AST support to what compiler supports.
I found this only now. @akurtakov this adds to the set of locations that need to be touched whenever a new Java version is supported. We already have |
@stephan-herrmann Here yes but e.g. in eclipse-jdt/eclipse.jdt.ui#1966 it removes one such place (the goal is to have jdt.ui/debug need less or even no changes for adding constants). |
I didn't argue against providing this API, I only wonder why it needs to be implemented using an explicit list. |
My reasons were:
|
Thanks. I had hoped we could do with less duplication, but for now I added the new locations needing updates to https://github.com/eclipse-jdt/eclipse.jdt.core/wiki/Adding-support-for-new-Java-version-and-Features-in-JDT (also |
New methods to ease finding all/supported JLS versions. Supported JLS versions helpers are needed in order ease limiting AST support to what compiler supports.