Skip to content
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

CodeInlays shows up next to Lombok annotations #2323

Closed
gayanper opened this issue Nov 14, 2022 · 5 comments · Fixed by #2330
Closed

CodeInlays shows up next to Lombok annotations #2323

gayanper opened this issue Nov 14, 2022 · 5 comments · Fixed by #2330
Assignees
Labels

Comments

@gayanper
Copy link
Contributor

gayanper commented Nov 14, 2022

image

This happens for other type of annotations which ends up generating code which could result inlays.
@jdneo
Copy link
Contributor

jdneo commented Nov 15, 2022

There are two approaches that may fix this problem.

The first one is to check the field $isGenerated
image

Which can also be found in lombok project itself: https://github.com/projectlombok/lombok/blob/70bda546114ceccc7714bd6060d96edbcd25e3a0/src/eclipseAgent/lombok/launch/PatchFixesHider.java#L395

But this might not work for other code generation though.

Another thought is to compare the node length with real expression's length. Not ideal enough but should be able to fix most cases.
image

@gayanper
Copy link
Contributor Author

I tried running with remote server mode. But the lombox doesn't kick in, do i need to do any classpath changes to the ls launcher ?

@gayanper
Copy link
Contributor Author

Found it, need to add the lombok agent into the launcher

@jdneo
Copy link
Contributor

jdneo commented Nov 16, 2022

Personally, I prefer to check $isGenerated for this lombok specific case. If there are more cases found in the future, we can try some other approach.

@gayanper
Copy link
Contributor Author

Not sure if just checking for $isGenerated field on the JDT ASTNode is enough or should the other logics in the mentioned class must be done as well.

gayanper added a commit to gayanper/eclipse.jdt.ls that referenced this issue Nov 16, 2022
gayanper added a commit to gayanper/eclipse.jdt.ls that referenced this issue Nov 16, 2022
@jdneo jdneo linked a pull request Nov 17, 2022 that will close this issue
@jdneo jdneo added this to the End November milestone Nov 17, 2022
gayanper added a commit to gayanper/eclipse.jdt.ls that referenced this issue Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants