scala-ide/scala-ide — pull request #356 by dnadolny (2013-03-19 02:56:40+00:00)
Title: Add highlighting for variables in interpolated strings

We pull the identifiers in `StringInterpolation` from SyntacticInfo, make sure
we're only marking variables (and not methods that are in an interpolated
string) in SymbolClassification, and then use the SymbolInfo in
HighlightingStyle.

The syntax preview can now render deprecated methods with strike-through.
Previously we were building a map of identifier to SyntaxClass and eventually
having it build the style from the SyntaxClass, but in real usage the
HighlightingStyle class does that using Position (and has logic for adding
strikethrough). Now we essentially build a Map of identifier to Position and we
call HighlightingStyle.

This also fixes deprecated method strike-through not being enabled unless
semantic highlighting was enabled for methods (half of ticket #1001584). In
TextPresentationEditorHighlighter we were only calling HighlightingStyle.style
if styling was enabled for that kind of token. Now we call it if the styling was
enabled or if the position says it should be styled, which is true when it is
either marked `deprecated` or `inInterpolatedString`, and HighlightingStyle will
do the right thing whether the style is enabled or not.

SyntaxColouringPreviewText uses a unicode trick to get different coloring for
the variables that are in interpolated strings. Variables that should show up as
in interpolated strings have a different name that looks the same, by using the
"Cyrillic lowercase a" in place of a normal "a". It looks the same, but is a
different character, so the Map[String, ColouringInfo] works. It would be nice
to not specify any of this at all and just compile the code and use normal
highlighting, but it would require having a scala project, compiler, etc all set
up just for previewing.

Re #1001574, Re #1001584