Revert "Implicit exhaustive when annotation / highlighting"
This reverts commit 0cc09872b6.
This commit is contained in:
@@ -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.cast=Smart-cast value
|
||||||
options.kotlin.attribute.descriptor.smart.constant=Smart constant
|
options.kotlin.attribute.descriptor.smart.constant=Smart constant
|
||||||
options.kotlin.attribute.descriptor.smart.cast.receiver=Smart-cast implicit receiver
|
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
|
options.kotlin.attribute.descriptor.label=Label
|
||||||
migrate.sure=Replace sure() calls by !! in project
|
migrate.sure=Replace sure() calls by !! in project
|
||||||
migrate.class.object.to.companion=Replace 'class' keyword with 'companion' modifier
|
migrate.class.object.to.companion=Replace 'class' keyword with 'companion' modifier
|
||||||
|
|||||||
-1
@@ -85,7 +85,6 @@ public class KotlinHighlightingColors {
|
|||||||
public static final TextAttributesKey SMART_CAST_VALUE = createTextAttributesKey("KOTLIN_SMART_CAST_VALUE");
|
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_CONSTANT = createTextAttributesKey("KOTLIN_SMART_CONSTANT");
|
||||||
public static final TextAttributesKey SMART_CAST_RECEIVER = createTextAttributesKey("KOTLIN_SMART_CAST_RECEIVER");
|
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 LABEL = createTextAttributesKey("KOTLIN_LABEL");
|
||||||
public static final TextAttributesKey DEBUG_INFO = createTextAttributesKey("KOTLIN_DEBUG_INFO");
|
public static final TextAttributesKey DEBUG_INFO = createTextAttributesKey("KOTLIN_DEBUG_INFO");
|
||||||
public static final TextAttributesKey RESOLVED_TO_ERROR = createTextAttributesKey("KOTLIN_RESOLVED_TO_ERROR");
|
public static final TextAttributesKey RESOLVED_TO_ERROR = createTextAttributesKey("KOTLIN_RESOLVED_TO_ERROR");
|
||||||
|
|||||||
-9
@@ -110,15 +110,6 @@ class VariablesHighlightingVisitor extends AfterAnalysisHighlightingVisitor {
|
|||||||
.setTextAttributes(KotlinHighlightingColors.SMART_CAST_VALUE);
|
.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);
|
super.visitExpression(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,6 @@
|
|||||||
<option name="BACKGROUND" value="223c23" />
|
<option name="BACKGROUND" value="223c23" />
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
<option name="KOTLIN_IMPLICIT_EXHAUSTIVE_WHEN">
|
|
||||||
<value>
|
|
||||||
<option name="BACKGROUND" value="0321ab" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="KOTLIN_LABEL">
|
<option name="KOTLIN_LABEL">
|
||||||
<value>
|
<value>
|
||||||
<option name="FOREGROUND" value="467cda" />
|
<option name="FOREGROUND" value="467cda" />
|
||||||
|
|||||||
@@ -40,11 +40,6 @@
|
|||||||
<option name="BACKGROUND" value="dbffdb" />
|
<option name="BACKGROUND" value="dbffdb" />
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
<option name="KOTLIN_IMPLICIT_EXHAUSTIVE_WHEN">
|
|
||||||
<value>
|
|
||||||
<option name="BACKGROUND" value="d3faf8" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="KOTLIN_LABEL">
|
<option name="KOTLIN_LABEL">
|
||||||
<value>
|
<value>
|
||||||
<option name="FOREGROUND" value="4a86e8" />
|
<option name="FOREGROUND" value="4a86e8" />
|
||||||
|
|||||||
@@ -63,17 +63,13 @@ class KotlinColorSettingsPage : ColorSettingsPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Int?.bar(): Int {
|
fun Int?.bar() {
|
||||||
if (this != null) {
|
if (this != null) {
|
||||||
println(<SMART_CAST_RECEIVER>toString</SMART_CAST_RECEIVER>())
|
println(<SMART_CAST_RECEIVER>toString</SMART_CAST_RECEIVER>())
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
println(<SMART_CONSTANT>this</SMART_CONSTANT>.toString())
|
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
|
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.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.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.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)
|
KotlinBundle.message("options.kotlin.attribute.descriptor.label") to KotlinHighlightingColors.LABEL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
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")
|
@TestMetadata("WrapIntoRef.kt")
|
||||||
public void testWrapIntoRef() throws Exception {
|
public void testWrapIntoRef() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/infos/WrapIntoRef.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/infos/WrapIntoRef.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user