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

Lexer Factories

Last modified: 04 July 2023

ReSharper requires a custom language to implement ILexerFactory, which is exposed via IProjectFileLanguageService.GetMixedLexerFactory and the LanguageService.GetPrimaryLexerFactory abstract method.

The lexer factory is assigned to the IFile root node of the PSI tree, via the IFileImpl interface, which exposes implementation details rather than PSI tree information. This is made available so that various parts of ReSharper can easily create a fresh lexer on a new buffer.

This class is usually trivial to implement, simply returning a new instance of a class that implements the ILexer interface.

The IBuffer interface is an abstraction of a text based buffer that a lexer uses to get the contents of the file (persistent or in-memory). See the guide on Text Buffers for more details.