diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/KotlinShortNamesCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/KotlinShortNamesCache.kt index 60d70dc8b4d..ae3293c4d4d 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/KotlinShortNamesCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/KotlinShortNamesCache.kt @@ -23,7 +23,6 @@ import com.intellij.psi.PsiClass import com.intellij.psi.PsiField import com.intellij.psi.PsiMethod import com.intellij.psi.search.GlobalSearchScope -import com.intellij.psi.search.PsiShortNamesCache import com.intellij.psi.stubs.StubIndex import com.intellij.util.ArrayUtil import com.intellij.util.Processor @@ -46,7 +45,7 @@ import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.KtNamedDeclaration import org.jetbrains.kotlin.psi.KtNamedFunction -class KotlinShortNamesCache(private val project: Project) : PsiShortNamesCache() { +class KotlinShortNamesCache(private val project: Project) : PsiShortNamesCacheWrapper() { //region Classes override fun processAllClassNames(processor: Processor): Boolean { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/PsiShortNamesCacheCompatibility.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/PsiShortNamesCacheCompatibility.kt new file mode 100644 index 00000000000..0cd4bfb85f4 --- /dev/null +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/PsiShortNamesCacheCompatibility.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.caches + +import com.intellij.psi.search.PsiShortNamesCache + +typealias PsiShortNamesCacheWrapper = PsiShortNamesCache + +/* +// Need to implement deprecated methods. Should be removed after abandoning 173 and AS 3.1 branch. +// BUNCH: 181 +@Suppress("OverridingDeprecatedMember", "DEPRECATION") +abstract class PsiShortNamesCacheCompatibility : PsiShortNamesCache() { + override fun getAllClassNames(dest: com.intellij.util.containers.HashSet) { + processAllClassNames(com.intellij.util.CommonProcessors.CollectProcessor(dest)) + } + + override fun getAllMethodNames(set: com.intellij.util.containers.HashSet) { + java.util.Collections.addAll(set, *allMethodNames) + } + + override fun getAllFieldNames(set: com.intellij.util.containers.HashSet) { + java.util.Collections.addAll(set, *allFieldNames) + } +} +*/ \ No newline at end of file diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/PsiShortNamesCacheCompatibility.kt.173 b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/PsiShortNamesCacheCompatibility.kt.173 new file mode 100644 index 00000000000..033f33f8cb1 --- /dev/null +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/PsiShortNamesCacheCompatibility.kt.173 @@ -0,0 +1,27 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.caches + +import com.intellij.psi.search.PsiShortNamesCache + +typealias PsiShortNamesCacheWrapper = PsiShortNamesCacheCompatibility + +// Need to implement deprecated methods. Should be removed after abandoning 173 and AS 3.1 branch. +// BUNCH: 181 +@Suppress("OverridingDeprecatedMember", "DEPRECATION") +abstract class PsiShortNamesCacheCompatibility : PsiShortNamesCache() { + override fun getAllClassNames(dest: com.intellij.util.containers.HashSet) { + processAllClassNames(com.intellij.util.CommonProcessors.CollectProcessor(dest)) + } + + override fun getAllMethodNames(set: com.intellij.util.containers.HashSet) { + java.util.Collections.addAll(set, *allMethodNames) + } + + override fun getAllFieldNames(set: com.intellij.util.containers.HashSet) { + java.util.Collections.addAll(set, *allFieldNames) + } +}