Enum not correctly hightlighted when mixed with constructor and code overrides
Closed this issue · 1 comments
Vigilans commented
Description
Originally created in redhat-developer/vscode-java#974 by @orblazer :
Hello,
The color of first item when the enum overwrite is wrongEnvironment
- Operating System: Windows 10
- JDK version: jdk1.8.0_212
- Visual Studio Code version: 1.35.1
- Java extension version: 0.46.0
Steps To Reproduce
- Create an enum with function
- Override that function in enum items
[attach a sample project reproducing the error]
attach logsCurrent Result
Expected Result
Additional Informations
The path for color is different :
I think the path for the
current result
is right bug its just parsing is broken.
Vigilans commented
The problem is infact caused by the overly restricted rules specified in syntax file
Currently, the enum syntax will try to match three patterns:
- pure enum's constant field
- constant field with constructor
- constant field with code overrides
But when constructor and code overrides are applied on a field at the same time, the pattern matching fails, just as follows: