diff --git a/.idea/misc.xml b/.idea/misc.xml
index a859abdcb1d..7e048cd5e8d 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -12,14 +12,8 @@
-
-
-
-
-
-
-
-
+
+
diff --git a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/gradle/execution/KotlinMPPGradleProjectTaskRunner.kt.192 b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/gradle/execution/KotlinMPPGradleProjectTaskRunner.java.192
similarity index 100%
rename from idea/idea-gradle/src/org/jetbrains/kotlin/idea/gradle/execution/KotlinMPPGradleProjectTaskRunner.kt.192
rename to idea/idea-gradle/src/org/jetbrains/kotlin/idea/gradle/execution/KotlinMPPGradleProjectTaskRunner.java.192
diff --git a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructure.kt b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructure.kt
index 9ad9f3115b9..10b8d74f7cc 100644
--- a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructure.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructure.kt
@@ -11,8 +11,6 @@ import com.intellij.ide.hierarchy.call.CallHierarchyNodeDescriptor
import com.intellij.ide.hierarchy.call.CalleeMethodsTreeStructure
import com.intellij.ide.util.treeView.NodeDescriptor
import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiMember
-import com.intellij.psi.PsiMethod
import com.intellij.util.ArrayUtil
import org.jetbrains.kotlin.asJava.unwrapped
import org.jetbrains.kotlin.idea.caches.resolve.analyze
@@ -41,8 +39,9 @@ class KotlinCalleeTreeStructure(
override fun buildChildren(nodeDescriptor: HierarchyNodeDescriptor): Array {
if (nodeDescriptor is CallHierarchyNodeDescriptor) {
- val psiMethod: PsiMember = nodeDescriptor.enclosingElement as? PsiMethod ?: return ArrayUtil.EMPTY_OBJECT_ARRAY
- return CalleeMethodsTreeStructure(myProject, psiMethod, scopeType).getChildElements(nodeDescriptor)
+ val member /* : PsiMember in 193, : PsiMethod in 192 */ =
+ extractMemberFromDescriptor(nodeDescriptor) ?: return ArrayUtil.EMPTY_OBJECT_ARRAY
+ return CalleeMethodsTreeStructure(myProject, member, scopeType).getChildElements(nodeDescriptor)
}
val element = nodeDescriptor.psiElement as? KtElement ?: return ArrayUtil.EMPTY_OBJECT_ARRAY
diff --git a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructureUtils.kt b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructureUtils.kt
new file mode 100644
index 00000000000..564e20347cb
--- /dev/null
+++ b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructureUtils.kt
@@ -0,0 +1,13 @@
+/*
+ * 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.hierarchy.calls
+
+import com.intellij.ide.hierarchy.call.CallHierarchyNodeDescriptor
+import com.intellij.psi.PsiMember
+
+fun extractMemberFromDescriptor(nodeDescriptor: CallHierarchyNodeDescriptor): PsiMember? {
+ return nodeDescriptor.enclosingElement
+}
\ No newline at end of file
diff --git a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructureUtils.kt.192 b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructureUtils.kt.192
new file mode 100644
index 00000000000..3b6f9c8ee13
--- /dev/null
+++ b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeTreeStructureUtils.kt.192
@@ -0,0 +1,13 @@
+/*
+ * 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.hierarchy.calls
+
+import com.intellij.ide.hierarchy.call.CallHierarchyNodeDescriptor
+import com.intellij.psi.PsiMethod
+
+fun extractMemberFromDescriptor(nodeDescriptor: CallHierarchyNodeDescriptor): PsiMethod? {
+ return nodeDescriptor.enclosingElement as? PsiMethod
+}
\ No newline at end of file
diff --git a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCallerTreeStructure.kt b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCallerTreeStructure.kt
index f0490914cc7..5cf7fdb07bd 100644
--- a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCallerTreeStructure.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCallerTreeStructure.kt
@@ -65,8 +65,9 @@ class KotlinCallerTreeStructure(
callerToDescriptorMap: MutableMap>
): Collection {
if (nodeDescriptor is CallHierarchyNodeDescriptor) {
- val psiMethod: PsiMember = nodeDescriptor.enclosingElement as? PsiMethod ?: return emptyList()
- return CallerMethodsTreeStructure(myProject, psiMethod, scopeType).getChildElements(nodeDescriptor).toList()
+ val member /* : PsiMember in 193, : PsiMethod in 192 */ =
+ extractMemberFromDescriptor(nodeDescriptor) ?: return emptyList()
+ return CallerMethodsTreeStructure(myProject, member, scopeType).getChildElements(nodeDescriptor).toList()
}
if (element !is KtDeclaration) return emptyList()
diff --git a/idea/src/org/jetbrains/kotlin/idea/js/jsUtils.kt.192 b/idea/src/org/jetbrains/kotlin/idea/js/jsUtils.kt.192
new file mode 100644
index 00000000000..0aa204f5466
--- /dev/null
+++ b/idea/src/org/jetbrains/kotlin/idea/js/jsUtils.kt.192
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2010-2017 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.idea.js
+
+import com.intellij.openapi.module.Module
+import com.intellij.openapi.roots.CompilerModuleExtension
+import org.jetbrains.jps.util.JpsPathUtil
+import org.jetbrains.kotlin.idea.facet.KotlinFacet
+import org.jetbrains.kotlin.idea.framework.isGradleModule
+import org.jetbrains.kotlin.idea.project.platform
+import org.jetbrains.kotlin.platform.js.isJs
+import org.jetbrains.plugins.gradle.settings.GradleSystemRunningSettings
+
+val Module.jsTestOutputFilePath: String?
+ get() {
+ KotlinFacet.get(this)?.configuration?.settings?.testOutputPath?.let { return it }
+
+ if (!shouldUseJpsOutput) return null
+
+ val compilerExtension = CompilerModuleExtension.getInstance(this)
+ val outputDir = compilerExtension?.compilerOutputUrlForTests ?: return null
+ return JpsPathUtil.urlToPath("$outputDir/${name}_test.js")
+ }
+
+val Module.jsProductionOutputFilePath: String?
+ get() {
+ KotlinFacet.get(this)?.configuration?.settings?.productionOutputPath?.let { return it }
+
+ if (!shouldUseJpsOutput) return null
+
+ val compilerExtension = CompilerModuleExtension.getInstance(this)
+ val outputDir = compilerExtension?.compilerOutputUrl ?: return null
+ return JpsPathUtil.urlToPath("$outputDir/$name.js")
+ }
+
+fun Module.asJsModule(): Module? = takeIf { it.platform.isJs() }
+
+val Module.shouldUseJpsOutput: Boolean
+ get() = !(isGradleModule() && GradleSystemRunningSettings.getInstance().isUseGradleAwareMake)
\ No newline at end of file