Dropped functions not needed anymore
This commit is contained in:
@@ -46,34 +46,6 @@ public class KotlinIndicesHelper(
|
|||||||
private val moduleDescriptor: ModuleDescriptor,
|
private val moduleDescriptor: ModuleDescriptor,
|
||||||
private val visibilityFilter: (DeclarationDescriptor) -> Boolean
|
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> {
|
public fun getTopLevelCallablesByName(name: String, context: JetExpression /*TODO: to be dropped*/): Collection<CallableDescriptor> {
|
||||||
val jetScope = bindingContext[BindingContext.RESOLUTION_SCOPE, context] ?: return listOf()
|
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>
|
protected fun getKotlinTopLevelCallables(): Collection<DeclarationDescriptor>
|
||||||
= indicesHelper.getTopLevelCallables({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression)
|
= indicesHelper.getTopLevelCallables({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression)
|
||||||
|
|
||||||
protected fun getKotlinTopLevelObjects(): Collection<DeclarationDescriptor>
|
|
||||||
= indicesHelper.getTopLevelObjects({ prefixMatcher.prefixMatches(it) })
|
|
||||||
|
|
||||||
protected fun getKotlinExtensions(): Collection<CallableDescriptor>
|
protected fun getKotlinExtensions(): Collection<CallableDescriptor>
|
||||||
= indicesHelper.getCallableExtensions({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression)
|
= indicesHelper.getCallableExtensions({ prefixMatcher.prefixMatches(it) }, jetReference!!.expression)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user