diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeStyle/GroovyLanguageCodeStyleSettingsProvider.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeStyle/GroovyLanguageCodeStyleSettingsProvider.java index ab26e68ff8d5..bbeb15b49e4f 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeStyle/GroovyLanguageCodeStyleSettingsProvider.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeStyle/GroovyLanguageCodeStyleSettingsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -223,8 +223,9 @@ public class GroovyLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSe "SPACE_BEFORE_ANOTATION_PARAMETER_LIST", "SPACE_WITHIN_ANNOTATION_PARENTHESES" ); - consumer.showCustomOption(GroovyCodeStyleSettings.class, "SPACE_IN_NAMED_ARGUMENT", "In named argument after ':'", - CodeStyleSettingsCustomizable.SPACES_OTHER); + consumer.renameStandardOption("SPACE_AROUND_RELATIONAL_OPERATORS", "Relational operators (<, >, <=, >=, <=>)"); + + consumer.showCustomOption(GroovyCodeStyleSettings.class, "SPACE_IN_NAMED_ARGUMENT", "In named argument after ':'", CodeStyleSettingsCustomizable.SPACES_OTHER); consumer.showCustomOption(GroovyCodeStyleSettings.class, "SPACE_WITHIN_LIST_OR_MAP", "List and maps literals", CodeStyleSettingsCustomizable.SPACES_WITHIN); consumer.showCustomOption(GroovyCodeStyleSettings.class, "SPACE_BEFORE_CLOSURE_LBRACE", "Closure left brace in method calls", CodeStyleSettingsCustomizable.SPACES_BEFORE_LEFT_BRACE); consumer.showCustomOption(GroovyCodeStyleSettings.class, "SPACE_WITHIN_GSTRING_INJECTION_BRACES", "GString injection braces", CodeStyleSettingsCustomizable.SPACES_WITHIN); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/models/spacing/SpacingTokens.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/models/spacing/SpacingTokens.java index f786f3167b8d..9dde8fff5625 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/models/spacing/SpacingTokens.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/models/spacing/SpacingTokens.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public interface SpacingTokens extends GroovyElementTypes { TokenSet LOGICAL_OPERATORS = TokenSet.create(mLAND, mLOR); TokenSet EQUALITY_OPERATORS = TokenSet.create(mEQUAL, mNOT_EQUAL); - TokenSet RELATIONAL_OPERATORS = TokenSet.create(mGT, mGE, mLT, mLE); + TokenSet RELATIONAL_OPERATORS = TokenSet.create(mGT, mGE, mLT, mLE, mCOMPARE_TO); TokenSet BITWISE_OPERATORS = TokenSet.create(mBAND, mBOR, mBXOR); TokenSet ADDITIVE_OPERATORS = TokenSet.create(mPLUS, mMINUS); TokenSet MULTIPLICATIVE_OPERATORS = TokenSet.create(mSTAR, mDIV, mMOD); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy index f31fa1461810..a7ded292fefa 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ public class FormatterTest extends GroovyFormatterTestCase { public void testArg2() throws Throwable { doTest(); } public void testBin1() throws Throwable { doTest(); } public void testBin2() throws Throwable { doTest(); } + public void testBin3() throws Throwable { doTest(); } public void testBlockExpr1() throws Throwable { //groovySettings.KEEP_CONTROL_STATEMENT_IN_ONE_LINE = false groovySettings.KEEP_SIMPLE_BLOCKS_IN_ONE_LINE = false diff --git a/plugins/groovy/testdata/groovy/formatter/bin3.test b/plugins/groovy/testdata/groovy/formatter/bin3.test new file mode 100644 index 000000000000..bb943d5cfb62 --- /dev/null +++ b/plugins/groovy/testdata/groovy/formatter/bin3.test @@ -0,0 +1,3 @@ +a<=>b +----- +a <=> b \ No newline at end of file