clojure-vim/clojure.vim

Fix syntax generation code for Java 11+

Closed this issue · 6 comments

axvr commented

Currently the syntax generation code only works on Java 8 (and below) as the latest JDK versions no longer contain some classes we used for reflection.

These missing classes are:

  • java.util.regex.Pattern$CharPropertyNames
  • java.util.regex.UnicodeProp

To fix this the reflection code needs replacing as there are no straightforward replacements for these classes.

I have already done some work on building the new reflection code.

Better to replace all the reflection accessing the private fields here. Some things can be found from public java properties, some might need to be retrieved from other sources.

At least most of unicode script/block aliases etc. can be retrieved from http://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt
(names should be public on Java classes, just aliases are private)

Java group names probably can be just hardcoded.

axvr commented

Sorry @Deraen, I've been meaning to get round to finishing this for a while, but I've been busy trying to complete another project. I should be able to start working on it (and clojure.vim in general) again in January 2021.

@axvr If it is okay for you, I might be interested in taking a stab at this myself?

axvr commented

Of course, go ahead.

If it helps, here is a link to the new reflection/grouping code I had been working on. It's in need of some cleaning up but it was working for me. https://gist.github.com/axvr/493da316b241c98a059fded5f024e75f

I didn't look into changing Clojure fn/macro etc. lists, I just replaced the reflection code in Regex properties part, PR open now.

axvr commented

Ah yes you're right, I misdiagnosed the issue as being both the fn/macro list generation and Unicode generation being broken on latest JDK.