E
- entry typepublic interface Rearranger<E extends ArrangementEntry>
Modifier and Type | Field and Description |
---|---|
static LanguageExtension<Rearranger<?>> |
EXTENSION |
Modifier and Type | Method and Description |
---|---|
int |
getBlankLines(CodeStyleSettings settings,
E parent,
E previous,
E target)
Allows to answer how many blank lines should be inserted before the target arrangement entry which position is changed.
|
ArrangementSettingsSerializer |
getSerializer() |
java.util.List<E> |
parse(PsiElement root,
Document document,
java.util.Collection<TextRange> ranges,
ArrangementSettings settings)
Allows to build rearranger-interested data for the given element.
|
Pair<E,java.util.List<E>> |
parseWithNew(PsiElement root,
Document document,
java.util.Collection<TextRange> ranges,
PsiElement element,
ArrangementSettings settings)
Tries to wrap given element into arrangement entry at the target context.
|
static final LanguageExtension<Rearranger<?>> EXTENSION
Pair<E,java.util.List<E>> parseWithNew(PsiElement root, Document document, java.util.Collection<TextRange> ranges, PsiElement element, ArrangementSettings settings)
element
- element to wrap into format eligible for further processing by arrangement enginesettings
- arrangement settings to use. The primary idea is to make the rearranger aware about
grouping rules
(if any). E.g. it's not worth to process java method bodies
in order to build method dependency graph if no such grouping rule is definednull
otherwisejava.util.List<E> parse(PsiElement root, Document document, java.util.Collection<TextRange> ranges, ArrangementSettings settings)
root
- root element which children should be parsed for the rearrangementdocument
- document which corresponds to the target PSI treeranges
- target offsets ranges to use for filtering given root's childrensettings
- arrangement settings to use. The primary idea is to make the rearranger aware about
grouping rules
(if any). E.g. it's not worth to process java method bodies
in order to build method dependency graph if no such grouping rule is definedint getBlankLines(CodeStyleSettings settings, E parent, E previous, E target)
settings
- code style settings to use (it's assumed that returned result is derived from 'blank lines' code style settings)parent
- target entry's parent (if available)previous
- previous entry (if available)target
- target entry which blank lines number the caller is interested inArrangementSettingsSerializer getSerializer()
arrangement settings
.
Serializer is expected to be lazy and don't save
default settings
.
DefaultArrangementSettingsSerializer