eclipse-jdt / eclipse-jdt/eclipse.jdt.core

organize import does not work any more on lombok classes "val" or annotations

Open
#108 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

Hi,

"Ctrl+O" (organize import) does not work any more on lombok classes "val" or annotations, while upgrading eclipse to 2022-06 (4.24)
Build id: I20220525-1800

It used to work fine.. (and it is a BLOCKER for coding without it)

example of scenarios
```
val ls = new ArrayList(); // <= val is special class from Lombok... should be importable as "import lombok.val;"
// currently no import, so compile error currently
// press "Ctrl+O" => nothing happens
// expected to insert "import lombok.val;", and compile error to disapear
```

Another scenario:
```
@RequiredArgsConstructor // not imported yet ... should be importable as "import lombok.RequiredArgsConstructor;"
// press "Ctrl+O" => nothing happens
// expected to insert "import lombok.RequiredArgsConstructor;", and compile error to disapear
public class Foo {
public final int value; // <= current compile error... need RequiredArgsConstructor
}
```

Notice that other plain old import works fine
```
List ls = new ArrayList(); // not import yet
// ... press "Ctrl+O" => OK, both "import java.util.List;" + "import java.util.ArrayList;" are added
```

I have lombok.jar locally, downloaded from https://projectlombok.org/download
(currently in version 1.18.24)

My java project is a maven project, with dependencies
```

org.projectlombok
lombok
1.18.24
provided

```

In my eclipse.ini, there is
```
-vmargs
-javaagent:C:\apps\eclipse\lombok.jar
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Xms512m
-Xmx2048m
--add-modules=ALL-SYSTEM
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dsun.java.command=Eclipse
-XX:+UseG1GC
-XX:+UseStringDeduplication
```

Tell me if you can reproduce or need more info

Thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.