Consistent naming: common platform is common, not default

This commit is contained in:
Dmitry Jemerov
2017-09-07 15:43:42 +02:00
parent 62b3059425
commit aed01c8475
15 changed files with 23 additions and 23 deletions
@@ -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
@@ -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 {
@@ -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
}
}
@@ -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