eclipse / lsp4jakarta

Language Server for Jakarta EE
Eclipse Public License 2.0
33 stars 51 forks source link

org.eclipse.lsp4jakarta.commons.JavaCursorContextKind.forValue() throws an IllegalArgumentException when passed the value from its own NONE constant. #520

Open mrglavas opened 6 months ago

mrglavas commented 6 months ago

This was discovered while testing completion support in Liberty Tools for IntelliJ. See discussion here: https://github.com/OpenLiberty/liberty-tools-intellij/issues/681. The problem is that the forValue() method assumes that all of the values are 1 more than their regular enum ordinal value which is true for all of the constants except for NONE whose value is 2000.

mrglavas commented 6 months ago

Since JavaCursorContextKind is a copy of an enum class that is also in LSP4MP, LSP4MP also has this issue.