syntax colouring failure

Some code like this

   new Clue( IN2, "data-bntrack-event=\"click\">$" ),
   new Clue( IN2, Pattern.compile( "itemprop=\"price\"[_
s*e" ) ),

The first string shows as green. The second as black. I expected both
to be green.

The Clue constructor is overloaded to accept String and Pattern. Code
seems to work fine.
Roedy Green Canadian Mind Products
Software gets slower faster than hardware gets faster.
~ Niklaus Wirth (born: 1934-02-15 age: 80) Wirth’s Law

1 comment
Comment actions Permalink

No failure. All is working as intended. In the second case, IDEA's IntelliLang feature sees the string as a regex pattern and applies Regex formatting (rather than String formatting) to it. You'll notice that it has a light green background by default. The actual color is set in Colors & Fonts > General > "Injected Language Fragment". Keep in mind that if you have the current line highlighting feature turned on, that will have a higher z order than the injected language background and you will not see the light green when your cursor is on that line.

IntelliLang will highlight any regex syntax errors or warning in the regex string. But if for some reason you do not want that, you can turn it off in the Language Injections in the settings, or disable the IntelliLang plugin.

See "IntelliLang" in the help guide (or the equivalent page on the webhelp site).


Please sign in to leave a comment.