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

Use supplied -javaagent param for lombok #253

Merged

Conversation

xodder
Copy link
Contributor

@xodder xodder commented Apr 12, 2023

Fix #240

What was noticed

The addLombokParam function does the resolution of the lombokJarPath. It does this by first scanning through the supplied params and removing any of the param that starts with -javaagent and ends with .jar. These are the javaagent declarations that are being made using "java.jdt.ls.vmargs" - the ones supplied by the user.

After this, the lomboxJarPath is resolved from the workspaceState here (looks hairy sort of). If that fails, it fallbacks to the extension's own lombok def, which in the real sense was not packaged with the extension, as it's meant to be located at {project}/lombok/lombok.jar.

So basically, the fallback does not exist and the one in the workspaceState does not exist either, meanwhile, the one supplied by the user using "java.jdt.ls.vmargs" has been thrown away. It wasn't even considered at all.

What was done

If perhaps a user has supplied a -javaagent param in "java.jdt.ls.vmargs", look through the ones that has been marked for deletion and cache the last one before deleting them.

Then try resolving from workspaceState (don't really know what that does, as the statement itself looks somewhat hairy @here), if that fails, extract the jar path from the user-supplied path and try resolving that. If it fails too, fallback to the extension's own lombok.

@chemzqm chemzqm merged commit 55b14dd into neoclide:master Sep 19, 2023
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

Successfully merging this pull request may close these issues.

Could not find lombok.jar path
2 participants