From 1afd3d929a5a863d93f651ef562f78c276f1d289 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 4 Mar 2020 12:26:07 +0300 Subject: [PATCH] 201: Update to 201.5985.32 --- .../MockExternalAnnotationsManager.kt.201 | 62 +++++++++++++++++++ gradle/versions.properties.201 | 2 +- idea/build.gradle.kts | 8 ++- idea/idea-android/build.gradle.kts | 6 +- .../idea/configuration/kotlinResolverUtil.kt | 2 +- .../configuration/kotlinResolverUtil.kt.192 | 2 +- idea/idea-jvm/build.gradle.kts | 6 +- idea/resources/META-INF/plugin.xml.201 | 2 +- .../kotlin/idea/hierarchy/calls/compat.kt.201 | 18 +++--- .../quickfix/AbstractQuickFixMultiFileTest.kt | 3 +- .../jetbrains/kotlin/idea/quickfix/compat.kt | 16 +++++ .../kotlin/idea/quickfix/compat.kt.201 | 16 +++++ j2k/build.gradle.kts | 6 +- .../android-extensions-idea/build.gradle.kts | 6 +- 14 files changed, 134 insertions(+), 21 deletions(-) create mode 100644 compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/MockExternalAnnotationsManager.kt.201 create mode 100644 idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt create mode 100644 idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt.201 diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/MockExternalAnnotationsManager.kt.201 b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/MockExternalAnnotationsManager.kt.201 new file mode 100644 index 00000000000..c352086207c --- /dev/null +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/MockExternalAnnotationsManager.kt.201 @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.cli.jvm.compiler + +import com.intellij.codeInsight.ExternalAnnotationsManager +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.* + +class MockExternalAnnotationsManager : ExternalAnnotationsManager() { + override fun chooseAnnotationsPlace(element: PsiElement): AnnotationPlace = AnnotationPlace.NOWHERE + override fun chooseAnnotationsPlaceNoUi(element: PsiElement): AnnotationPlace = AnnotationPlace.NOWHERE + + override fun isExternalAnnotationWritable(listOwner: PsiModifierListOwner, annotationFQN: String): Boolean = false + override fun isExternalAnnotation(annotation: PsiAnnotation): Boolean = false + + override fun findExternalAnnotationsFiles(listOwner: PsiModifierListOwner): List? = null + override fun findExternalAnnotation(listOwner: PsiModifierListOwner, annotationFQN: String): PsiAnnotation? = null + override fun findExternalAnnotations(listOwner: PsiModifierListOwner): Array? = null + + override fun annotateExternally( + listOwner: PsiModifierListOwner, + annotationFQName: String, + fromFile: PsiFile, + value: Array? + ) { + throw UnsupportedOperationException("not implemented") + } + + override fun deannotate(listOwner: PsiModifierListOwner, annotationFQN: String): Boolean { + throw UnsupportedOperationException("not implemented") + } + + override fun editExternalAnnotation( + listOwner: PsiModifierListOwner, + annotationFQN: String, + value: Array? + ): Boolean { + throw UnsupportedOperationException("not implemented") + } + + override fun hasAnnotationRootsForFile(file: VirtualFile): Boolean = false + + override fun findDefaultConstructorExternalAnnotations(aClass: PsiClass, annotationFQN: String): List = emptyList() + + override fun findDefaultConstructorExternalAnnotations(aClass: PsiClass): List = emptyList() + + override fun findExternalAnnotations(listOwner: PsiModifierListOwner, annotationFQN: String): List = emptyList() +} diff --git a/gradle/versions.properties.201 b/gradle/versions.properties.201 index 26f5d8ecc2b..e70f835a298 100644 --- a/gradle/versions.properties.201 +++ b/gradle/versions.properties.201 @@ -1,4 +1,4 @@ -versions.intellijSdk=201.5259.13-EAP-SNAPSHOT +versions.intellijSdk=201.5985.32-EAP-SNAPSHOT versions.androidBuildTools=r23.0.1 versions.idea.NodeJS=193.6494.7 versions.jar.asm-all=7.0.1 diff --git a/idea/build.gradle.kts b/idea/build.gradle.kts index 855e70e5e9c..c259f4e66e0 100644 --- a/idea/build.gradle.kts +++ b/idea/build.gradle.kts @@ -91,7 +91,11 @@ dependencies { compileOnly(commonDep("org.jetbrains", "markdown")) compileOnly(commonDep("com.google.code.findbugs", "jsr305")) - compileOnly(intellijPluginDep("IntelliLang")) + if (Platform[201].orHigher()) { + compileOnly(intellijPluginDep("platform-langInjection")) + } else { + compileOnly(intellijPluginDep("IntelliLang")) + } compileOnly(intellijPluginDep("copyright")) compileOnly(intellijPluginDep("properties")) compileOnly(intellijPluginDep("java-i18n")) @@ -141,7 +145,7 @@ dependencies { testRuntime(project(it)) } - testCompile(intellijPluginDep("IntelliLang")) + testCompile(intellijPluginDep(if (Platform[201].orHigher()) "platform-langInjection" else "IntelliLang")) testCompile(intellijPluginDep("copyright")) testCompile(intellijPluginDep("properties")) testCompile(intellijPluginDep("java-i18n")) diff --git a/idea/idea-android/build.gradle.kts b/idea/idea-android/build.gradle.kts index 3e493d71d3f..b97b48bad7a 100644 --- a/idea/idea-android/build.gradle.kts +++ b/idea/idea-android/build.gradle.kts @@ -59,7 +59,11 @@ dependencies { testRuntime(intellijPluginDep("coverage")) testRuntime(intellijPluginDep("gradle")) testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("IntelliLang")) + if (Platform[201].orHigher()) { + testRuntime(intellijPluginDep("platform-langInjection")) + } else { + testRuntime(intellijPluginDep("IntelliLang")) + } testRuntime(intellijPluginDep("java-decompiler")) testRuntime(intellijPluginDep("java-i18n")) testRuntime(intellijPluginDep("junit")) diff --git a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt index d3362290218..48c25f4e357 100644 --- a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt +++ b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt @@ -27,7 +27,7 @@ fun suggestNativeDebug(projectPath: String) { val project = ProjectManager.getInstance().openProjects.firstOrNull { it.basePath == projectPath } ?: return PluginsAdvertiser.NOTIFICATION_GROUP.createNotification( - PluginsAdvertiser.DISPLAY_ID, + "Plugins Suggestion", "Native Debug provides debugger for Kotlin/Native", NotificationType.INFORMATION, null ).addAction(object : NotificationAction("Install") { diff --git a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt.192 b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt.192 index addc79e216d..832b8d189f9 100644 --- a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt.192 +++ b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/kotlinResolverUtil.kt.192 @@ -26,7 +26,7 @@ fun suggestNativeDebug(projectPath: String) { val project = ProjectManager.getInstance().openProjects.firstOrNull { it.basePath == projectPath } ?: return PluginsAdvertiser.NOTIFICATION_GROUP.createNotification( - PluginsAdvertiser.DISPLAY_ID, + "Plugins Suggestion", "Native Debug provides debugger for Kotlin/Native", NotificationType.INFORMATION, null ).addAction(object : NotificationAction("Install") { diff --git a/idea/idea-jvm/build.gradle.kts b/idea/idea-jvm/build.gradle.kts index 6b0eef2a320..11c04010c90 100644 --- a/idea/idea-jvm/build.gradle.kts +++ b/idea/idea-jvm/build.gradle.kts @@ -22,7 +22,11 @@ dependencies { compileOnly(intellijPluginDep("testng")) compileOnly(intellijPluginDep("coverage")) compileOnly(intellijPluginDep("java-decompiler")) - compileOnly(intellijPluginDep("IntelliLang")) + if (Platform[201].orHigher()) { + compileOnly(intellijPluginDep("platform-langInjection")) + } else { + compileOnly(intellijPluginDep("IntelliLang")) + } compileOnly(intellijPluginDep("copyright")) compileOnly(intellijPluginDep("properties")) compileOnly(intellijPluginDep("java-i18n")) diff --git a/idea/resources/META-INF/plugin.xml.201 b/idea/resources/META-INF/plugin.xml.201 index b2811fc37a6..63cd761d3e2 100644 --- a/idea/resources/META-INF/plugin.xml.201 +++ b/idea/resources/META-INF/plugin.xml.201 @@ -13,7 +13,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio. @snapshot@ JetBrains - + com.intellij.modules.platform diff --git a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/compat.kt.201 b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/compat.kt.201 index 1ea80973d0a..8aa690b3bad 100644 --- a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/compat.kt.201 +++ b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/compat.kt.201 @@ -14,16 +14,16 @@ import com.intellij.psi.PsiMember import com.intellij.psi.PsiMethod // BUNCH: 193 -typealias HierarchyNodeDescriptor = com.intellij.ide.hierarchy.newAPI.HierarchyNodeDescriptor -typealias HierarchyTreeStructure = com.intellij.ide.hierarchy.newAPI.HierarchyTreeStructure -typealias CallHierarchyBrowserBase = com.intellij.ide.hierarchy.newAPI.CallHierarchyBrowserBase -typealias HierarchyScopeType = com.intellij.ide.hierarchy.newAPI.HierarchyScopeType -typealias HierarchyBrowserBaseEx = com.intellij.ide.hierarchy.newAPI.HierarchyBrowserBaseEx -typealias MethodHierarchyBrowserBase = com.intellij.ide.hierarchy.newAPI.MethodHierarchyBrowserBase +typealias HierarchyNodeDescriptor = com.intellij.ide.hierarchy.HierarchyNodeDescriptor +typealias HierarchyTreeStructure = com.intellij.ide.hierarchy.HierarchyTreeStructure +typealias CallHierarchyBrowserBase = com.intellij.ide.hierarchy.CallHierarchyBrowserBase +typealias HierarchyScopeType = String +typealias HierarchyBrowserBaseEx = com.intellij.ide.hierarchy.HierarchyBrowserBaseEx +typealias MethodHierarchyBrowserBase = com.intellij.ide.hierarchy.MethodHierarchyBrowserBase -fun getCallerTypeCompat() = CallHierarchyBrowserBase.getCallerType() -fun getCalleeTypeCompat() = CallHierarchyBrowserBase.getCalleeType() -fun getMethodTypeCompat() = MethodHierarchyBrowserBase.getMethodType() +fun getCallerTypeCompat(): String = CallHierarchyBrowserBase.CALLER_TYPE +fun getCalleeTypeCompat(): String = CallHierarchyBrowserBase.CALLEE_TYPE +fun getMethodTypeCompat(): String = MethodHierarchyBrowserBase.METHOD_TYPE fun createCallerMethodsTreeStructure(project: Project, method: PsiMethod, scopeType: String): CallerMethodsTreeStructure { return CallerMethodsTreeStructure(project, method as PsiMember, scopeType) diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt index 5461f93fe06..d6556933c6c 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt @@ -22,7 +22,6 @@ import com.intellij.openapi.vfs.CharsetToolkit import com.intellij.openapi.vfs.VfsUtil import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.PsiFile -import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl import com.intellij.util.ArrayUtil import com.intellij.util.PathUtil import junit.framework.ComparisonFailure @@ -343,7 +342,7 @@ abstract class AbstractQuickFixMultiFileTest : KotlinLightCodeInsightFixtureTest TestCase.fail("Action '$text' is available (but must not) in test $testFilePath") } - CodeInsightTestFixtureImpl.invokeIntention(action, file, editor, action.text) + invokeIntentionCompat(action, file, editor) if (!shouldBeAvailableAfterExecution) { val afterAction = findActionByPattern(pattern, getAvailableActions()) diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt b/idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt new file mode 100644 index 00000000000..491088bca9d --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2010-2020 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.quickfix + +import com.intellij.codeInsight.intention.IntentionAction +import com.intellij.openapi.editor.Editor +import com.intellij.psi.PsiFile +import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl + +// BUNCH: 193 +fun invokeIntentionCompat(action: IntentionAction, file: PsiFile, editor: Editor) { + CodeInsightTestFixtureImpl.invokeIntention(action, file, editor, action.text) +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt.201 b/idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt.201 new file mode 100644 index 00000000000..a655f32b640 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/compat.kt.201 @@ -0,0 +1,16 @@ +/* + * Copyright 2010-2020 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.quickfix + +import com.intellij.codeInsight.intention.IntentionAction +import com.intellij.openapi.editor.Editor +import com.intellij.psi.PsiFile +import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl + +// BUNCH: 193 +fun invokeIntentionCompat(action: IntentionAction, file: PsiFile, editor: Editor) { + CodeInsightTestFixtureImpl.invokeIntention(action, file, editor) +} \ No newline at end of file diff --git a/j2k/build.gradle.kts b/j2k/build.gradle.kts index d4360d1e6a0..3b65adfb2ea 100644 --- a/j2k/build.gradle.kts +++ b/j2k/build.gradle.kts @@ -60,7 +60,11 @@ dependencies { testRuntime(intellijPluginDep("smali")) testRuntime(intellijPluginDep("junit")) testRuntime(intellijPluginDep("testng")) - testRuntime(intellijPluginDep("IntelliLang")) + if (Platform[201].orHigher()) { + testRuntime(intellijPluginDep("platform-langInjection")) + } else { + testRuntime(intellijPluginDep("IntelliLang")) + } testRuntime(intellijPluginDep("testng")) testRuntime(intellijPluginDep("copyright")) testRuntime(intellijPluginDep("properties")) diff --git a/plugins/android-extensions/android-extensions-idea/build.gradle.kts b/plugins/android-extensions/android-extensions-idea/build.gradle.kts index 3ee330074cb..32229303fa1 100644 --- a/plugins/android-extensions/android-extensions-idea/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-idea/build.gradle.kts @@ -49,7 +49,11 @@ dependencies { testRuntime(project(":kotlinx-serialization-ide-plugin")) testRuntime(project(":plugins:lint")) testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("IntelliLang")) + if (Platform[201].orHigher()) { + testRuntime(intellijPluginDep("platform-langInjection")) + } else { + testRuntime(intellijPluginDep("IntelliLang")) + } testRuntime(intellijPluginDep("properties")) testRuntime(intellijPluginDep("java-i18n")) testRuntime(intellijPluginDep("gradle"))