mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[Java. Code Formatting] Fix typo for whitespace option "Inside block braces when body is presented"
IDEA-270369 GitOrigin-RevId: cce77ef8ec80c45622f6707c9671ac5a774763f8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8481472230
commit
3ae38b4cff
@@ -131,7 +131,7 @@ public class JavaCodeStyleSettings extends CustomCodeStyleSettings implements Im
|
||||
public boolean SPACE_BEFORE_COLON_IN_FOREACH = true;
|
||||
public boolean SPACE_INSIDE_ONE_LINE_ENUM_BRACES = false;
|
||||
|
||||
public boolean SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENTED = false;
|
||||
public boolean SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENT = false;
|
||||
public boolean NEW_LINE_WHEN_BODY_IS_PRESENTED = false;
|
||||
|
||||
public boolean useFqNamesInJavadocAlways() {
|
||||
|
||||
@@ -97,8 +97,8 @@ public final class JavaLanguageCodeStyleSettingsProvider extends LanguageCodeSty
|
||||
consumer.showCustomOption(JavaCodeStyleSettings.class, "SPACE_INSIDE_ONE_LINE_ENUM_BRACES", JavaBundle.message(
|
||||
"checkbox.spaces.inside.one.line.enum"), groupName);
|
||||
|
||||
consumer.showCustomOption(JavaCodeStyleSettings.class, "SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENTED",
|
||||
JavaBundle.message("checkbox.spaces.inside.block.braces.when.body.is.presented"), groupName);
|
||||
consumer.showCustomOption(JavaCodeStyleSettings.class, "SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENT",
|
||||
JavaBundle.message("checkbox.spaces.inside.block.braces.when.body.is.present"), groupName);
|
||||
|
||||
consumer.showCustomOption(JavaCodeStyleSettings.class, "SPACE_BEFORE_DECONSTRUCTION_LIST", JavaBundle.message(
|
||||
"checkbox.spaces.before.deconstruction.list"), getInstance().SPACES_BEFORE_PARENTHESES);
|
||||
|
||||
@@ -924,7 +924,7 @@ public final class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
else if (myRole1 == ChildRole.LBRACE) {
|
||||
int spacesAfterLBrace;
|
||||
if (myRole2 == ChildRole.RBRACE) spacesAfterLBrace = mySettings.SPACE_WITHIN_BRACES ? 1 : 0;
|
||||
else spacesAfterLBrace = mySettings.SPACE_WITHIN_BRACES || myJavaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENTED ? 1 : 0;
|
||||
else spacesAfterLBrace = mySettings.SPACE_WITHIN_BRACES || myJavaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENT ? 1 : 0;
|
||||
|
||||
if (!keepInOneLine) {
|
||||
int blankLines = 1;
|
||||
@@ -946,7 +946,7 @@ public final class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
}
|
||||
}
|
||||
else if (myRole2 == ChildRole.RBRACE) {
|
||||
int spacesBeforeRBrace = mySettings.SPACE_WITHIN_BRACES || myJavaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENTED ? 1 : 0;
|
||||
int spacesBeforeRBrace = mySettings.SPACE_WITHIN_BRACES || myJavaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENT ? 1 : 0;
|
||||
if (!keepInOneLine) {
|
||||
myResult = Spacing.createSpacing(
|
||||
spacesBeforeRBrace, spacesBeforeRBrace, 1, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_BEFORE_RBRACE);
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
"spaces_around_shift_operators": true,
|
||||
"spaces_around_type_bounds_in_type_parameters": true,
|
||||
"spaces_around_unary_operator": false,
|
||||
"spaces_inside_block_braces_when_body_is_presented": false,
|
||||
"spaces_inside_block_braces_when_body_is_present": false,
|
||||
"spaces_within_angle_brackets": false,
|
||||
"spaces_within_annotation_parentheses": false,
|
||||
"spaces_within_array_initializer_braces": false,
|
||||
|
||||
@@ -11,8 +11,8 @@ class SimpleCodeBlockSpacesTest : AbstractJavaFormatterTest() {
|
||||
}
|
||||
|
||||
|
||||
fun `test should add spaces inside braces when block body is presented`() {
|
||||
javaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENTED = true
|
||||
fun `test should add spaces inside braces when block body is present`() {
|
||||
javaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENT = true
|
||||
doTextTest(
|
||||
"""
|
||||
class A {
|
||||
@@ -41,7 +41,7 @@ class SimpleCodeBlockSpacesTest : AbstractJavaFormatterTest() {
|
||||
|
||||
|
||||
fun `test should not add spaces inside braces when block body is empty`() {
|
||||
javaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENTED = true
|
||||
javaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENT = true
|
||||
doTextTest(
|
||||
"""
|
||||
class A {
|
||||
@@ -68,7 +68,7 @@ class SimpleCodeBlockSpacesTest : AbstractJavaFormatterTest() {
|
||||
}
|
||||
|
||||
fun `test should not add spaces inside braces when block body is present and option is disabled`() {
|
||||
javaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENTED = false
|
||||
javaSettings.SPACES_INSIDE_BLOCK_BRACES_WHEN_BODY_IS_PRESENT = false
|
||||
doTextTest(
|
||||
"""
|
||||
class A {
|
||||
|
||||
@@ -103,7 +103,7 @@ checkbox.prefer.longer.names=Prefer longer names
|
||||
checkbox.preserve.line.feeds=Preserve line feeds
|
||||
checkbox.spaces.record.header=Record header
|
||||
checkbox.spaces.within.deconstruction.list=Deconstruction list
|
||||
checkbox.spaces.inside.block.braces.when.body.is.presented=Inside block braces when body is presented
|
||||
checkbox.spaces.inside.block.braces.when.body.is.present=Inside block braces when body is present
|
||||
checkbox.spaces.before.colon.in.foreach=Before colon in foreach
|
||||
checkbox.spaces.before.deconstruction.list=Deconstruction list
|
||||
checkbox.spaces.inside.one.line.enum=Inside one line enum braces
|
||||
|
||||
Reference in New Issue
Block a user