AtomMaterialUI/color-highlighter

Does not work when multiple colors are defined in the same string / value

Opened this issue · 1 comments

Describe the bug
Colors are not showing properly when 2 or more #color codes are defined in the same string / value inside xml

To Reproduce

  1. in xml, define <ColorOption colors="#fffff9d9 #ffbeedff #fffff9d9" displayName="THEME_0" id="0" />
  2. test

Expected Behavior
Each color hash with corresponding argb value should be highlighted

Environment

  • Windows 11
  • Android Studio Giraffe | 2022.3.1 Patch 3
  • 17.1.0

Screenshots
image

This demands a whole refactor of the project. Since currently the parser relies on tokens, and since a string is a single token, it will always color the whole string with the first value it encounters (or no value).

I need to think of a way to allow tokens to be splitted further, but this will need some rethinking and my time is limited, so...

If you have a better idea, I encourage you to help out!