-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use JLS23 as latest compliance level in AST #465
base: dom-with-javac
Are you sure you want to change the base?
Conversation
@mickaelistria another small fix to make javac usable with debugging in vscode. |
This seems to cause ~60 new test failures: https://ci.eclipse.org/ls/job/jdt-core-incubator/job/PR-465/1/ |
If we check the code here https://github.com/microsoft/java-debug/blob/83403a458e0d01fba5a3871fea81af742460bdf0/com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/JdtSourceLookUpProvider.java#L103 as we can see it reads the latest java version from
|
@mickaelistria How should we handle this ? |
I'm curious about "AST validation is restricted to Java 22", can you please elaborate how we can see this? I think AST validation should be working for any known AST version, independently of what's the one marked as latest. |
dd2c73d
to
4c6a3af
Compare
The problem happens in https://github.com/gayanper/eclipse.jdt.core/blob/81b72d0d5ee1283ae61f543bb64d6e966fd35e22/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java#L1181 Since the constant at https://github.com/gayanper/eclipse.jdt.core/blob/81b72d0d5ee1283ae61f543bb64d6e966fd35e22/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java#L546 is not pointing to the latest version provided by |
81b72d0
to
a8469fd
Compare
4a396d4
to
3f96312
Compare
a0cdf42
to
bc044a4
Compare
fd888a3
to
0ad2048
Compare
I previously encountered this issue as well while using the VS Code Java Debugger to debug applications that were switched to Javac. It happens when my session enables breakpoints in some Java files. The reason is that Java Debugger needs to invoke the DOM ASTParser (e.g., To prevent this issue from occurring in the future, we need a flag to determine the actual highest AST version supported by the underlying parser. |
@testforstephen @mickaelistria What if we use the above flag in the |
Introducing a system property will delegate the maintenance responsibility to the integration client, that looks a bit heavy to me. Instead, the supported java versions should be a capability of the ASTParser. The ASTParser should include a new method Additionally, we have added an extension point |
The |
@mickaelistria @testforstephen changes to jdt.core for supporting javac support will get approved ? Since the current way of jdt working is tailored to ECJ and it works fine. And if we are suggesting a new change that benefit the javac support which is not yet in jdt.core main line, I'm thinking if it will be a hard sell. |
The API change and extension points to allow plugging an alternative parser/compiler are already merged in. The particular Javac extension is not planned to be contributed to JDT at the moment. I would be great to contribute it later, but this is not yet a priority to us and to other JDT contributors, so let's wait a bit. |
f752b35
to
42d59cc
Compare
7fa6490
to
d4193c8
Compare
eg. ```java public class Superclass { public Superclass(int i) { } } ``` ```java public class Subclass extends Superclass { } ``` An error is issued; this PR ensures that the range covers the text `Subclass`, which fixes the quickfix to add a constructor when it's invoked from the beginning of the line. Signed-off-by: David Thompson <[email protected]>
Signed-off-by: David Thompson <[email protected]>
Do not use the original (recovered) type if it's also erroneous, instead use the type stub. Should fix a few tests, probably 4ish. Signed-off-by: David Thompson <[email protected]>
- `ModifierCorrectionsQuickFixTest.testAddPermitsToDirectSuperClass` - `ModifierCorrectionsQuickFixTest.testAddSealedAsDirectSuperClass` - `ModifierCorrectionsQuickFixTest.testAddSealedMissingClassModifierProposal` - Fix id for "cannot inherit final" for anonymous classes Signed-off-by: David Thompson <[email protected]>
…ng import Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
- Also fix a mostly unrelated classcast exception Signed-off-by: David Thompson <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
…-jdt#597) fix: eclipse-jdt#592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
Signed-off-by: David Thompson <[email protected]>
133ca08
to
f94e358
Compare
13a7ce9
to
911e4b3
Compare
16bd705
to
9fb5696
Compare
Currently JavaCore returns the latest supported java version as Java 23, But the AST validation is restricted to Java 22, this cause the issue with vscode java debugger, which sends the compliancy level as 23 when evaluating debug breakpoints to be registered.