mplushnikov / lombok-intellij-plugin

Lombok Plugin for IntelliJ IDEA
Apache License 2.0
3.11k stars 635 forks source link

The static method generate using @Value(staticConstructor = "of") isn't correctly resolved by IntelliJ #1173

Closed dano closed 1 year ago

dano commented 1 year ago

Short description

When I use @Value(staticConstructor = "of") to generate a static factory, IntelliJ only partially understands its there. It shows up in the "Structure" view, and even shows up as an auto-complete suggestion on the class, but when I actually use it, it gets red text and claims "Cannot resolve method 'of' in 'MyClass'".

Expected behavior

IntelliJ should be able to resolve the factory method name

Version information

Steps to reproduce

What steps do we need to take to reproduce this issue?

  1. Create a class annotated with @Value(staticConstructor = "of")
  2. Call MyClass.of(<params>)
  3. Observe that IntelliJ says of can't be resolved.

image

image

image

I also want to note that appears to be a regression: this didn't happen on another project I just checked running Intellij 2022.3.2 RC with plugin version 223.8617.20. But when I updated IntelliJ to 2023.1 Beta (and the bundled Lombok plugin also updated), the problem appeared.

dano commented 1 year ago

Ah, I just realized this isn't the right place to report new issues! And it looks like the IntelliJ tracker already has something tracking this: https://youtrack.jetbrains.com/issue/IDEA-313324/Cannot-resolve-the-staticConstructor-of-Lombok-Value