public interface FormattingModelBuilder
For certain aspects of the custom formatting to work properly, it is recommended to use TokenType.WHITE_SPACE
as the language's whitespace tokens. See ParserDefinition
Modifier and Type | Method and Description |
---|---|
FormattingModel |
createModel(PsiElement element,
CodeStyleSettings settings)
Requests building the formatting model for a section of the file containing
the specified PSI element and its children.
|
default TextRange |
getRangeAffectingIndent(PsiFile file,
int offset,
ASTNode elementAtOffset)
Returns the TextRange which should be processed by the formatter in order to calculate the
indent for a new line when a line break is inserted at the specified offset.
|
FormattingModel createModel(PsiElement element, CodeStyleSettings settings)
element
- the top element for which formatting is requested.settings
- the code style settings used for formatting.default TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset)
file
- the file in which the line break is inserted.offset
- the line break offset.elementAtOffset
- the parameter at offset