Consistent naming: common platform is common, not default
This commit is contained in:
@@ -21,7 +21,7 @@ import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.roots.libraries.PersistentLibraryKind
|
||||
import org.jetbrains.kotlin.analyzer.AnalyzerFacade
|
||||
import org.jetbrains.kotlin.analyzer.common.DefaultAnalyzerFacade
|
||||
import org.jetbrains.kotlin.analyzer.common.CommonAnalyzerFacade
|
||||
import org.jetbrains.kotlin.builtins.DefaultBuiltIns
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.config.KotlinFacetSettingsProvider
|
||||
@@ -107,10 +107,10 @@ class JsPlatformSupport : IdePlatformSupport() {
|
||||
|
||||
class CommonPlatformSupport : IdePlatformSupport() {
|
||||
override val platform: TargetPlatform
|
||||
get() = TargetPlatform.Default
|
||||
get() = TargetPlatform.Common
|
||||
|
||||
override val analyzerFacade: AnalyzerFacade
|
||||
get() = DefaultAnalyzerFacade
|
||||
get() = CommonAnalyzerFacade
|
||||
|
||||
override val libraryKind: PersistentLibraryKind<*>?
|
||||
get() = CommonLibraryKind
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ class LibraryDependenciesCacheImpl(private val project: Project) : LibraryDepend
|
||||
* @return true if it's OK to add a dependency from a library with platform [from] to a library with platform [to]
|
||||
*/
|
||||
private fun compatiblePlatforms(from: TargetPlatform, to: TargetPlatform): Boolean {
|
||||
return from == to || to == TargetPlatform.Default
|
||||
return from == to || to == TargetPlatform.Common
|
||||
}
|
||||
|
||||
private fun getLibraryUsageIndex(): LibraryUsageIndex {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import org.jetbrains.kotlin.serialization.deserialization.MetadataPackageFragmen
|
||||
import java.io.ByteArrayInputStream
|
||||
|
||||
class KotlinBuiltInDecompiler : KotlinMetadataDecompiler<BuiltInsBinaryVersion>(
|
||||
KotlinBuiltInFileType, TargetPlatform.Default, BuiltInSerializerProtocol,
|
||||
KotlinBuiltInFileType, TargetPlatform.Common, BuiltInSerializerProtocol,
|
||||
FlexibleTypeDeserializer.ThrowException, BuiltInsBinaryVersion.INSTANCE, BuiltInsBinaryVersion.INVALID_VERSION,
|
||||
KotlinStubVersions.BUILTIN_STUB_VERSION
|
||||
) {
|
||||
|
||||
@@ -59,7 +59,7 @@ fun getLibraryPlatform(library: Library): TargetPlatform {
|
||||
|
||||
return when (library.kind) {
|
||||
JSLibraryKind -> JsPlatform
|
||||
CommonLibraryKind -> TargetPlatform.Default
|
||||
CommonLibraryKind -> TargetPlatform.Common
|
||||
else -> JvmPlatform
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ class PlatformHeaderAnnotator : Annotator {
|
||||
val declaration = element as? KtDeclaration ?: return
|
||||
if (!isHeaderDeclaration(declaration)) return
|
||||
|
||||
if (TargetPlatformDetector.getPlatform(declaration.containingKtFile) !is TargetPlatform.Default) return
|
||||
if (TargetPlatformDetector.getPlatform(declaration.containingKtFile) !is TargetPlatform.Common) return
|
||||
|
||||
val implementingModules = declaration.findModuleDescriptor().allImplementingCompatibleModules
|
||||
if (implementingModules.isEmpty()) return
|
||||
|
||||
+2
-2
@@ -144,7 +144,7 @@ class KotlinGenerateEqualsAndHashcodeAction : KotlinGenerateMemberActionBase<Kot
|
||||
if (!targetClass.languageVersionSettings.supportsFeature(LanguageFeature.BoundCallableReferences)) return defaultExpression
|
||||
return when (targetClass.platform) {
|
||||
is JsPlatform -> "other == null || this::class.js != $paramName::class.js"
|
||||
is TargetPlatform.Default -> "other == null || this::class != $paramName::class"
|
||||
is TargetPlatform.Common -> "other == null || this::class != $paramName::class"
|
||||
else -> defaultExpression
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ class KotlinGenerateEqualsAndHashcodeAction : KotlinGenerateMemberActionBase<Kot
|
||||
if (!targetClass.languageVersionSettings.supportsFeature(LanguageFeature.BoundCallableReferences)) return defaultExpression
|
||||
return when (targetClass.platform) {
|
||||
is JsPlatform -> "this::class.js"
|
||||
is TargetPlatform.Default -> "this::class"
|
||||
is TargetPlatform.Common -> "this::class"
|
||||
else -> defaultExpression
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ abstract class AbstractCodeInsightActionTest : KotlinLightCodeInsightFixtureTest
|
||||
val targetPlatform = when (targetPlatformName) {
|
||||
"JVM" -> JvmPlatform
|
||||
"JavaScript" -> JsPlatform
|
||||
"Common" -> TargetPlatform.Default
|
||||
"Common" -> TargetPlatform.Common
|
||||
else -> error("Unexpected platform name: $targetPlatformName")
|
||||
}
|
||||
mainPsiFile.targetPlatform = targetPlatform
|
||||
|
||||
Reference in New Issue
Block a user