Skip to content

lombok.config ignored in 1.14.0 #2887

Description

@FlipWarthog

After updating the extension to 1.14.0, my lombok.config file is being ignored, specifically the lombok.log.fieldName=LOG setting.

Environment
  • Operating System: Windows
  • JDK version: 14
  • Visual Studio Code version: 1.74.3
  • Java extension version: 1.14.0
Steps To Reproduce
  1. Extract attached project
  2. Running mvn clean package from the commandline succeeds
  3. Loading the project into vscode with the 1.14.0 extension shows the error

Sample reproducer:
vscode-java-issue.zip

Issue example:
vscode-java-issue

Current Result

vscode shows that LOG cannot be resolved to a variable, and log is not used.

Expected Result

lombok.config changes log to LOG so this error/warning combo should not be shown.

Additional Information

I did confirm that manually reverting back to 1.13.0 makes the issue go away.

Activity

  1. FlipWarthog commented on Jan 18, 2023

    @FlipWarthog
    Author

    Lombok Configuration reference: https://projectlombok.org/features/configuration

  2. schophil commented on Jan 18, 2023

    @schophil

    I have got the same issue with the @CustomLog annotation.

    Screenshot 2023-01-18 at 08 03 09

  3. vdkhvb commented on Jan 18, 2023

    @vdkhvb

    Can confirm, I got these issues as well (CustomLog annotation fails & renaming of log field is not applied). It all boils down to not processing the lombok.config file. Simply downgrading the plugin fixes the issue, whilst playing with the flag for disabling lombok support or picking the lombok jar doesn't help.

  4. snjeza commented on Jan 18, 2023

    @snjeza
    Collaborator
  5. FlipWarthog commented on Jan 19, 2023

    @FlipWarthog
    Author

    @snjeza Trying the jar provided and setting the javaagent param results in the same issue after updating to 1.14.0 of the extension. Not sure what 1.18.26 of Lombok is since it looks like the latest snapshot is only 1.18.25 (Note: even trying that Edge release from Lombok I'm still seeing the issue).

    And using any of these versions of Lombok with the 1.13.0 version of the extension shows it working properly, so I can't wrap my head around how it could be upstream?

  6. snjeza commented on Jan 19, 2023

    @snjeza
    Collaborator

    @FlipWarthog https://github.com/snjeza/vscode-test/raw/master/lombok-1.18.26.jar is a patched lombok jar.
    Could you try the following properties:

    "java.jdt.ls.lombokSupport.enabled": false,
    "java.jdt.ls.vmargs": " -javaagent:<path_to_lombok-1.18.26.jar> <your_arguments>",
    

    lombok4

    ... so I can't wrap my head around how it could be upstream?

    Eclipse JDT has been changed. The Eclipse ECJ plugin doesn't include the resources and runtime plugin - https://www.eclipse.org/eclipse/news/4.27/jdt.php#ecj-separated-from-core
    Java LS >= 0.14.0 uses Eclipse 4.27.
    It causes this issue with lombok. lombok-1.18.26 should fix it.

  7. FlipWarthog commented on Jan 19, 2023

    @FlipWarthog
    Author

    @snjeza Ahh, that worked and thank you for the clarification! Explicitly disabling loading from the project classpath was key, in addition to setting the javaagent to point to the patched version. Thanks, again.

  8. snjeza commented on Jan 19, 2023

    @snjeza
    Collaborator
  9. linked a pull request that will close this issueAdopt the lombok@1.18.27 edge release #3031on Mar 30, 2023
  10. removed this from the Early April 2023 milestone on Apr 13, 2023
  11. rgrunber commented on Apr 13, 2023

    @rgrunber
    Member

    Re-opening as we've reverted the change that fixed this due to potentially more serious issues with the lombok edge release. Hopefully we can fix these in subsequent release.

  12. added this to the End April 2023 milestone on Apr 13, 2023
  13. snjeza commented on Apr 15, 2023

    @snjeza
    Collaborator

    This issue hasn't been fixed properly.

    Steps to reproduce:

    You will get LOG cannot be resolved

    A workaround

    • open Test.java
    • call Developer: Reload Window
  14. jcolladosp commented on Apr 17, 2023

    @jcolladosp

    any update in this issue?

  15. Eskibear commented on Apr 17, 2023

    @Eskibear
    Contributor

    yes, I think. A fix in upstream has been released, see projectlombok/lombok#3406 (comment)

    Next step would be adopting #3031 again and give it a try on the coming pre-release. @jcolladosp you can keep an eye on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions