The original logic uses three different patterns to match an enum constant field. This PR replaces them with a two-scope uniform pattern.
Alternate Designs
To solve #211, an alternative would be to add another to match (constructor + code overrides), but it introduces too much duplicate code, and it still cannot highlight correctly when '{' is placed at new line.
Benefits
Can correctly highlight with all possible combinations of constructor & code overrides
Can correctly highlight when '{' is placed at new line or with a comment in between
Description of the Change
The original logic uses three different patterns to match an enum constant field. This PR replaces them with a two-scope uniform pattern.
Alternate Designs
To solve #211, an alternative would be to add another to match (constructor + code overrides), but it introduces too much duplicate code, and it still cannot highlight correctly when '{' is placed at new line.
Benefits
Possible Drawbacks
Applicable Issues
Fix #211 Fix redhat-developer/vscode-java#974