eclipse.jdt.ls icon indicating copy to clipboard operation
eclipse.jdt.ls copied to clipboard

Inform clients when Preview support enabled for an incompatible version.

Open rgrunber opened this issue 10 months ago • 3 comments

  • Fixes #3131

rgrunber avatar Apr 19 '24 19:04 rgrunber

I'm thinking about how should the client side deal with this notification? It makes things clearer than only log it in the log file. However, users might still have no idea what should they do after receiving this notification?

jdneo avatar May 07 '24 08:05 jdneo

IMO, the expectation of end-users is that preview flags just get silently ignored when they're not targeting latest version and that they shouldn't bother with them. It's the pattern we've seen in mulitple place in JDT and the Javac incubator.

mickaelistria avatar May 07 '24 08:05 mickaelistria

At least for vscode-java, I have a client-side PR (local) that catches the event notification (like we do for incompatible Gradle + JDK versions) and shows the error message : "Preview features enabled at an invalid source release level ..., preview can be enabled only at source level ...", and a link to the build configuration file to change it.

Particularly on https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/3131#issuecomment-2053657155 , if the clients do nothing with it, at least more is logged, at least until we properly address https://github.com/redhat-developer/vscode-java/issues/1111 (disappearing errors when text document opened, if coming from workspace diagnostic handler).

~~As for Mickael's suggestion of ignoring, I kind of like it except for the fact that we're opening ourselves up for users to later complain that "preview features don't work".~~ Eclipse doesn't actually silently ignored the error though. If you force preview features, it will complain : https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/3131#issuecomment-2052259822

rgrunber avatar May 07 '24 14:05 rgrunber