Revert "Implicit exhaustive when annotation / highlighting"

This reverts commit 0cc09872b6.
This commit is contained in:
Mikhail Glukhikh
2016-02-12 17:51:21 +03:00
parent d344b5b991
commit 3049961b9a
8 changed files with 1 additions and 39 deletions
@@ -108,7 +108,6 @@ options.kotlin.attribute.descriptor.variable.as.function.like.call=Variable as f
options.kotlin.attribute.descriptor.smart.cast=Smart-cast value
options.kotlin.attribute.descriptor.smart.constant=Smart constant
options.kotlin.attribute.descriptor.smart.cast.receiver=Smart-cast implicit receiver
options.kotlin.attribute.descriptor.implicit.exhaustive.when=Implicitly exhaustive when
options.kotlin.attribute.descriptor.label=Label
migrate.sure=Replace sure() calls by !! in project
migrate.class.object.to.companion=Replace 'class' keyword with 'companion' modifier
@@ -85,7 +85,6 @@ public class KotlinHighlightingColors {
public static final TextAttributesKey SMART_CAST_VALUE = createTextAttributesKey("KOTLIN_SMART_CAST_VALUE");
public static final TextAttributesKey SMART_CONSTANT = createTextAttributesKey("KOTLIN_SMART_CONSTANT");
public static final TextAttributesKey SMART_CAST_RECEIVER = createTextAttributesKey("KOTLIN_SMART_CAST_RECEIVER");
public static final TextAttributesKey IMPLICIT_EXHAUSTIVE_WHEN = createTextAttributesKey("KOTLIN_IMPLICIT_EXHAUSTIVE_WHEN");
public static final TextAttributesKey LABEL = createTextAttributesKey("KOTLIN_LABEL");
public static final TextAttributesKey DEBUG_INFO = createTextAttributesKey("KOTLIN_DEBUG_INFO");
public static final TextAttributesKey RESOLVED_TO_ERROR = createTextAttributesKey("KOTLIN_RESOLVED_TO_ERROR");
@@ -110,15 +110,6 @@ class VariablesHighlightingVisitor extends AfterAnalysisHighlightingVisitor {
.setTextAttributes(KotlinHighlightingColors.SMART_CAST_VALUE);
}
if (expression instanceof KtWhenExpression) {
KtWhenExpression whenExpression = (KtWhenExpression) expression;
boolean implicitExhaustiveWhen = bindingContext.get(IMPLICIT_EXHAUSTIVE_WHEN, whenExpression) == Boolean.TRUE;
if (implicitExhaustiveWhen) {
holder.createInfoAnnotation(whenExpression.getWhenKeyword(), "When is implicitly exhaustive")
.setTextAttributes(KotlinHighlightingColors.IMPLICIT_EXHAUSTIVE_WHEN);
}
}
super.visitExpression(expression);
}
@@ -40,11 +40,6 @@
<option name="BACKGROUND" value="223c23" />
</value>
</option>
<option name="KOTLIN_IMPLICIT_EXHAUSTIVE_WHEN">
<value>
<option name="BACKGROUND" value="0321ab" />
</value>
</option>
<option name="KOTLIN_LABEL">
<value>
<option name="FOREGROUND" value="467cda" />
@@ -40,11 +40,6 @@
<option name="BACKGROUND" value="dbffdb" />
</value>
</option>
<option name="KOTLIN_IMPLICIT_EXHAUSTIVE_WHEN">
<value>
<option name="BACKGROUND" value="d3faf8" />
</value>
</option>
<option name="KOTLIN_LABEL">
<value>
<option name="FOREGROUND" value="4a86e8" />
@@ -63,17 +63,13 @@ class KotlinColorSettingsPage : ColorSettingsPage {
}
}
fun Int?.bar(): Int {
fun Int?.bar() {
if (this != null) {
println(<SMART_CAST_RECEIVER>toString</SMART_CAST_RECEIVER>())
}
else {
println(<SMART_CONSTANT>this</SMART_CONSTANT>.toString())
}
<IMPLICIT_EXHAUSTIVE_WHEN>when</IMPLICIT_EXHAUSTIVE_WHEN> (this != null) {
true -> return 1
false -> return 0
}
}
var <PROPERTY_WITH_BACKING_FIELD><PACKAGE_PROPERTY><MUTABLE_VARIABLE>globalCounter</MUTABLE_VARIABLE></PACKAGE_PROPERTY></PROPERTY_WITH_BACKING_FIELD> : Int = 5
@@ -161,7 +157,6 @@ var <PROPERTY_WITH_BACKING_FIELD><PACKAGE_PROPERTY><MUTABLE_VARIABLE>globalCount
KotlinBundle.message("options.kotlin.attribute.descriptor.smart.cast") to KotlinHighlightingColors.SMART_CAST_VALUE,
KotlinBundle.message("options.kotlin.attribute.descriptor.smart.constant") to KotlinHighlightingColors.SMART_CONSTANT,
KotlinBundle.message("options.kotlin.attribute.descriptor.smart.cast.receiver") to KotlinHighlightingColors.SMART_CAST_RECEIVER,
KotlinBundle.message("options.kotlin.attribute.descriptor.implicit.exhaustive.when") to KotlinHighlightingColors.IMPLICIT_EXHAUSTIVE_WHEN,
KotlinBundle.message("options.kotlin.attribute.descriptor.label") to KotlinHighlightingColors.LABEL)
}
-6
View File
@@ -1,6 +0,0 @@
fun foo(b: Boolean): Int {
<info descr="When is implicitly exhaustive">when</info> (b) {
true -> return 1
false -> return 0
}
}
@@ -850,12 +850,6 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
doTestWithInfos(fileName);
}
@TestMetadata("WhenImplicitExhaustive.kt")
public void testWhenImplicitExhaustive() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/infos/WhenImplicitExhaustive.kt");
doTestWithInfos(fileName);
}
@TestMetadata("WrapIntoRef.kt")
public void testWrapIntoRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/infos/WrapIntoRef.kt");