public interface ExternalFormatProcessor
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<ExternalFormatProcessor> |
EP_NAME |
Modifier and Type | Method and Description |
---|---|
static ExternalFormatProcessor |
activeExternalFormatProcessor(PsiFile source) |
boolean |
activeForFile(PsiFile source) |
default void |
createConfiguration(Project project) |
static java.util.Optional<ExternalFormatProcessor> |
findExternalFormatter(java.lang.String externalFormatterId) |
TextRange |
format(PsiFile source,
TextRange range,
boolean canChangeWhiteSpacesOnly,
boolean keepLineBreaks)
Formats the range in a source file.
|
static PsiElement |
formatElement(PsiElement elementToFormat,
TextRange range,
boolean canChangeWhiteSpacesOnly) |
static TextRange |
formatRangeInFile(PsiFile source,
TextRange range,
boolean canChangeWhiteSpacesOnly,
boolean keepLineBreaks) |
java.lang.String |
getId() |
java.lang.String |
indent(PsiFile source,
int lineStartOffset)
Indents the line.
|
static java.lang.String |
indentLine(PsiFile source,
int lineStartOffset)
Indents the line.
|
static boolean |
useExternalFormatter(PsiFile source) |
static final ExtensionPointName<ExternalFormatProcessor> EP_NAME
boolean activeForFile(PsiFile source)
source
- the source file with codeTextRange format(PsiFile source, TextRange range, boolean canChangeWhiteSpacesOnly, boolean keepLineBreaks)
source
- the source file with coderange
- the range for formattingcanChangeWhiteSpacesOnly
- procedure can change only whitespacesjava.lang.String indent(PsiFile source, int lineStartOffset)
source
- the source file with codelineStartOffset
- the offset of the indented linedefault void createConfiguration(Project project)
java.lang.String getId()
static boolean useExternalFormatter(PsiFile source)
source
- the source file with codestatic java.util.Optional<ExternalFormatProcessor> findExternalFormatter(java.lang.String externalFormatterId)
externalFormatterId
- the unique id for external formatterstatic ExternalFormatProcessor activeExternalFormatProcessor(PsiFile source)
static java.lang.String indentLine(PsiFile source, int lineStartOffset)
source
- the source file with codelineStartOffset
- the offset of the indented linestatic TextRange formatRangeInFile(PsiFile source, TextRange range, boolean canChangeWhiteSpacesOnly, boolean keepLineBreaks)
source
- the source file with coderange
- the range for formattingcanChangeWhiteSpacesOnly
- procedure can change only whitespacesstatic PsiElement formatElement(PsiElement elementToFormat, TextRange range, boolean canChangeWhiteSpacesOnly)
elementToFormat
- the element from code filerange
- the range for formattingcanChangeWhiteSpacesOnly
- procedure can change only whitespaces