com.intellij.openapi.fileTypes
Interface SyntaxHighlighter

All Known Implementing Classes:
PlainSyntaxHighlighter, SyntaxHighlighterBase

public interface SyntaxHighlighter

Controls the syntax highlighting of a file.

See Also:
Language.getSyntaxHighlighter(com.intellij.openapi.project.Project), FileType.getHighlighter(com.intellij.openapi.project.Project)

Method Summary
 Lexer getHighlightingLexer()
          Returns the lexer used for highlighing the file.
 TextAttributesKey[] getTokenHighlights(IElementType tokenType)
          Returns the list of text attribute keys used for highlighting the specified token type.
 

Method Detail

getHighlightingLexer

@NotNull
Lexer getHighlightingLexer()
Returns the lexer used for highlighing the file. The lexer is invoked incrementally when the file is changed, so it must be capable of saving/restoring state and resuming lexing from the middle of the file.

Returns:
The lexer implementation.

getTokenHighlights

@NotNull
TextAttributesKey[] getTokenHighlights(IElementType tokenType)
Returns the list of text attribute keys used for highlighting the specified token type. The attributes of all attribute keys returned for the token type are successively merged to obtain the color and attributes of the token.

Parameters:
tokenType - The token type for which the highlighting is requested.
Returns:
The array of text attribute keys.