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

Editor Error Highlighting And Fix Suggestions Not works on v1.29.0 #3579

Closed
bgunduz55 opened this issue Apr 17, 2024 · 8 comments
Closed

Editor Error Highlighting And Fix Suggestions Not works on v1.29.0 #3579

bgunduz55 opened this issue Apr 17, 2024 · 8 comments

Comments

@bgunduz55
Copy link

When I update the extension 1.29.0 version, editor's error detection, highlight and suggestions not working.
Everything is fine after downgrade the version.

Environment
  • Operating System: Linux Mint
  • JDK version: 21
  • Visual Studio Code version: 1.88.1
  • Java extension version: 1.29.0
Additional Informations

I'm using vscode from flatpak. But looks that's not the case.

@rgrunber
Copy link
Member

rgrunber commented Apr 17, 2024

Is your project a Maven/Gradle project ? Does the project target Java 21 while having Java preview features enabled in the build configuration ? Any chance you'd be able to share the project ?

@bgunduz55
Copy link
Author

Project is private. Maven project.
Targets Java 21:
image
Also current JAVA_HOME:
image
Preview Features enabled:
image

@snjeza
Copy link
Contributor

snjeza commented Apr 18, 2024

@bgunduz55 Could you try to set the project target to Java 22?

@rgrunber
Copy link
Member

I think you're facing the same issue as eclipse-jdtls/eclipse.jdt.ls#3131 . In 1.29.0, we added support for Java 22, and the --enable-preview flag is only supported for the latest Java version.

As @snjeza just mentioned, if you change the compiler compliance to 22 or leave it as is and remove the --enable-preview flag, does the issue go away ?

@bgunduz55
Copy link
Author

Looks, that's the issue. I just tried remove --enable-preview and it worked on latest version.
I'll try changing compiler target version as 22 too, when I'm available.
Thanks for help @rgrunber @snjeza .
Is that normal to not use enable preview on 21 for this?

@snjeza
Copy link
Contributor

snjeza commented Apr 18, 2024

Is that normal to not use enable preview on 21 for this?

Yes, it is when using VS Code 1.29.0

@rgrunber
Copy link
Member

It has always been the case that preview feature support can only be used against the latest supported Java version (ie. 22) by the extension. https://bugs.eclipse.org/bugs/show_bug.cgi?id=549258#c11 also gives an explanation of this (and that to follow the JEP, one cannot allow --enable-preview to work except for the latest supported Java version.

I'm guessing this is just a lot more visible now because Java 21 is LTS. While before, people had no issues with updating to the latest release level to continue the 2nd/3rd/.. preview of feature , or consume it after it graduates to a standard feature, now users might wish to stay on the Java 21 LTS.

@fbricon
Copy link
Collaborator

fbricon commented Apr 19, 2024

Also documented in https://github.com/redhat-developer/vscode-java/wiki/Enabling-Java-preview-features

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

No branches or pull requests

4 participants