bobbylight / RSyntaxTextArea

A syntax highlighting, code folding text editor for Java Swing applications.
BSD 3-Clause "New" or "Revised" License
1.12k stars 259 forks source link

Differentiate multiple "internal" token types from single TokenTypes #563

Open siggemannen opened 4 months ago

siggemannen commented 4 months ago

Hello, i have been using some custom TokenMaker that parses some code and spits out a list of tokens which are then converted to RSTA's internal TokenTypes. Now, i have a need when calling getTokenListForLine to differentiate the tokens returned, for example: 'string' and N'nstring' in sql are both TokenType.LITERAL_CHAR, but i want to know if the string is nationalized or not.

This is not needed for painting things differently but rather when doing auto-completion etc, i need to get the "detailed" token types somehow. Is there a good way to do it, i don't see anything useful in TokenImpl and i'd rather not start subclassing that either, but perhaps it's the only choice?