Safe Delete: Support header/impl declarations
#KT-18433 Fixed
This commit is contained in:
@@ -131,6 +131,7 @@ import org.jetbrains.kotlin.idea.refactoring.pullUp.AbstractPullUpTest
|
|||||||
import org.jetbrains.kotlin.idea.refactoring.pushDown.AbstractPushDownTest
|
import org.jetbrains.kotlin.idea.refactoring.pushDown.AbstractPushDownTest
|
||||||
import org.jetbrains.kotlin.idea.refactoring.rename.AbstractMultiModuleRenameTest
|
import org.jetbrains.kotlin.idea.refactoring.rename.AbstractMultiModuleRenameTest
|
||||||
import org.jetbrains.kotlin.idea.refactoring.rename.AbstractRenameTest
|
import org.jetbrains.kotlin.idea.refactoring.rename.AbstractRenameTest
|
||||||
|
import org.jetbrains.kotlin.idea.refactoring.safeDelete.AbstractMultiModuleSafeDeleteTest
|
||||||
import org.jetbrains.kotlin.idea.refactoring.safeDelete.AbstractSafeDeleteTest
|
import org.jetbrains.kotlin.idea.refactoring.safeDelete.AbstractSafeDeleteTest
|
||||||
import org.jetbrains.kotlin.idea.repl.AbstractIdeReplCompletionTest
|
import org.jetbrains.kotlin.idea.repl.AbstractIdeReplCompletionTest
|
||||||
import org.jetbrains.kotlin.idea.resolve.*
|
import org.jetbrains.kotlin.idea.resolve.*
|
||||||
@@ -794,6 +795,10 @@ fun main(args: Array<String>) {
|
|||||||
model("refactoring/copyMultiModule", extension = "test", singleClass = true)
|
model("refactoring/copyMultiModule", extension = "test", singleClass = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testClass<AbstractMultiModuleSafeDeleteTest> {
|
||||||
|
model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true)
|
||||||
|
}
|
||||||
|
|
||||||
testClass<AbstractMultiFileIntentionTest> {
|
testClass<AbstractMultiFileIntentionTest> {
|
||||||
model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true)
|
model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -58,7 +58,7 @@ class KotlinJavaSafeDeleteDelegate : JavaSafeDeleteDelegate {
|
|||||||
|
|
||||||
val namedArguments = args.filter { arg -> arg is KtValueArgument && arg.getArgumentName()?.text == parameter.name }
|
val namedArguments = args.filter { arg -> arg is KtValueArgument && arg.getArgumentName()?.text == parameter.name }
|
||||||
if (!namedArguments.isEmpty()) {
|
if (!namedArguments.isEmpty()) {
|
||||||
usages.add(SafeDeleteValueArgumentListUsageInfo(namedArguments.first(), parameter))
|
usages.add(SafeDeleteValueArgumentListUsageInfo(parameter, namedArguments.first()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ class KotlinJavaSafeDeleteDelegate : JavaSafeDeleteDelegate {
|
|||||||
|
|
||||||
val argCount = args.size
|
val argCount = args.size
|
||||||
if (parameterIndex < argCount) {
|
if (parameterIndex < argCount) {
|
||||||
usages.add(SafeDeleteValueArgumentListUsageInfo((args[parameterIndex] as KtValueArgument), parameter))
|
usages.add(SafeDeleteValueArgumentListUsageInfo(parameter, args[parameterIndex] as KtValueArgument))
|
||||||
} else {
|
} else {
|
||||||
val lambdaArgs = callExpression.lambdaArguments
|
val lambdaArgs = callExpression.lambdaArguments
|
||||||
val lambdaIndex = parameterIndex - argCount
|
val lambdaIndex = parameterIndex - argCount
|
||||||
|
|||||||
+119
-24
@@ -19,13 +19,13 @@ package org.jetbrains.kotlin.idea.refactoring.safeDelete
|
|||||||
import com.intellij.openapi.application.ApplicationManager
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
import com.intellij.openapi.module.Module
|
import com.intellij.openapi.module.Module
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
|
import com.intellij.openapi.ui.Messages
|
||||||
import com.intellij.openapi.util.Condition
|
import com.intellij.openapi.util.Condition
|
||||||
import com.intellij.openapi.util.Conditions
|
import com.intellij.openapi.util.Conditions
|
||||||
import com.intellij.psi.PsiClass
|
import com.intellij.openapi.util.Key
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.*
|
||||||
import com.intellij.psi.PsiMethod
|
|
||||||
import com.intellij.psi.PsiParameter
|
|
||||||
import com.intellij.psi.search.searches.ReferencesSearch
|
import com.intellij.psi.search.searches.ReferencesSearch
|
||||||
|
import com.intellij.refactoring.RefactoringBundle
|
||||||
import com.intellij.refactoring.safeDelete.JavaSafeDeleteProcessor
|
import com.intellij.refactoring.safeDelete.JavaSafeDeleteProcessor
|
||||||
import com.intellij.refactoring.safeDelete.NonCodeUsageSearchInfo
|
import com.intellij.refactoring.safeDelete.NonCodeUsageSearchInfo
|
||||||
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteOverrideAnnotation
|
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteOverrideAnnotation
|
||||||
@@ -33,27 +33,43 @@ import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteOverridingMethodU
|
|||||||
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceJavaDeleteUsageInfo
|
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceJavaDeleteUsageInfo
|
||||||
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceSimpleDeleteUsageInfo
|
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceSimpleDeleteUsageInfo
|
||||||
import com.intellij.usageView.UsageInfo
|
import com.intellij.usageView.UsageInfo
|
||||||
|
import org.jetbrains.annotations.TestOnly
|
||||||
import org.jetbrains.kotlin.asJava.*
|
import org.jetbrains.kotlin.asJava.*
|
||||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.Modality
|
import org.jetbrains.kotlin.descriptors.Modality
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||||
import org.jetbrains.kotlin.idea.core.deleteElementAndCleanParent
|
import org.jetbrains.kotlin.idea.core.deleteElementAndCleanParent
|
||||||
|
import org.jetbrains.kotlin.idea.highlighter.markers.headerImplementations
|
||||||
|
import org.jetbrains.kotlin.idea.highlighter.markers.liftToHeader
|
||||||
import org.jetbrains.kotlin.idea.refactoring.checkSuperMethods
|
import org.jetbrains.kotlin.idea.refactoring.checkSuperMethods
|
||||||
import org.jetbrains.kotlin.idea.refactoring.formatClass
|
import org.jetbrains.kotlin.idea.refactoring.formatClass
|
||||||
import org.jetbrains.kotlin.idea.refactoring.formatFunction
|
import org.jetbrains.kotlin.idea.refactoring.formatFunction
|
||||||
|
import org.jetbrains.kotlin.idea.refactoring.withHeaderImplementations
|
||||||
import org.jetbrains.kotlin.idea.references.KtReference
|
import org.jetbrains.kotlin.idea.references.KtReference
|
||||||
|
import org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinReferencesSearchOptions
|
||||||
|
import org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinReferencesSearchParameters
|
||||||
import org.jetbrains.kotlin.idea.search.usagesSearch.processDelegationCallConstructorUsages
|
import org.jetbrains.kotlin.idea.search.usagesSearch.processDelegationCallConstructorUsages
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfTypeAndBranch
|
import org.jetbrains.kotlin.psi.psiUtil.getParentOfTypeAndBranch
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.parameterIndex
|
||||||
import org.jetbrains.kotlin.resolve.BindingContext
|
import org.jetbrains.kotlin.resolve.BindingContext
|
||||||
|
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||||
import org.jetbrains.kotlin.utils.SmartSet
|
import org.jetbrains.kotlin.utils.SmartSet
|
||||||
import org.jetbrains.kotlin.utils.ifEmpty
|
import org.jetbrains.kotlin.utils.ifEmpty
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
||||||
|
companion object {
|
||||||
|
@set:TestOnly
|
||||||
|
internal var Project.ALLOW_LIFTING_IMPL_PARAMETER_TO_HEADER
|
||||||
|
by NotNullableUserDataProperty(Key.create("ALLOW_LIFTING_IMPL_PARAMETER_TO_HEADER"), true)
|
||||||
|
|
||||||
|
private var KtDeclaration.dropImplModifier: Boolean? by UserDataProperty(Key.create("DROP_IMPL_MODIFIER"))
|
||||||
|
}
|
||||||
|
|
||||||
override fun handlesElement(element: PsiElement): Boolean = element.canDeleteElement()
|
override fun handlesElement(element: PsiElement): Boolean = element.canDeleteElement()
|
||||||
|
|
||||||
override fun findUsages(
|
override fun findUsages(
|
||||||
@@ -69,6 +85,50 @@ class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
|||||||
|
|
||||||
fun getSearchInfo(element: PsiElement) = NonCodeUsageSearchInfo(getIgnoranceCondition(), element)
|
fun getSearchInfo(element: PsiElement) = NonCodeUsageSearchInfo(getIgnoranceCondition(), element)
|
||||||
|
|
||||||
|
fun searchKotlinDeclarationReferences(declaration: KtDeclaration): Sequence<PsiReference> {
|
||||||
|
val elementsToSearch = if (declaration is KtParameter) declaration.withHeaderImplementations() else listOf(declaration)
|
||||||
|
return elementsToSearch.asSequence().flatMap {
|
||||||
|
val searchParameters = KotlinReferencesSearchParameters(
|
||||||
|
it,
|
||||||
|
it.useScope,
|
||||||
|
kotlinOptions = KotlinReferencesSearchOptions(acceptCallableOverrides = true)
|
||||||
|
)
|
||||||
|
ReferencesSearch.search(searchParameters)
|
||||||
|
.asSequence()
|
||||||
|
.filterNot { reference -> getIgnoranceCondition().value(reference.element) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun findKotlinParameterUsages(parameter: KtParameter) {
|
||||||
|
val ownerFunction = parameter.ownerFunction as? KtFunction ?: return
|
||||||
|
val index = parameter.parameterIndex()
|
||||||
|
for (reference in searchKotlinDeclarationReferences(ownerFunction)) {
|
||||||
|
val callee = reference.element as? KtExpression ?: continue
|
||||||
|
val resolvedCall = callee.getResolvedCall(callee.analyze()) ?: continue
|
||||||
|
val parameterDescriptor = resolvedCall.candidateDescriptor.valueParameters.getOrNull(index) ?: continue
|
||||||
|
val resolvedArgument = resolvedCall.valueArguments[parameterDescriptor] ?: continue
|
||||||
|
val arguments = resolvedArgument.arguments.filterIsInstance<KtValueArgument>()
|
||||||
|
if (arguments.isEmpty()) continue
|
||||||
|
|
||||||
|
usages.add(SafeDeleteValueArgumentListUsageInfo(parameter, *arguments.toTypedArray()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun findKotlinDeclarationUsages(declaration: KtDeclaration): NonCodeUsageSearchInfo {
|
||||||
|
searchKotlinDeclarationReferences(declaration).mapNotNullTo(usages) { reference ->
|
||||||
|
val refElement = reference.element ?: return@mapNotNullTo null
|
||||||
|
refElement.getNonStrictParentOfType<KtImportDirective>()?.let { importDirective ->
|
||||||
|
SafeDeleteImportDirectiveUsageInfo(importDirective, element)
|
||||||
|
} ?: SafeDeleteReferenceSimpleDeleteUsageInfo(refElement, declaration, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (declaration is KtParameter) {
|
||||||
|
findKotlinParameterUsages(declaration)
|
||||||
|
}
|
||||||
|
|
||||||
|
return getSearchInfo(declaration)
|
||||||
|
}
|
||||||
|
|
||||||
fun findUsagesByJavaProcessor(element: PsiElement, forceReferencedElementUnwrapping: Boolean): NonCodeUsageSearchInfo? {
|
fun findUsagesByJavaProcessor(element: PsiElement, forceReferencedElementUnwrapping: Boolean): NonCodeUsageSearchInfo? {
|
||||||
val javaUsages = ArrayList<UsageInfo>()
|
val javaUsages = ArrayList<UsageInfo>()
|
||||||
val searchInfo = super.findUsages(element, allElementsToDelete, javaUsages)
|
val searchInfo = super.findUsages(element, allElementsToDelete, javaUsages)
|
||||||
@@ -122,29 +182,19 @@ class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
|||||||
.fold(insideDeleted) { condition1, condition2 -> Conditions.or(condition1, condition2) }
|
.fold(insideDeleted) { condition1, condition2 -> Conditions.or(condition1, condition2) }
|
||||||
|
|
||||||
fun findUsagesByJavaProcessor(ktDeclaration: KtDeclaration): NonCodeUsageSearchInfo {
|
fun findUsagesByJavaProcessor(ktDeclaration: KtDeclaration): NonCodeUsageSearchInfo {
|
||||||
|
val lightElements = ktDeclaration.toLightElements()
|
||||||
|
if (lightElements.isEmpty()) {
|
||||||
|
return findKotlinDeclarationUsages(ktDeclaration)
|
||||||
|
}
|
||||||
return NonCodeUsageSearchInfo(
|
return NonCodeUsageSearchInfo(
|
||||||
findUsagesByJavaProcessor(
|
findUsagesByJavaProcessor(
|
||||||
ktDeclaration.toLightElements().asSequence(),
|
lightElements.asSequence(),
|
||||||
getIgnoranceCondition()
|
getIgnoranceCondition()
|
||||||
),
|
),
|
||||||
ktDeclaration
|
ktDeclaration
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findKotlinDeclarationUsages(declaration: KtDeclaration): NonCodeUsageSearchInfo {
|
|
||||||
ReferencesSearch.search(declaration, declaration.useScope)
|
|
||||||
.asSequence()
|
|
||||||
.filterNot { reference -> getIgnoranceCondition().value(reference.element) }
|
|
||||||
.mapNotNullTo(usages) { reference ->
|
|
||||||
val refElement = reference.element ?: return@mapNotNullTo null
|
|
||||||
refElement.getNonStrictParentOfType<KtImportDirective>()?.let { importDirective ->
|
|
||||||
SafeDeleteImportDirectiveUsageInfo(importDirective, element)
|
|
||||||
} ?: SafeDeleteReferenceSimpleDeleteUsageInfo(refElement, declaration, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
return getSearchInfo(declaration)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun findTypeParameterUsages(parameter: KtTypeParameter) {
|
fun findTypeParameterUsages(parameter: KtTypeParameter) {
|
||||||
val owner = parameter.getNonStrictParentOfType<KtTypeParameterListOwner>() ?: return
|
val owner = parameter.getNonStrictParentOfType<KtTypeParameterListOwner>() ?: return
|
||||||
|
|
||||||
@@ -189,14 +239,14 @@ class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
|||||||
element.toLightClass()?.let { klass ->
|
element.toLightClass()?.let { klass ->
|
||||||
findDelegationCallUsages(klass)
|
findDelegationCallUsages(klass)
|
||||||
findUsagesByJavaProcessor(klass, false)
|
findUsagesByJavaProcessor(klass, false)
|
||||||
}
|
} ?: findKotlinDeclarationUsages(element)
|
||||||
}
|
}
|
||||||
|
|
||||||
is KtSecondaryConstructor -> {
|
is KtSecondaryConstructor -> {
|
||||||
element.getRepresentativeLightMethod()?.let { method ->
|
element.getRepresentativeLightMethod()?.let { method ->
|
||||||
findDelegationCallUsages(method)
|
findDelegationCallUsages(method)
|
||||||
findUsagesByJavaProcessor(method, false)
|
findUsagesByJavaProcessor(method, false)
|
||||||
}
|
} ?: findKotlinDeclarationUsages(element)
|
||||||
}
|
}
|
||||||
|
|
||||||
is KtNamedFunction -> {
|
is KtNamedFunction -> {
|
||||||
@@ -204,7 +254,13 @@ class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
|||||||
findKotlinDeclarationUsages(element)
|
findKotlinDeclarationUsages(element)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
element.toLightMethods().map { method -> findUsagesByJavaProcessor(method, false) }.firstOrNull()
|
val lightMethods = element.toLightMethods()
|
||||||
|
if (lightMethods.isNotEmpty()) {
|
||||||
|
lightMethods.map { method -> findUsagesByJavaProcessor(method, false) }.firstOrNull()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
findKotlinDeclarationUsages(element)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,6 +361,17 @@ class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun prepareForDeletion(element: PsiElement) {
|
override fun prepareForDeletion(element: PsiElement) {
|
||||||
|
if (element is KtDeclaration) {
|
||||||
|
element.headerImplementations().forEach {
|
||||||
|
if (it is KtParameter) {
|
||||||
|
(it.parent as? KtParameterList)?.removeParameter(it)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
it.removeModifier(KtTokens.IMPL_KEYWORD)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
when (element) {
|
when (element) {
|
||||||
is PsiMethod -> element.cleanUpOverrides()
|
is PsiMethod -> element.cleanUpOverrides()
|
||||||
|
|
||||||
@@ -321,19 +388,47 @@ class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
|||||||
is KtTypeParameter ->
|
is KtTypeParameter ->
|
||||||
element.deleteElementAndCleanParent()
|
element.deleteElementAndCleanParent()
|
||||||
|
|
||||||
is KtParameter ->
|
is KtParameter -> {
|
||||||
|
element.ownerFunction?.let {
|
||||||
|
if (it.dropImplModifier == true) {
|
||||||
|
it.removeModifier(KtTokens.IMPL_KEYWORD)
|
||||||
|
it.dropImplModifier = null
|
||||||
|
}
|
||||||
|
}
|
||||||
(element.parent as KtParameterList).removeParameter(element)
|
(element.parent as KtParameterList).removeParameter(element)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun shouldAllowPropagationToHeader(parameter: KtParameter): Boolean {
|
||||||
|
if (ApplicationManager.getApplication().isUnitTestMode) return parameter.project.ALLOW_LIFTING_IMPL_PARAMETER_TO_HEADER
|
||||||
|
|
||||||
|
return Messages.showYesNoDialog(
|
||||||
|
"Do you want to delete this parameter in header declaration and all its implementations?",
|
||||||
|
RefactoringBundle.message("safe.delete.title"),
|
||||||
|
Messages.getQuestionIcon()
|
||||||
|
) == Messages.YES
|
||||||
|
}
|
||||||
|
|
||||||
override fun getElementsToSearch(
|
override fun getElementsToSearch(
|
||||||
element: PsiElement, module: Module?, allElementsToDelete: Collection<PsiElement>
|
element: PsiElement, module: Module?, allElementsToDelete: Collection<PsiElement>
|
||||||
): Collection<PsiElement>? {
|
): Collection<PsiElement>? {
|
||||||
when (element) {
|
when (element) {
|
||||||
is KtParameter ->
|
is KtParameter -> {
|
||||||
|
val headerParameter = element.liftToHeader() as? KtParameter
|
||||||
|
if (headerParameter != null && headerParameter != element) {
|
||||||
|
if (shouldAllowPropagationToHeader(element)) {
|
||||||
|
return listOf(headerParameter)
|
||||||
|
} else {
|
||||||
|
element.ownerFunction?.dropImplModifier = true
|
||||||
|
return listOf(element)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return element.toPsiParameters().flatMap { psiParameter ->
|
return element.toPsiParameters().flatMap { psiParameter ->
|
||||||
checkParametersInMethodHierarchy(psiParameter) ?: emptyList()
|
checkParametersInMethodHierarchy(psiParameter) ?: emptyList()
|
||||||
}.ifEmpty { listOf(element) }
|
}.ifEmpty { listOf(element) }
|
||||||
|
}
|
||||||
|
|
||||||
is PsiParameter ->
|
is PsiParameter ->
|
||||||
return checkParametersInMethodHierarchy(element)
|
return checkParametersInMethodHierarchy(element)
|
||||||
|
|||||||
+15
-9
@@ -20,18 +20,24 @@ import com.intellij.psi.PsiElement
|
|||||||
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceSimpleDeleteUsageInfo
|
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceSimpleDeleteUsageInfo
|
||||||
import org.jetbrains.kotlin.psi.KtValueArgument
|
import org.jetbrains.kotlin.psi.KtValueArgument
|
||||||
import org.jetbrains.kotlin.psi.KtValueArgumentList
|
import org.jetbrains.kotlin.psi.KtValueArgumentList
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer
|
||||||
|
|
||||||
class SafeDeleteValueArgumentListUsageInfo(
|
class SafeDeleteValueArgumentListUsageInfo(
|
||||||
valueArgument: KtValueArgument, parameter: PsiElement
|
parameter: PsiElement,
|
||||||
) : SafeDeleteReferenceSimpleDeleteUsageInfo(valueArgument, parameter, true) {
|
vararg valueArguments: KtValueArgument
|
||||||
|
) : SafeDeleteReferenceSimpleDeleteUsageInfo(valueArguments.first(), parameter, true) {
|
||||||
|
private val valueArgumentPointers = valueArguments.map { it.createSmartPointer() }
|
||||||
|
|
||||||
override fun deleteElement() {
|
override fun deleteElement() {
|
||||||
val element = element as? KtValueArgument ?: return
|
for (valueArgumentPointer in valueArgumentPointers) {
|
||||||
val parent = element.parent
|
val valueArgument = valueArgumentPointer.element ?: return
|
||||||
if (parent is KtValueArgumentList) {
|
val parent = valueArgument.parent
|
||||||
parent.removeArgument(element)
|
if (parent is KtValueArgumentList) {
|
||||||
}
|
parent.removeArgument(valueArgument)
|
||||||
else {
|
}
|
||||||
element.delete()
|
else {
|
||||||
|
valueArgument.delete()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+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>
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class ChildOfFoo : Foo()
|
||||||
+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>
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
open class Foo
|
||||||
|
impl class ChildOfFoo : Foo()
|
||||||
+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>
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
open class Foo
|
||||||
|
impl class ChildOfFoo : Foo()
|
||||||
+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>
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header open class <caret>Foo
|
||||||
|
header class ChildOfFoo : Foo()
|
||||||
+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>
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl open class Foo
|
||||||
|
impl class ChildOfFoo : Foo()
|
||||||
+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>
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl open class Foo
|
||||||
|
impl class ChildOfFoo : Foo()
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"mainFile": "Common/src/test/test.kt",
|
||||||
|
"elementClass": "org.jetbrains.kotlin.psi.KtClass"
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
class test.Foo has 3 usages that are not safe to delete.
|
||||||
Vendored
+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>
|
||||||
idea/testData/refactoring/safeDeleteMultiModule/byHeaderClassMemberFun/after/Common/src/test/test.kt
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
}
|
||||||
+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>
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
fun foo(n: Int) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
}
|
||||||
+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>
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
fun foo(n: Int) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
}
|
||||||
Vendored
+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>
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
fun <caret>foo(n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
}
|
||||||
+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>
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl fun foo(n: Int) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
}
|
||||||
+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>
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl fun foo(n: Int) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
}
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"mainFile": "Common/src/test/test.kt",
|
||||||
|
"elementClass": "org.jetbrains.kotlin.psi.KtNamedFunction"
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
function Foo.foo(Int) has 3 usages that are not safe to delete.
|
||||||
+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>
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo()
|
||||||
|
f.foo()
|
||||||
|
}
|
||||||
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>
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl fun foo() {
|
||||||
|
n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo()
|
||||||
|
f.foo()
|
||||||
|
}
|
||||||
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>
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl fun foo() {
|
||||||
|
n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo()
|
||||||
|
f.foo()
|
||||||
|
}
|
||||||
+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>
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
fun foo(<caret>n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
f.foo(n = 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>
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl fun foo(n: Int) {
|
||||||
|
n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
f.foo(n = 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>
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl fun foo(n: Int) {
|
||||||
|
n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) {
|
||||||
|
f.foo(1)
|
||||||
|
f.foo(n = 1)
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"mainFile": "Common/src/test/test.kt",
|
||||||
|
"elementClass": "org.jetbrains.kotlin.psi.KtParameter"
|
||||||
|
}
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
parameter n has 2 usages that are not safe to delete.
|
||||||
Vendored
+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>
|
||||||
idea/testData/refactoring/safeDeleteMultiModule/byHeaderClassMemberVal/after/Common/src/test/test.kt
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) = f.foo
|
||||||
+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>
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
val foo get() = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) = f.foo
|
||||||
+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>
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
val foo get() = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) = f.foo
|
||||||
Vendored
+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>
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
val <caret>foo: Int
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) = f.foo
|
||||||
+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>
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl val foo get() = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) = f.foo
|
||||||
+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>
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo {
|
||||||
|
impl val foo get() = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(f: Foo) = f.foo
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"mainFile": "Common/src/test/test.kt",
|
||||||
|
"elementClass": "org.jetbrains.kotlin.psi.KtProperty"
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
property Foo.foo has 3 usages that are not safe to delete.
|
||||||
+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>
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo()
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo()
|
||||||
|
Foo()
|
||||||
|
}
|
||||||
+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 Foo() {
|
||||||
|
val x = n + 1
|
||||||
|
constructor(s: String): this(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo()
|
||||||
|
Foo()
|
||||||
|
}
|
||||||
+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>
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo(s: String) {
|
||||||
|
constructor(): this("") {
|
||||||
|
val x = n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo()
|
||||||
|
Foo()
|
||||||
|
}
|
||||||
+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>
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo(<caret>n: Int)
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo(1)
|
||||||
|
Foo(n = 1)
|
||||||
|
}
|
||||||
+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 Foo(n: Int) {
|
||||||
|
val x = n + 1
|
||||||
|
constructor(s: String): this(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo(1)
|
||||||
|
Foo(n = 1)
|
||||||
|
}
|
||||||
+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>
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo(s: String) {
|
||||||
|
constructor(n: Int): this("") {
|
||||||
|
val x = n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo(1)
|
||||||
|
Foo(n = 1)
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
parameter n has 2 usages that are not safe to delete.
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"mainFile": "Common/src/test/test.kt",
|
||||||
|
"elementClass": "org.jetbrains.kotlin.psi.KtParameter"
|
||||||
|
}
|
||||||
+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>
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header open class Foo {
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() = Foo(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>
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl open class Foo {
|
||||||
|
constructor(n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() = Foo(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>
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl open class Foo {
|
||||||
|
constructor(n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() = Foo(2)
|
||||||
+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>
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header open class Foo {
|
||||||
|
<caret>constructor(n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() = Foo(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>
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl open class Foo {
|
||||||
|
impl constructor(n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() = Foo(1)
|
||||||
idea/testData/refactoring/safeDeleteMultiModule/byHeaderClassSecondaryConstructor/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>
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl open class Foo {
|
||||||
|
impl constructor(n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() = Foo(2)
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"mainFile": "Common/src/test/test.kt",
|
||||||
|
"elementClass": "org.jetbrains.kotlin.psi.KtSecondaryConstructor"
|
||||||
|
}
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
constructor Foo(Int) has 3 usages that are not safe to delete.
|
||||||
+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>
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
constructor()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo()
|
||||||
|
Foo()
|
||||||
|
}
|
||||||
+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 Foo() {
|
||||||
|
val x = n + 1
|
||||||
|
constructor(s: String): this(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo()
|
||||||
|
Foo()
|
||||||
|
}
|
||||||
+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>
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo(s: String) {
|
||||||
|
constructor(): this("") {
|
||||||
|
val x = n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo()
|
||||||
|
Foo()
|
||||||
|
}
|
||||||
+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>
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
header class Foo {
|
||||||
|
constructor(<caret>n: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo(1)
|
||||||
|
Foo(n = 1)
|
||||||
|
}
|
||||||
+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 Foo(n: Int) {
|
||||||
|
val x = n + 1
|
||||||
|
constructor(s: String): this(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo(1)
|
||||||
|
Foo(n = 1)
|
||||||
|
}
|
||||||
+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>
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
impl class Foo(s: String) {
|
||||||
|
constructor(n: Int): this("") {
|
||||||
|
val x = n + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
Foo("1")
|
||||||
|
Foo(s = "1")
|
||||||
|
Foo(1)
|
||||||
|
Foo(n = 1)
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user