Lombok issue with java code
Issue Type: Bug
Hi Team, I am often facing lombok no such method found exception in my VS code workspace. Its working sometimes and sometimes it does not.
Extension version: 0.9.9 VS Code version: Code 1.40.2 (f359dd69833dd8800b54d458f6d37ab7c78df520, 2019-11-25T14:54:45.096Z) OS version: Windows_NT x64 10.0.18362
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (4 x 2496) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off surface_control: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 7.86GB (2.96GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
我的处理办法是: 确保项目中引用的lombok.jar版本号 和 vscode-lombok插件中携带的lombok.jar版本号一致,就可以了。 比如当前 vscode-lombok插件中携带的lombok.jar版本号是1.18.10,我的项目使用1.16.22时,插件不起作用;更新项目中的lombok.jar到1.18.10版本后,就一切正常了。
As @qitian422 said, make sure you’re using the latest version of Lombok in your pom or gradle file
The "import lombok.Data" seems to not be able to detect the lombok.jar when using org.projectlombok:lombok:1.18.12 in gradle.
Version: 1.44.0 Commit: 2aae1f26c72891c399f860409176fe435a154b13 Date: 2020-04-08T11:22:13.689Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Linux x64 5.0.0-38-generic snap
I was able to fix this by changing the gradle import from compileOnly 'org.projectlombok:lombok:1.18.12' to compile group: 'org.projectlombok', name: 'lombok', version: 1.18.12