Introduce unspecifiedJvmPlatform for clients without jvmTarget
Previously, a lot of clients used JvmPlatform as platform-marker, without thinking about jvmTarget. For the sake of migration, this commits introduced so-called UnspecifiedJvmPlatform, which can be used for a time being, but generally, all usages should be removed in future.
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ import org.jetbrains.kotlin.idea.test.SdkAndMockLibraryProjectDescriptor
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
|
||||
abstract class AbstractCompiledKotlinInJavaCompletionTest : KotlinFixtureCompletionBaseTestCase() {
|
||||
override fun getPlatform() = JvmPlatforms.defaultJvmPlatform
|
||||
override fun getPlatform() = JvmPlatforms.unspecifiedJvmPlatform
|
||||
|
||||
override fun getProjectDescriptor() =
|
||||
SdkAndMockLibraryProjectDescriptor(COMPLETION_TEST_DATA_BASE_PATH + "/injava/mockLib", false)
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ abstract class AbstractCompletionIncrementalResolveTest : KotlinLightCodeInsight
|
||||
}
|
||||
|
||||
testCompletion(FileUtil.loadFile(file, true),
|
||||
JvmPlatforms.defaultJvmPlatform,
|
||||
JvmPlatforms.unspecifiedJvmPlatform,
|
||||
{ completionType, count -> myFixture.complete(completionType, count) },
|
||||
additionalValidDirectives = listOf(TYPE_DIRECTIVE_PREFIX, BACKSPACES_DIRECTIVE_PREFIX))
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public abstract class AbstractJvmBasicCompletionTest extends KotlinFixtureComple
|
||||
@NotNull
|
||||
@Override
|
||||
public TargetPlatform getPlatform() {
|
||||
return JvmPlatforms.INSTANCE.getDefaultJvmPlatform();
|
||||
return JvmPlatforms.INSTANCE.getUnspecifiedJvmPlatform();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public abstract class AbstractJvmSmartCompletionTest extends KotlinFixtureComple
|
||||
@NotNull
|
||||
@Override
|
||||
public TargetPlatform getPlatform() {
|
||||
return JvmPlatforms.INSTANCE.getDefaultJvmPlatform();
|
||||
return JvmPlatforms.INSTANCE.getUnspecifiedJvmPlatform();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -21,6 +21,6 @@ abstract class AbstractJvmWithLibBasicCompletionTest : KotlinFixtureCompletionBa
|
||||
return SdkAndMockLibraryProjectDescriptor(TEST_PATH + "/" + getTestName(false) + "Src", false)
|
||||
}
|
||||
|
||||
override fun getPlatform() = JvmPlatforms.defaultJvmPlatform
|
||||
override fun getPlatform() = JvmPlatforms.unspecifiedJvmPlatform
|
||||
override fun defaultCompletionType() = CompletionType.BASIC
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.idea.test.KotlinProjectDescriptorWithFacet
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
|
||||
abstract class AbstractKeywordCompletionTest : KotlinFixtureCompletionBaseTestCase() {
|
||||
override fun getPlatform() = JvmPlatforms.defaultJvmPlatform
|
||||
override fun getPlatform() = JvmPlatforms.unspecifiedJvmPlatform
|
||||
|
||||
override fun defaultCompletionType() = CompletionType.BASIC
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractKotlinSourceInJavaCompletionTest : KotlinFixtureCompletionBaseTestCase() {
|
||||
override fun getPlatform() = JvmPlatforms.defaultJvmPlatform
|
||||
override fun getPlatform() = JvmPlatforms.unspecifiedJvmPlatform
|
||||
|
||||
override fun doTest(testPath: String) {
|
||||
val mockPath = RELATIVE_COMPLETION_TEST_DATA_BASE_PATH + "/injava/mockLib"
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescrip
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
|
||||
abstract class AbstractKotlinStdLibInJavaCompletionTest : KotlinFixtureCompletionBaseTestCase() {
|
||||
override fun getPlatform() = JvmPlatforms.defaultJvmPlatform
|
||||
override fun getPlatform() = JvmPlatforms.unspecifiedJvmPlatform
|
||||
override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||
override fun defaultCompletionType() = CompletionType.BASIC
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ abstract class AbstractMultiFileJvmBasicCompletionTest : KotlinCompletionTestCas
|
||||
configureByFile(getTestName(false) + ".kt", "")
|
||||
val shouldFail = testPath.contains("NoSpecifiedType")
|
||||
AstAccessControl.testWithControlledAccessToAst(shouldFail, getFile().getVirtualFile(), getProject(), getTestRootDisposable(), {
|
||||
testCompletion(file.text, JvmPlatforms.defaultJvmPlatform, { completionType, invocationCount ->
|
||||
testCompletion(file.text, JvmPlatforms.unspecifiedJvmPlatform, { completionType, invocationCount ->
|
||||
setType(completionType)
|
||||
complete(invocationCount)
|
||||
myItems
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ abstract class AbstractMultiFileSmartCompletionTest : KotlinCompletionTestCase()
|
||||
protected fun doTest(testPath: String) {
|
||||
configureByFile(getTestName(false) + ".kt", "")
|
||||
AstAccessControl.testWithControlledAccessToAst(false, getFile().getVirtualFile(), getProject(), getTestRootDisposable(), {
|
||||
testCompletion(file.text, JvmPlatforms.defaultJvmPlatform, { completionType, invocationCount ->
|
||||
testCompletion(file.text, JvmPlatforms.unspecifiedJvmPlatform, { completionType, invocationCount ->
|
||||
setType(completionType)
|
||||
complete(invocationCount)
|
||||
myItems
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ object ExpectedCompletionUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private val UNSUPPORTED_PLATFORM_MESSAGE = "Only ${JvmPlatforms.defaultJvmPlatform} and ${JsPlatforms.defaultJsPlatform} platforms are supported"
|
||||
private val UNSUPPORTED_PLATFORM_MESSAGE = "Only ${JvmPlatforms.unspecifiedJvmPlatform} and ${JsPlatforms.defaultJsPlatform} platforms are supported"
|
||||
|
||||
private val EXIST_LINE_PREFIX = "EXIST:"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user