-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Support records in upcoming eclipse version #3888
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
Support records in upcoming eclipse version #3888
Conversation
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.
I tried this out and it works well for me. Records with a @Builder
annotation no longer emit an error. "Document does not match AST" also remains fixed.
I built the branch and tested the new jar, the errors disappeared. |
- Base version projectlombok/lombok@94b01e4 along with unmerged fix from projectlombok/lombok#3888 Signed-off-by: Roland Grunberg <[email protected]>
- Base version projectlombok/lombok@94b01e4 along with unmerged fix from projectlombok/lombok#3888 Signed-off-by: Roland Grunberg <[email protected]>
- Base version projectlombok/lombok@94b01e4 along with unmerged fix from projectlombok/lombok#3888 Signed-off-by: Roland Grunberg <[email protected]>
- Base version projectlombok/lombok@94b01e4 along with unmerged fix from projectlombok/lombok#3888 Signed-off-by: Roland Grunberg <[email protected]>
The problem still occurs if you you do custom constructor field validation for your record:
I downloaded lombok-edge.jar today as well as I tried the lombok-1.18.39-4050.jar. Fails with both. I'm using Spring Tools For Eclipse 4.31.0 which is using Eclipse JDT 3.20.200.v20250528-1830. |
Hello! Dear @Rawi01 just cloned this branch, run
|
@vkushnir-onseo This branch should generate a build of version 1.18.39. You either built the wrong branch or made a mistake in your eclipse setup. Rather than building it yourself, you can also download the artifact from the GitHub Actions run. (https://github.com/projectlombok/lombok/actions/runs/15284242422?pr=3888) |
@Rawi01 thanks a lot it works! |
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.
@Rawi01 Without spending some time delving into why we added 'hey if you see TerminalToken being loaded, apply this patch' is no longer needed – trying to get a grip on why we can simply the fixing of dom.rewrite.TokenScanner
. Can you confirm we no longer need it / OSGI check takes care of it?
For context: Up to ~3 months ago, this fix was only applied if we witnessed TerminalToken. 3 months ago, this was updated to 'either if you see any OSGI signs or if you see TerminalToken, apply it' and now we've arrived at: "If you see any OSGI signs, apply it. Don't worry about TerminalToken".
EDIT: Hmm, not sure github makes it possible to see what this is referring to. It's about commit 'Use simpler addScriptIfWitness', 98d980d.
@rzwitserloot I think that commit was related to #3885 (comment) . Upstream replaces |
This PR fixes #3883
Eclipse changed how they handle records. Instead of generating fields early on it now does it in a later stage. To keep the support in lombok we now map the record components to fields ourself and add theses fields to our AST. To keep the test output the same I added a patch that removes the implicit fields from the output if they are present.