Admittedly I couldn't figure out exactly what repo is being used for Java's syntax highlighting since vendor/README.md says Java is using tree-sitter/tree-sitter-java and grammar.js in that repo appeears to already include references to record.
languages.yml [1] shows ace_mode java, and ace editor's java_highlight_rules.js doesn't mention record anywhere. I'm not clear if github is using ace editor or code mirror, since both are mentioned there.
Hopefully this helps get started on improving the poor syntax highlighting experience.
[0] https://github.com/github/linguist/blob/master/CONTRIBUTING....
[1] https://github.com/github/linguist/blob/c34f887f48d81e2ed42b...
[2] https://github.com/ajaxorg/ace/blob/a2e89b94b4dcdff28bf3c8f4...
And if you consider the history of Java as a language since the 1990's, it has historically had very slow feature releases. If you review the release history of Java, almost half of major relases and changes to the language came after 2014+. var in Java came out in 2018, record was introduced out in 2020 - feaures that were copied from other languages that already had them for years. Java as a language is still is playing catchup here.
It's a feature, not a bug.
And as a side note: LSPs are not exactly free these days anymore. Java is not considering it core project (I guess outsourced to RedHat and Eclipse) and Microsoft has a very erratic behavior towards what is in and out the LSP or DAP.
I wonder how long it will be before they realize they are in the slow, sad, decline regardless of how many features get added.
There is quite a lot of legacy software that uses Java though.
But:
1. The enterprise users aren't spending their time chasing java versions, and probably already gave up and have a support contract with Azul or someone, or just stick with an unsupported versions.
This is why all the cloud vendors, for example, either have such deals, or provide their own guarantee of support.
So they almost certainly do not care about Java 20 anytime soon unless they are in the weird category of "serious java shop" (rather than legacy java shop), which is quickly shrinking. That is not a big enough class that people will "try to keep up" to frame it in the java-centric version used by GP.
2. The non-enterprise users are also a shrinking base.