lsp4j icon indicating copy to clipboard operation
lsp4j copied to clipboard

[Proposal] - Migrate Project to Java 21

Open mamilic opened this issue 1 year ago • 6 comments

I would like to propose migrating the project to Java 21. The latest LTS release offers several new features and improvements that could benefit the project. I was wondering if such migration is feasable from technical point?

mamilic avatar Oct 17 '24 13:10 mamilic

We use LSP4J inside LSP4IJ https://github.com/redhat-developer/lsp4ij and IntelliJ doesn't require Java 21. For IntelliJ context I think it is a bad idea.

angelozerr avatar Oct 17 '24 14:10 angelozerr

We just went to Java 11 last year in #707 - the discussion leading up to that showed resistance to even consider Java 17 (see conversation in #547).

I am not against ever upgrading, but this is a core library with few dependencies and not much active development. If you can identify what Java 21 features you and the community would benefit from I am willing to discuss further.

Of course our main contributors/consumers would have to be ok with it too, in addition to @angelozerr's comment, xtext is high on that list.

jonahgraham avatar Oct 17 '24 15:10 jonahgraham

Hmm. We are just about to bump to 17 … Besides that there is no j21 support in xtend gradle without workaround yet

cdietrich avatar Oct 17 '24 15:10 cdietrich

OpenJDK 11 is already EOL, so upgrading to Java 17 makes sense, especially as NetBeans (22+), IntelliJ (2022.3+), and Eclipse (2022-09+) now require it. Jumping to Java 21 for a core library like lsp4j seems premature and would limit adoption.

sebthom avatar Dec 19 '24 18:12 sebthom

several new features and improvements that could benefit the project

Which one do you have in mind specifically?

szarnekow avatar Dec 19 '24 18:12 szarnekow

several new features and improvements that could benefit the project

Which one do you have in mind specifically?

@szarnekow Not the OP, but since migrating from Java 11 to 17, I’ve been enjoying enhanced instanceof, switch expressions, records, and text blocks in LSP4E and TM4E. The improved NPE messages with context have been especially helpful, particularly in CI builds.

sebthom avatar Dec 19 '24 18:12 sebthom