Dropped functions not needed anymore

This commit is contained in:
Valentin Kipyatkov
2014-11-26 21:06:10 +03:00
parent 52acd223a2
commit ed9dba2071
2 changed files with 0 additions and 31 deletions
@@ -46,34 +46,6 @@ public class KotlinIndicesHelper(
private val moduleDescriptor: ModuleDescriptor,
private val visibilityFilter: (DeclarationDescriptor) -> Boolean
) {
public fun getTopLevelObjects(nameFilter: (String) -> Boolean): Collection<ClassDescriptor> {
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<ClassDescriptor> {
val result = hashSetOf<ClassDescriptor>()
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<CallableDescriptor> {
val jetScope = bindingContext[BindingContext.RESOLUTION_SCOPE, context] ?: return listOf()
@@ -134,9 +134,6 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
protected fun getKotlinTopLevelCallables(): Collection<DeclarationDescriptor>
= indicesHelper.getTopLevelCallables({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression)
protected fun getKotlinTopLevelObjects(): Collection<DeclarationDescriptor>
= indicesHelper.getTopLevelObjects({ prefixMatcher.prefixMatches(it) })
protected fun getKotlinExtensions(): Collection<CallableDescriptor>
= indicesHelper.getCallableExtensions({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression)