Rename: Support members of header/impl classes
#KT-18885 Fixed #KT-18898 Fixed #KT-18899 Fixed
This commit is contained in:
+12
-4
@@ -175,12 +175,20 @@ object HeaderImplDeclarationChecker : DeclarationChecker {
|
||||
findHeaderForImpl(this, commonModule)?.get(Compatible).orEmpty()
|
||||
|
||||
private fun CallableMemberDescriptor.findNamesakesFromModule(module: ModuleDescriptor): Collection<CallableMemberDescriptor> {
|
||||
val packageFqName = (containingDeclaration as? PackageFragmentDescriptor)?.fqName ?: return emptyList()
|
||||
val scope = module.getPackage(packageFqName).memberScope
|
||||
val containingDeclaration = containingDeclaration
|
||||
val scopes = when (containingDeclaration) {
|
||||
is PackageFragmentDescriptor -> {
|
||||
listOf(module.getPackage(containingDeclaration.fqName).memberScope)
|
||||
}
|
||||
is ClassDescriptor -> {
|
||||
containingDeclaration.findClassifiersFromModule(module).mapNotNull { (it as? ClassDescriptor)?.unsubstitutedMemberScope }
|
||||
}
|
||||
else -> return emptyList()
|
||||
}
|
||||
|
||||
return when (this) {
|
||||
is FunctionDescriptor -> scope.getContributedFunctions(name, NoLookupLocation.FOR_ALREADY_TRACKED)
|
||||
is PropertyDescriptor -> scope.getContributedVariables(name, NoLookupLocation.FOR_ALREADY_TRACKED)
|
||||
is FunctionDescriptor -> scopes.flatMap { it.getContributedFunctions(name, NoLookupLocation.FOR_ALREADY_TRACKED) }
|
||||
is PropertyDescriptor -> scopes.flatMap { it.getContributedVariables(name, NoLookupLocation.FOR_ALREADY_TRACKED) }
|
||||
else -> throw AssertionError("Unsupported declaration: $this")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package org.jetbrains.kotlin.idea.highlighter.markers
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.findModuleDescriptor
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptor
|
||||
import org.jetbrains.kotlin.idea.core.toDescriptor
|
||||
import org.jetbrains.kotlin.idea.highlighter.sourceKind
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.MultiTargetPlatform
|
||||
@@ -63,10 +63,20 @@ internal fun KtDeclaration.headerDeclarationIfAny(): KtDeclaration? {
|
||||
return DescriptorToSourceUtils.descriptorToDeclaration(headerDescriptor) as? KtDeclaration
|
||||
}
|
||||
|
||||
internal fun KtDeclaration.liftToHeader(): KtDeclaration? {
|
||||
return when {
|
||||
hasModifier(KtTokens.HEADER_KEYWORD) -> this
|
||||
hasModifier(KtTokens.IMPL_KEYWORD) -> headerDeclarationIfAny()
|
||||
else -> null
|
||||
private fun DeclarationDescriptor.liftToHeader(): DeclarationDescriptor? {
|
||||
if (this is MemberDescriptor) {
|
||||
return when {
|
||||
isHeader -> this
|
||||
isImpl -> headerDescriptor()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
internal fun KtDeclaration.liftToHeader(): KtDeclaration? {
|
||||
val descriptor = resolveToDescriptor()
|
||||
val headerDescriptor = descriptor.liftToHeader() ?: return null
|
||||
return DescriptorToSourceUtils.descriptorToDeclaration(headerDescriptor) as? KtDeclaration
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
fun baz()
|
||||
fun baz(n: Int)
|
||||
fun bar(n: Int)
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz()
|
||||
c.baz(1)
|
||||
c.bar(1)
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun baz() { }
|
||||
impl fun baz(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz()
|
||||
c.baz(1)
|
||||
c.bar(1)
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun baz() { }
|
||||
impl fun baz(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz()
|
||||
c.baz(1)
|
||||
c.bar(1)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
fun /*rename*/foo()
|
||||
fun foo(n: Int)
|
||||
fun bar(n: Int)
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo()
|
||||
c.foo(1)
|
||||
c.bar(1)
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun foo() { }
|
||||
impl fun foo(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo()
|
||||
c.foo(1)
|
||||
c.bar(1)
|
||||
}
|
||||
idea/testData/refactoring/renameMultiModule/headersAndImplsByHeaderClassMemberFun/before/JVM/JVM.iml
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun foo() { }
|
||||
impl fun foo(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo()
|
||||
c.foo(1)
|
||||
c.bar(1)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "MARKED_ELEMENT",
|
||||
"file": "Common/src/test/test.kt",
|
||||
"newName": "baz",
|
||||
"isMultiModule": "true"
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
var baz: Int
|
||||
var bar: Int
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz
|
||||
c.baz = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var baz: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz
|
||||
c.baz = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var baz: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz
|
||||
c.baz = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
var /*rename*/foo: Int
|
||||
var bar: Int
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo
|
||||
c.foo = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var foo: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo
|
||||
c.foo = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
idea/testData/refactoring/renameMultiModule/headersAndImplsByHeaderClassMemberVal/before/JVM/JVM.iml
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var foo: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo
|
||||
c.foo = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "MARKED_ELEMENT",
|
||||
"file": "Common/src/test/test.kt",
|
||||
"newName": "baz",
|
||||
"isMultiModule": "true"
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
fun baz()
|
||||
fun baz(n: Int)
|
||||
fun bar(n: Int)
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz()
|
||||
c.baz(1)
|
||||
c.bar(1)
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun baz() { }
|
||||
impl fun baz(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz()
|
||||
c.baz(1)
|
||||
c.bar(1)
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun baz() { }
|
||||
impl fun baz(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz()
|
||||
c.baz(1)
|
||||
c.bar(1)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
fun foo()
|
||||
fun foo(n: Int)
|
||||
fun bar(n: Int)
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo()
|
||||
c.foo(1)
|
||||
c.bar(1)
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun /*rename*/foo() { }
|
||||
impl fun foo(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo()
|
||||
c.foo(1)
|
||||
c.bar(1)
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl fun foo() { }
|
||||
impl fun foo(n: Int) { }
|
||||
impl fun bar(n: Int) { }
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo()
|
||||
c.foo(1)
|
||||
c.bar(1)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "MARKED_ELEMENT",
|
||||
"file": "JS/src/test/test.kt",
|
||||
"newName": "baz",
|
||||
"isMultiModule": "true"
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
var baz: Int
|
||||
var bar: Int
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz
|
||||
c.baz = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var baz: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz
|
||||
c.baz = 1
|
||||
bar
|
||||
bar = 1
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var baz: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.baz
|
||||
c.baz = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="Common (experimental) " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
header class C {
|
||||
var foo: Int
|
||||
var bar: Int
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo
|
||||
c.foo = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JavaScript " useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var /*rename*/foo: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo
|
||||
c.foo = 1
|
||||
bar
|
||||
bar = 1
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="2" platform="JVM 1.6" useProjectSettings="false">
|
||||
<compilerSettings/>
|
||||
<compilerArguments/>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Common" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
impl class C {
|
||||
impl var foo: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
|
||||
impl var bar: Int
|
||||
get() = 1
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
c.foo
|
||||
c.foo = 1
|
||||
c.bar
|
||||
c.bar = 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "MARKED_ELEMENT",
|
||||
"file": "JS/src/test/test.kt",
|
||||
"newName": "baz",
|
||||
"isMultiModule": "true"
|
||||
}
|
||||
+24
@@ -48,6 +48,18 @@ public class MultiModuleRenameTestGenerated extends AbstractMultiModuleRenameTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("headersAndImplsByHeaderClassMemberFun/headersAndImplsByHeaderClassMemberFun.test")
|
||||
public void testHeadersAndImplsByHeaderClassMemberFun_HeadersAndImplsByHeaderClassMemberFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/renameMultiModule/headersAndImplsByHeaderClassMemberFun/headersAndImplsByHeaderClassMemberFun.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("headersAndImplsByHeaderClassMemberVal/headersAndImplsByHeaderClassMemberVal.test")
|
||||
public void testHeadersAndImplsByHeaderClassMemberVal_HeadersAndImplsByHeaderClassMemberVal() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/renameMultiModule/headersAndImplsByHeaderClassMemberVal/headersAndImplsByHeaderClassMemberVal.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("headersAndImplsByHeaderFun/headersAndImplsByHeaderFun.test")
|
||||
public void testHeadersAndImplsByHeaderFun_HeadersAndImplsByHeaderFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/renameMultiModule/headersAndImplsByHeaderFun/headersAndImplsByHeaderFun.test");
|
||||
@@ -66,6 +78,18 @@ public class MultiModuleRenameTestGenerated extends AbstractMultiModuleRenameTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("headersAndImplsByImplClassMemberFun/headersAndImplsByImplClassMemberFun.test")
|
||||
public void testHeadersAndImplsByImplClassMemberFun_HeadersAndImplsByImplClassMemberFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/renameMultiModule/headersAndImplsByImplClassMemberFun/headersAndImplsByImplClassMemberFun.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("headersAndImplsByImplClassMemberVal/headersAndImplsByImplClassMemberVal.test")
|
||||
public void testHeadersAndImplsByImplClassMemberVal_HeadersAndImplsByImplClassMemberVal() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/renameMultiModule/headersAndImplsByImplClassMemberVal/headersAndImplsByImplClassMemberVal.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("headersAndImplsByImplFun/headersAndImplsByImplFun.test")
|
||||
public void testHeadersAndImplsByImplFun_HeadersAndImplsByImplFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/renameMultiModule/headersAndImplsByImplFun/headersAndImplsByImplFun.test");
|
||||
|
||||
Reference in New Issue
Block a user