Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
62fb060c
Commit
62fb060c
authored
6 years ago
by
Roman.Ivanov
Browse files
Options
Download
Email Patches
Plain Diff
Formatter: start dependant range for enums with {
parent
fa6581fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java
+7
-5
...tellij/psi/formatter/java/JavaSpacePropertyProcessor.java
with
7 additions
and
5 deletions
+7
-5
java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java
+
7
-
5
View file @
62fb060c
...
...
@@ -275,13 +275,15 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
}
private
void
createSpacingForEnumBraces
(
boolean
isLbrace
)
{
// Ignore comments in front of enum for dependent spacing
PsiElement
first
=
myParent
.
getFirstChild
();
while
(
first
instanceof
PsiDocComment
||
first
instanceof
PsiWhiteSpace
)
{
first
=
first
.
getNextSibling
();
ASTNode
node
=
myParent
.
getNode
().
findChildByType
(
JavaTokenType
.
LBRACE
);
final
int
startOffset
;
if
(
node
==
null
)
{
startOffset
=
myParent
.
getTextOffset
();
}
else
{
startOffset
=
node
.
getTextRange
().
getStartOffset
();
}
int
spaces
=
myJavaSettings
.
SPACE_INSIDE_ONE_LINE_ENUM_BRACES
?
1
:
0
;
TextRange
textRange
=
new
TextRange
(
first
.
getTex
tOffset
()
,
myParent
.
getTextRange
().
getEndOffset
());
TextRange
textRange
=
new
TextRange
(
star
tOffset
,
myParent
.
getTextRange
().
getEndOffset
());
int
blankLinesCount
=
isLbrace
?
mySettings
.
KEEP_BLANK_LINES_IN_DECLARATIONS
:
mySettings
.
KEEP_BLANK_LINES_BEFORE_RBRACE
;
myResult
=
Spacing
.
createDependentLFSpacing
(
spaces
,
spaces
,
textRange
,
mySettings
.
KEEP_LINE_BREAKS
,
blankLinesCount
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help