public interface FormattingDocumentModel
FormattingModel.getDocumentModel()| Modifier and Type | Method and Description |
|---|---|
java.lang.CharSequence |
adjustWhiteSpaceIfNecessary(java.lang.CharSequence whiteSpaceText,
int startOffset,
int endOffset,
ASTNode nodeAfter,
boolean changedViaPsi)
There is a possible case that white space to apply should be additionally adjusted because of formatter processing.
|
boolean |
containsWhiteSpaceSymbolsOnly(int startOffset,
int endOffset)
Allows to answer if all document symbols from
[startOffset; endOffset) region are treated as white spaces by formatter. |
Document |
getDocument() |
int |
getLineNumber(int offset)
Returns the line number corresponding to the specified offset in the document.
|
int |
getLineStartOffset(int line)
Returns the offset corresponding to the start of the specified line in the document.
|
java.lang.CharSequence |
getText(TextRange textRange)
Returns the text contained in the specified text range of the document.
|
int |
getTextLength()
Returns the length of the entire document text.
|
int getLineNumber(int offset)
offset - the offset for which the line number is requested.int getLineStartOffset(int line)
line - the line number for which the offset is requested.java.lang.CharSequence getText(TextRange textRange)
textRange - the text range for which the text is requested.int getTextLength()
Document getDocument()
boolean containsWhiteSpaceSymbolsOnly(int startOffset,
int endOffset)
[startOffset; endOffset) region are treated as white spaces by formatter.startOffset - target start document offset (inclusive)endOffset - target end document offset (exclusive)true if all document symbols from [startOffset; endOffset) region are treated
as white spaces by formatter; false otherwisejava.lang.CharSequence adjustWhiteSpaceIfNecessary(java.lang.CharSequence whiteSpaceText,
int startOffset,
int endOffset,
ASTNode nodeAfter,
boolean changedViaPsi)
'\' symbol at multi-line expression.
Current method adjusts given white space text if necessary.whiteSpaceText - white space text to use by defaultstartOffset - start offset of the document text that is intended to be replaced by the given white space text (inclusive)endOffset - end offset of the document text that is intended to be replaced by the given white space text (exclusive)nodeAfter - the AST node following the block, if knownchangedViaPsi - flag that identifies whether formatter introduces changes via PSI tree or directly via the document[startOffset; endOffset) region