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

Eclipse removes "import lombok.var;" on Organize imports #1783

Closed
ghost opened this issue Jul 18, 2018 · 4 comments
Closed

Eclipse removes "import lombok.var;" on Organize imports #1783

ghost opened this issue Jul 18, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 18, 2018

In Eclipse, the action "Source / Organize Imports" removes import lombok.var;, leading to compile errors when var is used. The "Do not create imports for types starting with a lowercase letter" parameter of the "Organize imports" settings has no effect on the problem. This problem occurs also indirectly when Organize Imports is used in Save Actions.

Seen with Eclipse Photon (4.8.0) and Lombok 1.18.0. If I remember well, this problem existed with the previous version of Eclispe.

Code used for tests :

import lombok.var;

public class VarImportTest {
    public static void main(String[] args) {
        var myVar = "Foo";
        System.out.println(myVar);
    }
}
@victorwss
Copy link
Contributor

What is your Java version? Hopefully this is not an issue for Java >= 10. But for Java 6-9, pretty much it is.

@ghost
Copy link
Author

ghost commented Jul 23, 2018

Java 8 (jre1.8.0_172)

@rzwitserloot
Copy link
Collaborator

reproduced, with:

  • Eclipse Version: Photon Release (4.8.0) Build id: 20180619-1200
  • Lombok v1.18.1 "Edgy Guinea Pig" - 2018-07-02 is installed. https://projectlombok.org/
  • Project configured for j1.8 release.

@rzwitserloot
Copy link
Collaborator

NB: You don't need save actions for this, just hit the 'organize imports' shortcut key and the import poofs out of existence.

rzwitserloot added a commit that referenced this issue Jul 25, 2018
… be removed by eclipse’s organize imports.
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

2 participants