ReSharper Platform SDK
 
Because ReSharper Platform SDK undefined is still in development, this documentation may not be entirely accurate and is subject to change.

Extended HTML Parsing

Last modified: 04 July 2023

Custom HTML-like languages can modify the lexing of standard HTML by providing an alternative HTML lexer to the constructor of HtmlCompoundLexer (typically a new instance of HtmlLexerFactory is passed).

However, it is not currently possible to extend the lexing/parsing of standard HTML files, or the standard HTML portions of custom files such as WebForms or Razor, from third party code. An example of this would be to add support for custom templates inside the language, such as Angular's interpolation expressions:

This kind of syntax can be supported by third party code using existing extension mechanisms. For example, if the syntax is simple enough, this could be implemented by References and Daemon support for highlighters. If the expression is more complex, it can also be implemented by using Injected PSI, although this is not very efficient, as the content of the nodes are converted to and from strings on modification. There are also limitations on nested injections. It is best to only use injected PSI for small ranges.