Description
[Opening an issue for a problem discovered while discussing #20 .]
Template strings allow expressions in string and strings to nest. For instance:
`a${1+2}b`
equals "a3b"
. And since expressions can be strings, then this is valid:
`a${`b`}c`
and equals "abc"
Problematic areas:
-
The highlighter fails to handle anything in
${}
as an expression. (Trying the same in plain JS code:js-mode
is just as broken astypescript-mode
.js2-mode
, however, handles it fine.) -
typescript--re-search-backward-inner
completely ignores expressions in strings or the fact that strings can nest. Same fortypescript--re-search-forward-inner
. These are used for movement across syntactic features and for indentation. -
syntax-ppss
, which is also used for movement across syntactic features and for indentation, ignores string nesting.js2-mode
appears to have solved the issue though because I get meaningful results from checking the values ofsyntax-ppss
in nested strings in a JS file withjs2-mode
.
There may be yet other problematic areas I've not identified.