From ed9dba2071957f2eac00f645985f138cc34e5736 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 26 Nov 2014 21:06:10 +0300 Subject: [PATCH] Dropped functions not needed anymore --- .../jet/plugin/caches/KotlinIndicesHelper.kt | 28 ------------------- .../plugin/completion/CompletionSession.kt | 3 -- 2 files changed, 31 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/caches/KotlinIndicesHelper.kt b/idea/src/org/jetbrains/jet/plugin/caches/KotlinIndicesHelper.kt index be8c32ad41f..95443772473 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/KotlinIndicesHelper.kt +++ b/idea/src/org/jetbrains/jet/plugin/caches/KotlinIndicesHelper.kt @@ -46,34 +46,6 @@ public class KotlinIndicesHelper( private val moduleDescriptor: ModuleDescriptor, private val visibilityFilter: (DeclarationDescriptor) -> Boolean ) { - public fun getTopLevelObjects(nameFilter: (String) -> Boolean): Collection { - val allObjectNames = JetTopLevelObjectShortNameIndex.getInstance().getAllKeys(project).stream() + - JetFromJavaDescriptorHelper.getPossiblePackageDeclarationsNames(project, scope).stream() - return allObjectNames - .filter(nameFilter) - .toSet() - .flatMap { getTopLevelObjectsByName(it) } - } - - private fun getTopLevelObjectsByName(name: String): Collection { - val result = hashSetOf() - - val topObjects = JetTopLevelObjectShortNameIndex.getInstance().get(name, project, scope) - for (objectDeclaration in topObjects) { - val fqName = objectDeclaration.getFqName() ?: error("Local object declaration in JetTopLevelShortObjectNameIndex:${objectDeclaration.getText()}") - result.addAll(ResolveSessionUtils.getClassOrObjectDescriptorsByFqName(moduleDescriptor, fqName, ResolveSessionUtils.SINGLETON_FILTER)) - } - - for (psiClass in JetFromJavaDescriptorHelper.getCompiledClassesForTopLevelObjects(project, scope)) { - val qualifiedName = psiClass.getQualifiedName() - if (qualifiedName != null) { - result.addAll(ResolveSessionUtils.getClassOrObjectDescriptorsByFqName(moduleDescriptor, FqName(qualifiedName), ResolveSessionUtils.SINGLETON_FILTER)) - } - } - - return result.filter(visibilityFilter) - } - public fun getTopLevelCallablesByName(name: String, context: JetExpression /*TODO: to be dropped*/): Collection { val jetScope = bindingContext[BindingContext.RESOLUTION_SCOPE, context] ?: return listOf() diff --git a/idea/src/org/jetbrains/jet/plugin/completion/CompletionSession.kt b/idea/src/org/jetbrains/jet/plugin/completion/CompletionSession.kt index 8cf13536f10..671901f03e3 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/CompletionSession.kt +++ b/idea/src/org/jetbrains/jet/plugin/completion/CompletionSession.kt @@ -134,9 +134,6 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess protected fun getKotlinTopLevelCallables(): Collection = indicesHelper.getTopLevelCallables({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression) - protected fun getKotlinTopLevelObjects(): Collection - = indicesHelper.getTopLevelObjects({ prefixMatcher.prefixMatches(it) }) - protected fun getKotlinExtensions(): Collection = indicesHelper.getCallableExtensions({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression)