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

[BUG] Syntax highlighting for lombok annotations is broken #2509

Closed
humphreygao opened this issue Jul 3, 2020 · 7 comments
Closed

[BUG] Syntax highlighting for lombok annotations is broken #2509

humphreygao opened this issue Jul 3, 2020 · 7 comments
Milestone

Comments

@humphreygao
Copy link

Describe the bug
In Eclipse IDE, syntax coloring for some lombok annotations(such as @Data@Slf4j@ToString@EqualsAndHashCode) are not correct.

To Reproduce

  1. Install Eclipse lombok plug-in.
  2. Via Window > Preferences > Java > Editor > Syntax Coloring, choose the Java > Annotations from preference page and change the color of annotations(for example, orange).

lombok annotation color

Version info (please complete the following information):

  • Lombok version: 1.18.12
  • Platform: Eclipse IDE 2020-06
@Rawi01
Copy link
Collaborator

Rawi01 commented Jul 4, 2020

I can not reproduce this issue.
img
Can you check if there is an error message? (Window > Show View > Error Log)

@janrieke
Copy link
Contributor

janrieke commented Jul 4, 2020

I have seen similar things, and I think it dates back to at least lombok 1.18.2 and older eclipse versions. However, I was unable to identify a common pattern or a way to reproduce.

@rspilker
Copy link
Collaborator

rspilker commented Jul 4, 2020

Probably some of the positions of the generated AST nodes are off. We've also seen similar problems with @Cleanup, but have not yet put time in it to find the wrong positions yet

@humphreygao
Copy link
Author

@Rawi01 There is no error.

My computer OS is Windows 10. The syntax coloring is correct before the plugin was installed. You can try annotations one by one to see which annotation's color is wrong. When there are several annotations, some annotation's color may be okay(in the picture, @Data and @ToString is okay but not okay when they are alone).

Sometimes move the annotations up and down(using Alt + Up/Down shortcut) may affect the annotation color.

@Rawi01
Copy link
Collaborator

Rawi01 commented Jul 4, 2020

Interesting, I know that this can happen if there are errors.

I just tried it using a new eclipse version + lombok 1.18.12 and it works as expected.

@rzwitserloot
Copy link
Collaborator

I'm going to guess that this is either fixed or at least got a lot bitter via @Rawi01's PR (#2984).

@JoseLion
Copy link

@rzwitserloot I think this has improved, but I'm still seeing issues with annotations like @Value, @With, and @Builder.

Here are some screenshots that could shed some light 🙂

image
image
image
image

I hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants