FIR IDE: ignore not passing highlighting tests
This commit is contained in:
+11
-2
@@ -14,9 +14,18 @@ abstract class AbstractFirHighlightingTest : AbstractHighlightingTest() {
|
|||||||
override fun isFirPlugin() = true
|
override fun isFirPlugin() = true
|
||||||
|
|
||||||
override fun checkHighlighting(fileText: String) {
|
override fun checkHighlighting(fileText: String) {
|
||||||
|
val doComparison = !InTextDirectivesUtils.isDirectiveDefined(myFixture.file.text, "IGNORE_FIR")
|
||||||
val checkInfos = !InTextDirectivesUtils.isDirectiveDefined(fileText, NO_CHECK_INFOS_PREFIX);
|
val checkInfos = !InTextDirectivesUtils.isDirectiveDefined(fileText, NO_CHECK_INFOS_PREFIX);
|
||||||
|
|
||||||
// warnings are not supported yet
|
try {
|
||||||
myFixture.checkHighlighting(/* checkWarnings= */ false, checkInfos, /* checkWeakWarnings= */ false)
|
// warnings are not supported yet
|
||||||
|
myFixture.checkHighlighting(/* checkWarnings= */ false, checkInfos, /* checkWeakWarnings= */ false)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
if (doComparison) throw e
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!doComparison) {
|
||||||
|
throw AssertionError("Looks like test is passing, please remove IGNORE_FIR")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
// EXPECTED_DUPLICATED_HIGHLIGHTING
|
// EXPECTED_DUPLICATED_HIGHLIGHTING
|
||||||
|
|
||||||
<info descr="null" textAttributesKey="KOTLIN_ANNOTATION">@Target</info>(<info descr="null" textAttributesKey="KOTLIN_CLASS">AnnotationTarget</info>.<info descr="null" textAttributesKey="KOTLIN_ENUM_ENTRY">CLASS</info>, <info descr="null" textAttributesKey="KOTLIN_CLASS">AnnotationTarget</info>.<info descr="null" textAttributesKey="KOTLIN_ENUM_ENTRY">EXPRESSION</info>)
|
<info descr="null" textAttributesKey="KOTLIN_ANNOTATION">@Target</info>(<info descr="null" textAttributesKey="KOTLIN_CLASS">AnnotationTarget</info>.<info descr="null" textAttributesKey="KOTLIN_ENUM_ENTRY">CLASS</info>, <info descr="null" textAttributesKey="KOTLIN_CLASS">AnnotationTarget</info>.<info descr="null" textAttributesKey="KOTLIN_ENUM_ENTRY">EXPRESSION</info>)
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
// EXPECTED_DUPLICATED_HIGHLIGHTING
|
// EXPECTED_DUPLICATED_HIGHLIGHTING
|
||||||
|
|
||||||
<info descr="null">data</info> class <info descr="null">Box</info>(val <info descr="null">v</info>: <info descr="null">Int</info>)
|
<info descr="null">data</info> class <info descr="null">Box</info>(val <info descr="null">v</info>: <info descr="null">Int</info>)
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
package testing
|
package testing
|
||||||
|
|
||||||
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">tst</info>(<info textAttributesKey="KOTLIN_PARAMETER">d</info>: <error><info>dynamic</info></error>) {
|
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">tst</info>(<info textAttributesKey="KOTLIN_PARAMETER">d</info>: <error><info>dynamic</info></error>) {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
package language_injection
|
package language_injection
|
||||||
|
|
||||||
<info descr="null">import</info> org.intellij.lang.annotations.<info descr="null">Language</info>
|
<info descr="null">import</info> org.intellij.lang.annotations.<info descr="null">Language</info>
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
class <info textAttributesKey="KOTLIN_CLASS">My</info>(val <info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">x</info>: <info textAttributesKey="KOTLIN_CLASS">Int</info>?)
|
class <info textAttributesKey="KOTLIN_CLASS">My</info>(val <info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">x</info>: <info textAttributesKey="KOTLIN_CLASS">Int</info>?)
|
||||||
|
|
||||||
fun <info textAttributesKey="KOTLIN_CLASS">My</info>?.<info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(): <info textAttributesKey="KOTLIN_CLASS">Int</info> {
|
fun <info textAttributesKey="KOTLIN_CLASS">My</info>?.<info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(): <info textAttributesKey="KOTLIN_CLASS">Int</info> {
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
// EXPECTED_DUPLICATED_HIGHLIGHTING
|
// EXPECTED_DUPLICATED_HIGHLIGHTING
|
||||||
|
|
||||||
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">fnType</info> : <info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">suspend</info> () -> <info textAttributesKey="KOTLIN_OBJECT">Unit</info> = {}
|
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">fnType</info> : <info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">suspend</info> () -> <info textAttributesKey="KOTLIN_OBJECT">Unit</info> = {}
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">weekYear</info> = java.util.<info textAttributesKey="KOTLIN_ABSTRACT_CLASS">Calendar</info>.<info textAttributesKey="KOTLIN_FUNCTION_CALL">getInstance</info>().<info textAttributesKey="KOTLIN_SYNTHETIC_EXTENSION_PROPERTY">weekYear</info>
|
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">weekYear</info> = java.util.<info textAttributesKey="KOTLIN_ABSTRACT_CLASS">Calendar</info>.<info textAttributesKey="KOTLIN_FUNCTION_CALL">getInstance</info>().<info textAttributesKey="KOTLIN_SYNTHETIC_EXTENSION_PROPERTY">weekYear</info>
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
|
|
||||||
val <error descr="Destructuring declarations are only allowed for local variables/values">(a, b)</error> by <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">lazy</error> { <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">Pair</error>(1, 2) }
|
val <error descr="Destructuring declarations are only allowed for local variables/values">(a, b)</error> by <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">lazy</error> { <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">Pair</error>(1, 2) }
|
||||||
val <error descr="Destructuring declarations are only allowed for local variables/values">(c, d)</error> = <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">run</error> { <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">Pair</error>(3, 4) }
|
val <error descr="Destructuring declarations are only allowed for local variables/values">(c, d)</error> = <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">run</error> { <error descr="[DEBUG] Reference is not resolved to anything, but is not marked unresolved">Pair</error>(3, 4) }
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
<error descr="[WRONG_MODIFIER_TARGET] Modifier 'open' is not applicable to 'top level function'"><info descr="null">open</info></error> <info descr="null">suspend</info> fun <info descr="null">f</info>() {}
|
<error descr="[WRONG_MODIFIER_TARGET] Modifier 'open' is not applicable to 'top level function'"><info descr="null">open</info></error> <info descr="null">suspend</info> fun <info descr="null">f</info>() {}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
|
|
||||||
@Deprecated(<error>)</error>
|
@Deprecated(<error>)</error>
|
||||||
fun foo() {}
|
fun foo() {}
|
||||||
@Deprecated(<error>false</error>)
|
@Deprecated(<error>false</error>)
|
||||||
|
|||||||
@@ -54,12 +54,20 @@ public abstract class AbstractHighlightingTest extends KotlinLightCodeInsightFix
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void withExpectedDuplicatedHighlighting(boolean expectedDuplicatedHighlighting, Runnable runnable) {
|
private void withExpectedDuplicatedHighlighting(boolean expectedDuplicatedHighlighting, Runnable runnable) {
|
||||||
if (!expectedDuplicatedHighlighting) {
|
if (!expectedDuplicatedHighlighting) {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpectedHighlightingData.expectedDuplicatedHighlighting(runnable);
|
try {
|
||||||
|
ExpectedHighlightingData.expectedDuplicatedHighlighting(runnable);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
if (isFirPlugin()) {
|
||||||
|
runnable.run();
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user