Cleanup as36 patchset files (KTI-315)

This commit is contained in:
Yunir Salimzyanov
2020-08-13 18:59:30 +03:00
parent 0a9089bc72
commit 27b2e16141
57 changed files with 0 additions and 2245 deletions
File diff suppressed because it is too large Load Diff
-21
View File
@@ -1,21 +0,0 @@
versions.intellijSdk=192.7142.36
versions.androidBuildTools=r23.0.1
versions.idea.NodeJS=181.3494.12
versions.androidStudioRelease=3.6.0.18
versions.androidStudioBuild=192.6071332
versions.jar.asm-all=7.0.1
versions.jar.guava=25.1-jre
versions.jar.groovy-all=2.4.17
versions.jar.lombok-ast=0.2.3
versions.jar.swingx-core=1.6.2-2
versions.jar.kxml2=2.3.0
versions.jar.streamex=0.6.8
versions.jar.gson=2.8.5
versions.jar.oro=2.0.8
versions.jar.picocontainer=1.2
versions.jar.lz4-java=1.6.0
ignore.jar.snappy-in-java=true
ignore.jar.common=true
ignore.jar.lombok-ast=true
versions.gradle-api=4.5.1
versions.shadow=5.2.0
@@ -1,18 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.statistics
open class KotlinFUSLogger {
companion object {
fun log(group: FUSEventGroups, event: String) {
// Not whitelisted for AS
}
fun log(group: FUSEventGroups, event: String, eventData: Map<String, String>) {
// Not whitelisted for AS
}
}
}
@@ -1,3 +0,0 @@
class ProjectConfigurationCollector {
// Not whitelisted
}
@@ -1,8 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle
fun KaptImportingTest.isAndroidStudio() = true
@@ -1,8 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.codeInsight.gradle
fun isGradleInspectionTestApplicable() = false
@@ -1,15 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.tools.projectWizard.wizard.service
import com.intellij.openapi.project.Project
import java.nio.file.Path
class MavenProjectImporter(private val project: Project) {
fun importProject(path: Path) {
// AS does not support Maven
}
}
@@ -1,149 +0,0 @@
<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude" version="2" url="http://kotlinlang.org" allow-bundled-update="true">
<id>org.jetbrains.kotlin</id>
<name>Kotlin</name>
<description><![CDATA[
The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
<br>
<a href="http://kotlinlang.org/docs/tutorials/getting-started.html">Getting Started in IntelliJ IDEA</a><br>
<a href="http://kotlinlang.org/docs/tutorials/kotlin-android.html">Getting Started in Android Studio</a><br>
<a href="http://slack.kotlinlang.org/">Public Slack</a><br>
<a href="https://youtrack.jetbrains.com/issues/KT">Issue tracker</a><br>
]]></description>
<version>@snapshot@</version>
<vendor url="http://www.jetbrains.com">JetBrains</vendor>
<idea-version since-build="192.7142.36" until-build="192.*"/>
<change-notes><![CDATA[
<h3>1.4.0</h3>
Released: <b>August 17, 2020</b>
<ul>
<li>New compiler with better type inference.</li>
<li>IR backends for JVM and JS in Alpha mode (<a href="https://kotlinlang.org/docs/reference/whatsnew14.html#unified-backends-and-extensibility">requires opt-in</a>).</li>
<li>A new flexible Kotlin Project Wizard for easy creation and configuration of different types of projects.</li>
<li>New IDE functionality to debug coroutines.</li>
<li>IDE performance improvements: many actions, such as project opening and autocomplete suggestions now complete up to 4 times faster.</li>
<li>New language features such as SAM conversions, trailing comma, and other.</li>
<li>Type annotations in the JVM bytecode and new modes for generating default interfaces in Kotlin/JVM.</li>
<li>New Gradle DSL for Kotlin/JS.</li>
<li>Improved performance and interop with Swift and Objective-C in Kotlin/Native.</li>
<li>Support for sharing code in several targets thanks to the hierarchical structure in multiplatform projects.</li>
<li>New collection operators, delegated properties improvements, the double-ended queue implementation ArrayDeque, and much more new things in the standard library.</li>
</ul>
For more details, see <a href="https://kotlinlang.org/docs/reference/whatsnew14.html?utm_source=product&utm_medium=link">Whats New in Kotlin 1.4.0</a> and <a href="http://blog.jetbrains.com/kotlin/2020/08/kotlin-1-4-released-with-a-focus-on-quality-and-performance/?utm_source=product&utm_medium=link">this blog post</a>.
<br><br>
To get the most out of the changes and improvements introduced in Kotlin 1.4, join our <a href="https://kotlinlang.org/lp/event-14/">Online Event</a> where you will be able to enjoy four days of Kotlin talks, Q&As with the Kotlin team, and more.
]]>
</change-notes>
<depends>com.intellij.modules.platform</depends>
<depends>com.intellij.modules.androidstudio</depends>
<depends optional="true" config-file="junit.xml">JUnit</depends>
<depends optional="true" config-file="gradle.xml">org.jetbrains.plugins.gradle</depends>
<depends optional="true" config-file="gradle-java.xml">org.jetbrains.plugins.gradle.java</depends>
<depends optional="true" config-file="kotlin-gradle-testing.xml">org.jetbrains.plugins.gradle.java</depends>
<depends optional="true" config-file="gradle-groovy.xml">org.intellij.groovy</depends>
<depends optional="true" config-file="maven-common.xml">org.jetbrains.idea.maven</depends>
<depends optional="true" config-file="maven.xml">org.jetbrains.idea.maven</depends>
<depends optional="true" config-file="testng-j.xml">TestNG-J</depends>
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
<depends optional="true" config-file="coverage.xml">Coverage</depends>
<depends optional="true" config-file="i18n.xml">com.intellij.java-i18n</depends>
<depends optional="true" config-file="decompiler.xml">org.jetbrains.java.decompiler</depends>
<depends optional="true" config-file="git4idea.xml">Git4Idea</depends>
<depends optional="true" config-file="stream-debugger.xml">org.jetbrains.debugger.streams</depends>
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
<depends>com.intellij.modules.java</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
<depends optional="true" config-file="injection.xml">org.intellij.intelliLang</depends>
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
<xi:include href="plugin-common.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-START -->
<xi:include href="jvm-common.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="jvm.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-END -->
<xi:include href="native-common.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="native.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="kotlinx-serialization.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="scripting-support.xml" xpointer="xpointer(/idea-plugin/*)"/>
<application-components>
<component>
<implementation-class>org.jetbrains.kotlin.idea.versions.KotlinUpdatePluginComponent</implementation-class>
</component>
</application-components>
<project-components>
<component>
<implementation-class>org.jetbrains.kotlin.idea.completion.LookupCancelWatcher</implementation-class>
</component>
<component>
<implementation-class>org.jetbrains.kotlin.idea.caches.KotlinPackageContentModificationListener</implementation-class>
</component>
<component>
<implementation-class>org.jetbrains.kotlin.idea.configuration.KotlinMigrationProjectComponent</implementation-class>
</component>
<component>
<implementation-class>org.jetbrains.kotlin.idea.highlighter.KotlinBeforeResolveHighlightingPass$Factory</implementation-class>
</component>
<component>
<implementation-class>org.jetbrains.kotlin.idea.refactoring.cutPaste.MoveDeclarationsPassFactory</implementation-class>
<skipForDefaultProject/>
</component>
<component>
<implementation-class>org.jetbrains.kotlin.idea.highlighter.ScriptExternalHighlightingPass$Factory</implementation-class>
</component>
<component>
<implementation-class>org.jetbrains.kotlin.idea.caches.trackers.KotlinCodeBlockModificationListener</implementation-class>
</component>
</project-components>
<application-components>
<component>
<implementation-class>org.jetbrains.kotlin.idea.PluginStartupComponent</implementation-class>
</component>
</application-components>
<extensionPoints>
<xi:include href="extensions/compiler.xml" xpointer="xpointer(/idea-plugin/extensionPoints/*)"/>
<extensionPoint qualifiedName="org.jetbrains.kotlin.pluginUpdateVerifier"
interface="org.jetbrains.kotlin.idea.update.PluginUpdateVerifier"/>
</extensionPoints>
<xi:include href="plugin-kotlin-extensions.xml" xpointer="xpointer(/idea-plugin/*)"/>
<extensions defaultExtensionNs="org.jetbrains.kotlin">
<pluginUpdateVerifier implementation="org.jetbrains.kotlin.idea.update.GooglePluginUpdateVerifier"/>
</extensions>
<extensions defaultExtensionNs="com.intellij.jvm">
<declarationSearcher language="kotlin" implementationClass="org.jetbrains.kotlin.idea.jvm.KotlinDeclarationSearcher"/>
</extensions>
<extensions defaultExtensionNs="com.intellij">
<fileTypeUsageSchemaDescriptor schema="Gradle Script" implementationClass="org.jetbrains.kotlin.idea.core.script.KotlinGradleScriptFileTypeSchemaDetector"/>
<defaultLiveTemplatesProvider implementation="org.jetbrains.kotlin.idea.liveTemplates.KotlinLiveTemplatesProvider"/>
<fileTypeFactory implementation="org.jetbrains.kotlin.idea.core.KotlinFileTypeFactory"/>
<fileTypeFactory implementation="org.jetbrains.kotlin.idea.KotlinJavaScriptMetaFileTypeFactory"/>
<fileTypeFactory implementation="org.jetbrains.kotlin.idea.KotlinBuiltInFileTypeFactory"/>
<fileTypeFactory implementation="org.jetbrains.kotlin.idea.KotlinModuleFileFactory"/>
</extensions>
</idea-plugin>
@@ -1,5 +0,0 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="kotlin" implementationClass="org.jetbrains.android.inspections.lint.AndroidLintExternalAnnotator"/>
</extensions>
</idea-plugin>
@@ -1,4 +0,0 @@
<idea-plugin>
<extensions defaultExtensionNs="Git4Idea">
</extensions>
</idea-plugin>
@@ -1,3 +0,0 @@
class IDESettingsFUSCollector {
// Not whitelisted
}
@@ -1,136 +0,0 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.formatter
import com.intellij.application.options.CodeStyle
import com.intellij.internal.statistic.beans.UsageDescriptor
import com.intellij.internal.statistic.utils.getEnumUsage
import com.intellij.openapi.project.Project
import com.intellij.psi.codeStyle.CodeStyleSettingsManager
import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings
import org.jetbrains.kotlin.idea.formatter.KotlinFormatterUsageCollector.KotlinFormatterKind.*
import org.jetbrains.kotlin.idea.util.isDefaultOfficialCodeStyle
//todo: convert to FUS?
class KotlinFormatterUsageCollector {
fun getProjectUsages(project: Project): Set<UsageDescriptor> {
val usedFormatter = getKotlinFormatterKind(project)
val settings = CodeStyle.getSettings(project)
val kotlinCommonSettings = settings.kotlinCommonSettings
val kotlinCustomSettings = settings.kotlinCustomSettings
return setOf(
getEnumUsage("kotlin.formatter.kind", usedFormatter),
getEnumStringPropertyUsage(
"kotlin.formatter.defaults",
kotlinCustomSettings.CODE_STYLE_DEFAULTS ?: kotlinCommonSettings.CODE_STYLE_DEFAULTS
)
)
}
private fun getEnumStringPropertyUsage(key: String, value: String?): UsageDescriptor {
return UsageDescriptor(key + "." + value.toString().toLowerCase(java.util.Locale.ENGLISH), 1)
}
companion object {
private const val GROUP_ID = "kotlin.formatter"
private val KOTLIN_DEFAULT_COMMON = KotlinLanguageCodeStyleSettingsProvider().defaultCommonSettings
.also { KotlinStyleGuideCodeStyle.applyToCommonSettings(it) }
private val KOTLIN_DEFAULT_CUSTOM by lazy {
KotlinCodeStyleSettings.defaultSettings().cloneSettings()
.also { KotlinStyleGuideCodeStyle.applyToKotlinCustomSettings(it) }
}
private val KOTLIN_OBSOLETE_DEFAULT_COMMON = KotlinLanguageCodeStyleSettingsProvider().defaultCommonSettings
.also { KotlinObsoleteCodeStyle.applyToCommonSettings(it) }
private val KOTLIN_OBSOLETE_DEFAULT_CUSTOM by lazy {
KotlinCodeStyleSettings.defaultSettings().cloneSettings()
.also { KotlinObsoleteCodeStyle.applyToKotlinCustomSettings(it) }
}
fun getKotlinFormatterKind(project: Project): KotlinFormatterKind {
val isProject = CodeStyleSettingsManager.getInstance(project).USE_PER_PROJECT_SETTINGS
val isDefaultOfficialCodeStyle = isDefaultOfficialCodeStyle
val settings = CodeStyle.getSettings(project)
val kotlinCommonSettings = settings.kotlinCommonSettings
val kotlinCustomSettings = settings.kotlinCustomSettings
val isDefaultKotlinCommonSettings = kotlinCommonSettings == KotlinLanguageCodeStyleSettingsProvider().defaultCommonSettings
val isDefaultKotlinCustomSettings = kotlinCustomSettings == KotlinCodeStyleSettings.defaultSettings()
if (isDefaultKotlinCommonSettings && isDefaultKotlinCustomSettings) {
return if (isDefaultOfficialCodeStyle) {
paired(IDEA_OFFICIAL_DEFAULT, isProject)
} else {
paired(IDEA_DEFAULT, isProject)
}
}
if (kotlinCommonSettings == KOTLIN_OBSOLETE_DEFAULT_COMMON && kotlinCustomSettings == KOTLIN_OBSOLETE_DEFAULT_CUSTOM) {
return paired(IDEA_OBSOLETE_KOTLIN, isProject)
}
if (kotlinCommonSettings == KOTLIN_DEFAULT_COMMON && kotlinCustomSettings == KOTLIN_DEFAULT_CUSTOM) {
return paired(IDEA_KOTLIN, isProject)
}
val isKotlinOfficialLikeSettings = settings == settings.clone().also {
KotlinStyleGuideCodeStyle.apply(it)
}
if (isKotlinOfficialLikeSettings) {
return paired(IDEA_OFFICIAL_KOTLIN_WITH_CUSTOM, isProject)
}
val isKotlinObsoleteLikeSettings = settings == settings.clone().also {
KotlinObsoleteCodeStyle.apply(it)
}
if (isKotlinObsoleteLikeSettings) {
return paired(IDEA_KOTLIN_WITH_CUSTOM, isProject)
}
return paired(IDEA_CUSTOM, isProject)
}
private fun paired(kind: KotlinFormatterKind, isProject: Boolean): KotlinFormatterKind {
if (!isProject) return kind
return when (kind) {
IDEA_DEFAULT -> PROJECT_DEFAULT
IDEA_OFFICIAL_DEFAULT -> PROJECT_OFFICIAL_DEFAULT
IDEA_CUSTOM -> PROJECT_CUSTOM
IDEA_KOTLIN_WITH_CUSTOM -> PROJECT_KOTLIN_WITH_CUSTOM
IDEA_KOTLIN -> PROJECT_KOTLIN
IDEA_OBSOLETE_KOTLIN -> PROJECT_OBSOLETE_KOTLIN
IDEA_OFFICIAL_KOTLIN_WITH_CUSTOM -> PROJECT_OBSOLETE_KOTLIN_WITH_CUSTOM
else -> kind
}
}
}
enum class KotlinFormatterKind {
IDEA_DEFAULT,
IDEA_CUSTOM,
IDEA_KOTLIN_WITH_CUSTOM,
IDEA_KOTLIN,
PROJECT_DEFAULT,
PROJECT_CUSTOM,
PROJECT_KOTLIN_WITH_CUSTOM,
PROJECT_KOTLIN,
IDEA_OFFICIAL_DEFAULT,
IDEA_OBSOLETE_KOTLIN,
IDEA_OFFICIAL_KOTLIN_WITH_CUSTOM,
PROJECT_OFFICIAL_DEFAULT,
PROJECT_OBSOLETE_KOTLIN,
PROJECT_OBSOLETE_KOTLIN_WITH_CUSTOM
}
}
@@ -1,14 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.highlighter.markers
import com.intellij.icons.AllIcons
import javax.swing.Icon
// FIX ME WHEN BUNCH as36 REMOVED
internal fun createDslStyleIcon(styleId: Int): Icon {
return AllIcons.Gutter.Colors
}
@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.reporter
import com.intellij.diagnostic.ITNReporter
import com.intellij.openapi.diagnostic.IdeaLoggingEvent
import com.intellij.openapi.diagnostic.SubmittedReportInfo
import com.intellij.util.Consumer
import java.awt.Component
abstract class ITNReporterCompat : ITNReporter() {
final override fun submit(
events: Array<IdeaLoggingEvent>,
additionalInfo: String?,
parentComponent: Component?,
consumer: Consumer<SubmittedReportInfo>
): Boolean {
return submitCompat(events, additionalInfo, parentComponent, consumer)
}
open fun submitCompat(
events: Array<IdeaLoggingEvent>,
additionalInfo: String?,
parentComponent: Component?,
consumer: Consumer<SubmittedReportInfo>
): Boolean {
@Suppress("IncompatibleAPI")
return super.submit(events, additionalInfo, parentComponent, consumer)
}
}
@@ -1,38 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("DEPRECATION")
package org.jetbrains.kotlin.idea
import com.intellij.featureStatistics.FeatureStatisticsBundleProvider
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.extensions.Extensions
private const val CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME = "com.jetbrains.cidr.lang.OCFeatureStatisticsBundleProvider"
// Remove the function, when there's no dependency to cidr during running Kotlin tests.
fun registerAdditionalResourceBundleInTests() {
if (!ApplicationManager.getApplication().isUnitTestMode) {
return
}
val isAlreadyRegistered = FeatureStatisticsBundleProvider.EP_NAME.extensions.any { provider ->
provider.javaClass.name == CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME
}
if (isAlreadyRegistered) {
return
}
val cidrFSBundleProviderClass = try {
Class.forName(CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME)
} catch (_: ClassNotFoundException) {
return
}
val cidrFSBundleProvider = cidrFSBundleProviderClass.newInstance() as FeatureStatisticsBundleProvider
Extensions.getRootArea().getExtensionPoint(FeatureStatisticsBundleProvider.EP_NAME).registerExtension(cidrFSBundleProvider)
}
@@ -1,157 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.update
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.plugins.PluginNode
import com.intellij.openapi.diagnostic.Logger
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.util.isDev
import org.jetbrains.kotlin.idea.util.isEap
import java.io.IOException
import java.net.URL
import java.util.*
import javax.xml.bind.JAXBContext
import javax.xml.bind.JAXBException
import javax.xml.bind.annotation.*
class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
override val verifierName: String
get() = KotlinBundle.message("update.name.android.studio")
// Verifies if a plugin can be installed in Android Studio 3.2+.
// Currently used only by KotlinPluginUpdater.
override fun verify(pluginDescriptor: IdeaPluginDescriptor): PluginVerifyResult? {
if (pluginDescriptor.pluginId.idString != KOTLIN_PLUGIN_ID) {
return null
}
val version = pluginDescriptor.version
if (isEap(version) || isDev(version)) {
return PluginVerifyResult.accept()
}
try {
val url = URL(METADATA_FILE_URL)
val stream = url.openStream()
val context = JAXBContext.newInstance(PluginCompatibility::class.java)
val unmarshaller = context.createUnmarshaller()
val pluginCompatibility = unmarshaller.unmarshal(stream) as PluginCompatibility
val release = getRelease(pluginCompatibility)
?: return PluginVerifyResult.decline(KotlinBundle.message("update.reason.text.no.verified.versions.for.this.build"))
return if (release.plugins().any { KOTLIN_PLUGIN_ID == it.id && version == it.version })
PluginVerifyResult.accept()
else
PluginVerifyResult.decline(KotlinBundle.message("update.reason.text.version.to.be.verified"))
} catch (e: Exception) {
LOG.info("Exception when verifying plugin ${pluginDescriptor.pluginId.idString} version $version", e)
return when (e) {
is IOException ->
PluginVerifyResult.decline(KotlinBundle.message("update.reason.text.unable.to.connect.to.compatibility.verification.repository"))
is JAXBException -> PluginVerifyResult.decline(KotlinBundle.message("update.reason.text.unable.to.parse.compatibility.verification.metadata"))
else -> PluginVerifyResult.decline(
KotlinBundle.message("update.reason.text.exception.during.verification",
e.message.toString()
)
)
}
}
}
private fun getRelease(pluginCompatibility: PluginCompatibility): StudioRelease? {
for (studioRelease in pluginCompatibility.releases()) {
if (buildInRange(studioRelease.name, studioRelease.sinceBuild, studioRelease.untilBuild)) {
return studioRelease
}
}
return null
}
private fun buildInRange(name: String?, sinceBuild: String?, untilBuild: String?): Boolean {
val descriptor = PluginNode()
descriptor.name = name
descriptor.sinceBuild = sinceBuild
descriptor.untilBuild = untilBuild
return PluginManagerCore.isCompatible(descriptor)
}
companion object {
private const val KOTLIN_PLUGIN_ID = "org.jetbrains.kotlin"
private const val METADATA_FILE_URL = "https://dl.google.com/android/studio/plugins/compatibility.xml"
private val LOG = Logger.getInstance(GooglePluginUpdateVerifier::class.java)
private fun PluginCompatibility.releases() = studioRelease ?: emptyArray()
private fun StudioRelease.plugins() = ideaPlugin ?: emptyArray()
@XmlRootElement(name = "plugin-compatibility")
@XmlAccessorType(XmlAccessType.FIELD)
class PluginCompatibility {
@XmlElement(name = "studio-release")
var studioRelease: Array<StudioRelease>? = null
override fun toString(): String {
return "PluginCompatibility(studioRelease=${Arrays.toString(studioRelease)})"
}
}
@XmlAccessorType(XmlAccessType.FIELD)
class StudioRelease {
@XmlAttribute(name = "until-build")
var untilBuild: String? = null
@XmlAttribute(name = "since-build")
var sinceBuild: String? = null
@XmlAttribute
var name: String? = null
@XmlAttribute
var channel: String? = null
@XmlElement(name = "idea-plugin")
var ideaPlugin: Array<IdeaPlugin>? = null
override fun toString(): String {
return "StudioRelease(" +
"untilBuild=$untilBuild, name=$name, ideaPlugin=${Arrays.toString(ideaPlugin)}, " +
"sinceBuild=$sinceBuild, channel=$channel" +
")"
}
}
@XmlAccessorType(XmlAccessType.FIELD)
class IdeaPlugin {
@XmlAttribute
var id: String? = null
@XmlAttribute
var sha256: String? = null
@XmlAttribute
var channel: String? = null
@XmlAttribute
var version: String? = null
@XmlElement(name = "idea-version")
var ideaVersion: IdeaVersion? = null
override fun toString(): String {
return "IdeaPlugin(id=$id, sha256=$sha256, ideaVersion=$ideaVersion, channel=$channel, version=$version)"
}
}
@XmlAccessorType(XmlAccessType.FIELD)
class IdeaVersion {
@XmlAttribute(name = "until-build")
var untilBuild: String? = null
@XmlAttribute(name = "since-build")
var sinceBuild: String? = null
override fun toString(): String {
return "IdeaVersion(untilBuild=$untilBuild, sinceBuild=$sinceBuild)"
}
}
}
}
@@ -1,35 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.update
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.openapi.util.registry.Registry
import org.jetbrains.kotlin.idea.PluginUpdateStatus
// Do an additional verification with PluginUpdateVerifier. Enabled only in AS 3.2+
fun verify(updateStatus: PluginUpdateStatus.Update): PluginUpdateStatus {
@Suppress("InvalidBundleOrProperty")
val pluginVerifierEnabled = Registry.`is`("kotlin.plugin.update.verifier.enabled", true)
if (!pluginVerifierEnabled) {
return updateStatus
}
val pluginDescriptor: IdeaPluginDescriptor = updateStatus.pluginDescriptor
val pluginVerifiers = PluginUpdateVerifier.EP_NAME.extensions
for (pluginVerifier in pluginVerifiers) {
val verifyResult = pluginVerifier.verify(pluginDescriptor) ?: continue
if (!verifyResult.verified) {
return PluginUpdateStatus.Unverified(
pluginVerifier.verifierName,
verifyResult.declineMessage,
updateStatus
)
}
}
return updateStatus
}
@@ -1,45 +0,0 @@
class A {
fun someOther() = false
private fun formatElement(element: PsiElement): String {
var element = element
element = JetPsiUtil.ascendIfPropertyAccessor(element)
if (element is JetNamedFunction || element is JetProperty) {
val bindingContext =
AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingJetFile())
.getBindingContext()
val declarationDescriptor =
bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element)
if (declarationDescriptor is CallableMemberDescriptor) {
val containingDescriptor = declarationDescriptor.getContainingDeclaration()
if (containingDescriptor is ClassDescriptor) {
return JetBundle.message(
"override.declaration.x.in.y",
DescriptorRenderer.COMPACT.render(declarationDescriptor),
IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.render(
containingDescriptor
)
)
}
}
}
assert(element is PsiMethod) { "Method accepts only kotlin functions/properties and java methods, but '" + element.getText() + "' was found" }
return JetRefactoringUtil.formatPsiMethod(element as PsiMethod, true, false)
}
protected fun getDimensionServiceKey(): String {
return "#org.jetbrains.kotlin.idea.refactoring.safeDelete.KotlinOverridingDialog"
}
fun getSelected(): ArrayList<UsageInfo> {
val result = ArrayList<UsageInfo>()
for (i in 0 until myChecked.length) {
if (myChecked[i]) {
result.add(myOverridingMethods.get(i))
}
}
return result
}
}
@@ -1,35 +0,0 @@
import test.ToBeImportedJava.staticMethod
import test.ToBeImportedJava.TO_BE_IMPORTED_CONST
import test.ToBeImportedJava
import test.ToBeImportedKotlin
import java.util.HashMap
import java.util.ArrayList
class Target {
var listOfPlatformType: List<String> = ArrayList()
var unresolved: UnresolvedInterface<UnresolvedGeneric> =
UnresolvedImplementation() // Should not add import
var hashMapOfNotImported: Map<ToBeImportedJava, ToBeImportedKotlin> = HashMap()
fun acceptKotlinClass(tbi: ToBeImportedKotlin) {
}
fun acceptJavaClass(tbi: ToBeImportedJava) {
}
var ambiguousKotlin: IAmbiguousKotlin =
AmbiguousKotlin() // Should not add import in case of 2 declarations in Kotlin
var ambiguous: IAmbiguous =
Ambiguous() // Should not add import in case of ambiguous declarations in Kotlin and in Java
var ambiguousJava: IAmbiguousJava =
AmbiguousJava() // Should not add import in case of 2 declarations in Java
fun workWithStatics() {
val a = TO_BE_IMPORTED_CONST
staticMethod()
}
}
@@ -1,7 +0,0 @@
import org.junit.Test
class <lineMarker descr="Run Test" settings="Nothing here">MyKotlinTest</lineMarker> {
@Test
fun <lineMarker descr="Run Test" settings="Nothing here">testA</lineMarker>() {
}
}
@@ -1,11 +0,0 @@
import org.junit.Test
class <lineMarker descr="Run Test" settings="Nothing here">MyKotlinTest</lineMarker> {
@Test
fun <lineMarker descr="Run Test" settings="Nothing here">testA</lineMarker>() {
}
@Test
fun <lineMarker descr="Run Test" settings="Nothing here">testB</lineMarker>() {
}
}
@@ -1,6 +0,0 @@
// WITH_RUNTIME
fun test(list: List<Int>) {
val mapIndexedTo: MutableList<Int> = list.asSequence().filter { it > 1 }
.mapIndexedTo(mutableListOf()) { index, i -> i }
}
@@ -1,6 +0,0 @@
// WITH_RUNTIME
fun test() {
val pair: Pair<List<Int>, List<Int>> = listOf(1 to 2, 3 to 4).asSequence().filter { it.first > 1 }
.filter { it.second > 2 }.unzip()
}
@@ -1,9 +0,0 @@
class DefaultValueChain(
val x1: Int,
x2: Int = x1,
val x3: Int = x2,
x4: Int = x3,
val x5: Int = x4
) {
}
@@ -1,12 +0,0 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'firstOrNull{}'"
// IS_APPLICABLE_2: false
fun getFirstValue() = "value"
fun foo(list: List<String?>): String? {
val value = getFirstValue()
val found: String? =
list.firstOrNull { it != null && !it.startsWith("IMG:") && it.contains(value) }
return found
}
@@ -1,21 +0,0 @@
annotation class Ann1(val i: Int, val j: Int)
@Target(AnnotationTarget.PROPERTY)
annotation class Ann2(val i: Int, val j: Int)
@Target(AnnotationTarget.FIELD)
annotation class Ann3(val i: Int, val j: Int)
@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD, AnnotationTarget.PROPERTY)
annotation class Ann4(val i: Int, val j: Int)
@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD)
annotation class Ann5(val i: Int, val j: Int)
class Test(
@get:Ann1(0, 0) @property:Ann1(1, 11) @Ann2(2, 22) @Ann3(3, 33) @property:Ann4(
4,
44
) @field:Ann5(5, 55) val foo: String = ""
) {
}
@@ -1,11 +0,0 @@
annotation class Annotation1(val a: Int = 0)
annotation class Annotation2(val a: Int = 0)
annotation class Annotation3(val a: Int = 0)
class TestClass(
private @property:Annotation1(42) @field:Annotation2(42) @Annotation1(42) @Annotation3(
42
) val text: String = "LoremIpsum"
) {
}
@@ -1,5 +0,0 @@
// Ann: to be implemented
actual annotation class <caret>Ann actual constructor(
actual val x: Int,
actual val y: String
)
@@ -1,11 +0,0 @@
import org.jetbrains.annotations.NotNull;
import kotlin.properties.ReadOnlyProperty;
class J {
public static class Foo<T> implements ReadOnlyProperty<A<T>, B> {
public Foo(T t, @NotNull String s) {
}
}
}
@@ -1,10 +0,0 @@
// "Mark as @Deprecated(..., level = DeprecationLevel.HIDDEN)" "true"
import java.io.File
@Deprecated(
"Is replaced with automatic synthetic extension",
ReplaceWith("name"),
level = DeprecationLevel.HIDDEN
)
val File.<caret>name: String
get() = getName()
@@ -1,38 +0,0 @@
// WITH_RUNTIME
// SUGGESTED_NAMES: triple, getT
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
// PARAM_DESCRIPTOR: value-parameter a: kotlin.Int defined in foo
// PARAM_DESCRIPTOR: var b: kotlin.Int defined in foo
// PARAM_DESCRIPTOR: var c: kotlin.Int defined in foo
// SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
var c: Int = 2
val triple = triple(a, b, c)
b = triple.second
c = triple.third
val t = triple.first
println(b + c)
return t
}
private fun triple(
a: Int,
b: Int,
c: Int
): Triple<Int, Int, Int> {
var b1 = b
var c1 = c
val i = if (a > 0) {
b1 += a
c1 -= b1
b1
} else {
a
}
return Triple(i, b1, c1)
}
@@ -1,4 +0,0 @@
// WITH_RUNTIME
fun foo(list: List<String>, function: (String) -> Boolean = { it.length > 6 }) = list.filter(
function
)
@@ -1,18 +0,0 @@
internal annotation class Anon(
val stringArray: Array<String>, val intArray: IntArray, // string
val string: String
)
@Anon(string = "a", stringArray = ["a", "b"], intArray = [1, 2])
@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD)
internal annotation class I
@Target(
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER
)
internal annotation class J
@Target
internal annotation class K
@@ -1,8 +0,0 @@
internal annotation class Anon(
val s: String = "a",
val stringArray: Array<String> = ["a", "b"],
val intArray: IntArray
)
@Anon(intArray = [1, 2])
internal class A
@@ -1,6 +0,0 @@
val constrArgTypes = arrayOf<Class<*>>(
Array<String>::class.java,
String::class.java,
Int::class.java,
Double::class.java
)
@@ -1,12 +0,0 @@
package pack
internal class C @JvmOverloads constructor(
a: Int = 0,
b: Int = 0,
c: Int = 0,
d: Int = 0,
e: Int = 0
) {
constructor(a: Int) : this(a, 0, 0, 0, 1) {}
}
@@ -1,14 +0,0 @@
package pack
internal class C @JvmOverloads constructor(
a: Int = 0,
b: Int = 0,
c: Int = 0,
d: Int = 0,
e: Int = 0
) {
constructor(a1: Int, b1: Int, c1: Int) : this(a1, b1, c1, 0, 0) {}
constructor(b: Byte) : this(b.toInt(), 0, 0, 0, 0) {}
}
@@ -1,12 +0,0 @@
package pack
internal class C @JvmOverloads constructor(
a: Int = 0,
b: Int = 0,
c: Int = 0,
d: Int = 0,
e: Int = 0
) {
constructor(a: Int, b: Int, c: Int) : this(b, a, c, 0, 0) {}
}
@@ -1,9 +0,0 @@
package pack
internal class C @JvmOverloads constructor(
a: Int = 1,
b: Int = 2,
c: Int = 3,
d: Int = 4,
e: Int = 5
)
@@ -1,9 +0,0 @@
package pack
internal class C @JvmOverloads constructor(
a: Int = 1,
b: Int = 2,
c: Int = 3,
d: Int = 4,
e: Int = 5
)
-6
View File
@@ -1,6 +0,0 @@
class AppInfo(
internal var mName: String,
internal var mIcon: String,
internal var mLastUpdateTime: Long
)
@@ -1,23 +0,0 @@
import java.util.*
internal class Iterator {
var mutableMap1: MutableMap<String, String> = HashMap()
var mutableMap2: MutableMap<String, String> = HashMap()
fun testFields() {
mutableMap1.values.add("")
mutableMap2.entries.iterator().remove()
}
fun testFunctionParameters(
immutableCollection: Collection<String>,
mutableList: MutableList<Int>
) {
val it = immutableCollection.iterator()
while (it.hasNext()) {
it.next()
}
mutableList.listIterator().add(2)
}
}
-20
View File
@@ -1,20 +0,0 @@
Test key, Issue, State (optional: MUTE or FAIL), Status (optional: FLAKY)
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testAndroidGradleJsDetection, NPE during import,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testKotlinAndroidPluginDetection, NPE during import,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleMigrateTest.testMigrateStdlib, Can't get migration information,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Common.StaticMembers.testJavaStaticMethodsFromImports, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.BoldOrGrayed.testNonPredictableSmartCast1, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.BoldOrGrayed.testNonPredictableSmartCast2, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.BoldOrGrayed.testSyntheticJavaProperties1, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.BoldOrGrayed.testSyntheticJavaProperties2, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.SyntheticExtensions.testNullableReceiver, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.SyntheticExtensions.testSafeCall, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.SyntheticExtensions.testSmartCast, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.SyntheticExtensions.testSmartCast2, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Java.SyntheticExtensions.testSyntheticExtensions1, KT-32919,,
org.jetbrains.kotlin.idea.completion.test.weighers.BasicCompletionWeigherTestGenerated.testPreferFromJdk, Class from JDK is not prioritized,,
org.jetbrains.kotlin.idea.debugger.test.KotlinSteppingTestGenerated.StepOver.testSoSuspendableCallInFunFromOtherStepping, Super flaky on Android Studio (can be reproduced locally),, FLAKY
org.jetbrains.kotlin.idea.debugger.test.KotlinSteppingTestGenerated.StepOverForce.testSofSuspendableCallInFun, Super flaky on Android Studio (can be reproduced locally),, FLAKY
org.jetbrains.kotlin.idea.quickfix.QuickFixMultiFileTestGenerated.AutoImports.testAmbiguousNamePreferFromJdk, Class from JDK is not prioritized,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleKtsImportTest.testError[0: with Gradle-6.0.1], KT-37864,,
org.jetbrains.kotlin.idea.debugger.test.KotlinSteppingTestGenerated.Custom.testFunctionBreakpointInStdlib, Unprocessed,,