Added hint url for coroutines and multiplatform diagnostics.
This commit is contained in:
@@ -19,13 +19,13 @@ package org.jetbrains.kotlin.config
|
|||||||
import org.jetbrains.kotlin.config.LanguageVersion.KOTLIN_1_1
|
import org.jetbrains.kotlin.config.LanguageVersion.KOTLIN_1_1
|
||||||
import org.jetbrains.kotlin.utils.DescriptionAware
|
import org.jetbrains.kotlin.utils.DescriptionAware
|
||||||
|
|
||||||
enum class LanguageFeature(val sinceVersion: LanguageVersion?) {
|
enum class LanguageFeature(val sinceVersion: LanguageVersion?, val hintUrl: String? = null) {
|
||||||
// Note: names of these entries are also used in diagnostic tests and in user-visible messages (see presentableText below)
|
// Note: names of these entries are also used in diagnostic tests and in user-visible messages (see presentableText below)
|
||||||
TypeAliases(KOTLIN_1_1),
|
TypeAliases(KOTLIN_1_1),
|
||||||
BoundCallableReferences(KOTLIN_1_1),
|
BoundCallableReferences(KOTLIN_1_1),
|
||||||
LocalDelegatedProperties(KOTLIN_1_1),
|
LocalDelegatedProperties(KOTLIN_1_1),
|
||||||
TopLevelSealedInheritance(KOTLIN_1_1),
|
TopLevelSealedInheritance(KOTLIN_1_1),
|
||||||
Coroutines(KOTLIN_1_1),
|
Coroutines(KOTLIN_1_1, "https://kotlinlang.org/docs/diagnostics/experimental-coroutines"),
|
||||||
AdditionalBuiltInsMembers(KOTLIN_1_1),
|
AdditionalBuiltInsMembers(KOTLIN_1_1),
|
||||||
DataClassInheritance(KOTLIN_1_1),
|
DataClassInheritance(KOTLIN_1_1),
|
||||||
InlineProperties(KOTLIN_1_1),
|
InlineProperties(KOTLIN_1_1),
|
||||||
@@ -42,17 +42,19 @@ enum class LanguageFeature(val sinceVersion: LanguageVersion?) {
|
|||||||
SafeCallBoundSmartCasts(KOTLIN_1_1),
|
SafeCallBoundSmartCasts(KOTLIN_1_1),
|
||||||
|
|
||||||
// Experimental features
|
// Experimental features
|
||||||
MultiPlatformProjects(null),
|
MultiPlatformProjects(null, "https://kotlinlang.org/docs/diagnostics/experimental-multitraget-projects"),
|
||||||
MultiPlatformDoNotCheckImpl(null),
|
MultiPlatformDoNotCheckImpl(null),
|
||||||
|
|
||||||
WarnOnCoroutines(null),
|
WarnOnCoroutines(null),
|
||||||
ErrorOnCoroutines(null)
|
ErrorOnCoroutines(null)
|
||||||
;
|
;
|
||||||
|
|
||||||
val presentableText: String
|
val presentableName: String
|
||||||
// E.g. "DestructuringLambdaParameters" -> ["Destructuring", "Lambda", "Parameters"] -> "destructuring lambda parameters"
|
// E.g. "DestructuringLambdaParameters" -> ["Destructuring", "Lambda", "Parameters"] -> "destructuring lambda parameters"
|
||||||
get() = name.split("(?<!^)(?=[A-Z])".toRegex()).joinToString(separator = " ", transform = String::toLowerCase)
|
get() = name.split("(?<!^)(?=[A-Z])".toRegex()).joinToString(separator = " ", transform = String::toLowerCase)
|
||||||
|
|
||||||
|
val presentableText get() = if (hintUrl == null) presentableName else "$presentableName (See: $hintUrl)"
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun fromString(str: String) = values().find { it.name == str }
|
fun fromString(str: String) = values().find { it.name == str }
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// !DIAGNOSTICS_NUMBER: 1
|
||||||
|
// !DIAGNOSTICS: UNSUPPORTED_FEATURE
|
||||||
|
// !MESSAGE_TYPE: TEXT
|
||||||
|
|
||||||
|
impl fun test() {}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<!-- urlMultiproject1 -->
|
||||||
|
The feature is experimental and should be turned on explicitly via a command line option or in IDE settings: multi platform projects (See: https://kotlinlang.org/docs/diagnostics/experimental-multitraget-projects)
|
||||||
@@ -317,4 +317,10 @@ public class DiagnosticMessageTestGenerated extends AbstractDiagnosticMessageTes
|
|||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/diagnosticMessage/upperBoundViolatedInTypeAliasConstructorCall.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/diagnosticMessage/upperBoundViolatedInTypeAliasConstructorCall.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("urlMultiproject.kt")
|
||||||
|
public void testUrlMultiproject() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/diagnosticMessage/urlMultiproject.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user