Do not suggest -Xuse...=kotlin.Experimental in experimental world
This commit is contained in:
@@ -47,7 +47,13 @@ class MakeModuleExperimentalFix(
|
||||
val facet = KotlinFacet.get(module) ?: return true
|
||||
val facetSettings = facet.configuration.settings
|
||||
val compilerSettings = facetSettings.compilerSettings ?: return true
|
||||
return compilerArgument !in compilerSettings.additionalArgumentsAsList
|
||||
return if (annotationFqName != ExperimentalUsageChecker.EXPERIMENTAL_FQ_NAME) {
|
||||
compilerArgument !in compilerSettings.additionalArgumentsAsList
|
||||
} else {
|
||||
compilerSettings.additionalArgumentsAsList.none {
|
||||
it.startsWith("-Xuse-experimental=") || it.startsWith("-Xexperimental=")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object : KotlinSingleIntentionActionFactory() {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Add '-Xuse-experimental=kotlin.Experimental' to module light_idea_test_case compiler arguments" "false"
|
||||
// COMPILER_ARGUMENTS: -version -Xuse-experimental=Something
|
||||
// DISABLE-ERRORS
|
||||
// WITH_RUNTIME
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make private
|
||||
|
||||
@Experimental<caret>
|
||||
annotation class MyExperimentalAPI
|
||||
@@ -6062,6 +6062,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
||||
runTest("idea/testData/quickfix/experimental/classUseExperimental.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doNotSwitchOn.kt")
|
||||
public void testDoNotSwitchOn() throws Exception {
|
||||
runTest("idea/testData/quickfix/experimental/doNotSwitchOn.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionInLocalClass.kt")
|
||||
public void testFunctionInLocalClass() throws Exception {
|
||||
runTest("idea/testData/quickfix/experimental/functionInLocalClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user