From 03b039b302ce95f4bd01c6f999152b29e687e975 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Tue, 11 Jun 2013 13:49:09 +0400 Subject: [PATCH] Fixed the default Kotlin CodeStyle. By default add space before colon when it placed between types (inheritance, type constraint, type parameter). Added example of inheritance to the Sample. --- .../jetbrains/jet/plugin/formatter/JetCodeStyleSettings.java | 2 +- .../formatter/JetLanguageCodeStyleSettingsProvider.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/formatter/JetCodeStyleSettings.java b/idea/src/org/jetbrains/jet/plugin/formatter/JetCodeStyleSettings.java index 58758cd4790..b5a2d2d40c6 100644 --- a/idea/src/org/jetbrains/jet/plugin/formatter/JetCodeStyleSettings.java +++ b/idea/src/org/jetbrains/jet/plugin/formatter/JetCodeStyleSettings.java @@ -28,7 +28,7 @@ public class JetCodeStyleSettings extends CustomCodeStyleSettings { public boolean SPACE_BEFORE_TYPE_COLON = false; public boolean SPACE_AFTER_TYPE_COLON = true; - public boolean SPACE_BEFORE_EXTEND_COLON = false; + public boolean SPACE_BEFORE_EXTEND_COLON = true; public boolean SPACE_AFTER_EXTEND_COLON = true; public boolean INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD = true; diff --git a/idea/src/org/jetbrains/jet/plugin/formatter/JetLanguageCodeStyleSettingsProvider.java b/idea/src/org/jetbrains/jet/plugin/formatter/JetLanguageCodeStyleSettingsProvider.java index 7a2f6d30066..c57784aab50 100644 --- a/idea/src/org/jetbrains/jet/plugin/formatter/JetLanguageCodeStyleSettingsProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/formatter/JetLanguageCodeStyleSettingsProvider.java @@ -57,7 +57,7 @@ public class JetLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSetti "}"; default: return - "class Some {\n" + + "open class Some {\n" + " private val f = {(a: Int)->a*2}\n" + " fun foo() : Int {\n" + " val test : Int = 12\n" + @@ -66,7 +66,8 @@ public class JetLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSetti " private fun foo2():Int where T : List {\n" + " return 0\n" + " }\n" + - "}"; + "}\n\n" + + "class AnotherClass: Some"; } }