Fixed language server crashing because of wrong Lombok jar #2542
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
vscode-java: 1.8.0
running on macos with java 17 from zulu.
First time the workspace is opened, the extension detects that lombok is used and propose to reload. The subsequent execution will start the language server correctly using the right Lombok jar from the dependencies:
At the end of the project importation, the extension seems to pickup a wrong lombok jar and pops up a message saying that lombok version was changed from
1.18.24
toutils/1.18.12/lombok
. The language server is then unable to start:Following this error, the workspace is pretty much dead, and needs to be hard deleted.
The reason is that the regex used to find the lombok jar from the dependencies is too loose.
/lombok-.*\.jar/
matches bothlombok-1.18.24
andlombok-utils-1.18.12
. Dont ask me why we are usinglombok-utils
, i have no idea. Will look into that later.By having a more strict regex, ie
/lombok-\d+.*\.jar/
, we make sure we only matcheslombok-111-222-333.jar
, while not falling into really complicated semver matches (maybe that would be better?)Tested in my environment and this works fine. Please point me to the right way to add tests for this, if needed.
Thanks!.