Cleanup 191 patchset logic (KTI-267)

This commit is contained in:
Yunir Salimzyanov
2020-06-04 19:42:45 +03:00
parent 820353ee0e
commit dce19b0ace
35 changed files with 1004 additions and 1230 deletions
-4
View File
@@ -15,10 +15,6 @@ dependencies {
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) }
compileOnly(intellijDep()) { includeJars("platform-api", "platform-impl", rootProject = rootProject) }
Platform[191].orLower {
compileOnly(intellijDep()) { includeJars("java-api", "java-impl") }
}
Platform[192].orHigher {
compileOnly(intellijPluginDep("java")) { includeJars("java-api", "java-impl") }
testCompileOnly(intellijPluginDep("java")) { includeJars("java-api", "java-impl") }
@@ -23,6 +23,8 @@ import org.jetbrains.kotlin.idea.references.KtSimpleNameReference
import org.jetbrains.kotlin.idea.references.mainReference
import org.jetbrains.kotlin.idea.references.readWriteAccess
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
import org.jetbrains.kotlin.idea.search.or
import org.jetbrains.kotlin.idea.search.projectScope
import org.jetbrains.kotlin.idea.search.usagesSearch.descriptor
import org.jetbrains.kotlin.idea.util.CommentSaver
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
@@ -201,7 +203,8 @@ private class ConvertGettersAndSettersToPropertyStatefulProcessing(
private fun KtParameter.rename(newName: String) {
val renamer = RenamePsiElementProcessor.forElement(this)
val findReferences = findReferences(renamer)
val searchScope = project.projectScope() or useScope
val findReferences = renamer.findReferences(this, searchScope, false)
val usageInfos =
findReferences.mapNotNull { reference ->
val element = reference.element
@@ -1,19 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.nj2k.postProcessing.processings
import com.intellij.psi.PsiReference
import com.intellij.refactoring.rename.RenamePsiElementProcessor
import org.jetbrains.kotlin.idea.search.or
import org.jetbrains.kotlin.idea.search.projectScope
import org.jetbrains.kotlin.psi.KtParameter
// FIX ME WHEN BUNCH 191 REMOVED
internal fun KtParameter.findReferences(renamer: RenamePsiElementProcessor): MutableCollection<PsiReference> {
val searchScope = this.project.projectScope() or this.useScope
return renamer.findReferences(this, searchScope, false)
}