No double-filtering
This commit is contained in:
@@ -211,11 +211,7 @@ class SmartCompletionSession(configuration: CompletionSessionConfiguration, para
|
||||
|
||||
val filter = result.declarationFilter
|
||||
if (filter != null) {
|
||||
getReferenceVariants(DESCRIPTOR_KIND_MASK).forEach {
|
||||
if (prefixMatcher.prefixMatches(it.getName().asString())) {
|
||||
collector.addElements(filter(it))
|
||||
}
|
||||
}
|
||||
getReferenceVariants(DESCRIPTOR_KIND_MASK).forEach { collector.addElements(filter(it)) }
|
||||
|
||||
flushToResultSet()
|
||||
|
||||
|
||||
@@ -107,8 +107,7 @@ class SmartCompletion(val expression: JetSimpleNameExpression,
|
||||
|
||||
fun filterDeclaration(descriptor: DeclarationDescriptor): Collection<LookupElement> {
|
||||
val result = ArrayList<LookupElement>()
|
||||
if (!itemsToSkip.contains(descriptor)
|
||||
&& descriptor !is SamConstructorDescriptor /* SAM-constructor is added explicitly and is not needed here */) {
|
||||
if (!itemsToSkip.contains(descriptor)) {
|
||||
val types = typesWithSmartCasts(descriptor)
|
||||
val nonNullTypes = types.map { it.makeNotNullable() }
|
||||
val classifier = { (expectedInfo: ExpectedInfo) ->
|
||||
|
||||
+5
-11
@@ -413,19 +413,13 @@ public class JetFunctionParameterInfoHandler implements ParameterInfoHandlerWith
|
||||
Collection<Pair<? extends DeclarationDescriptor, ResolveSessionForBodies>> itemsToShow = new ArrayList<Pair<? extends DeclarationDescriptor, ResolveSessionForBodies>>();
|
||||
for (DeclarationDescriptor variant : variants) {
|
||||
if (variant instanceof FunctionDescriptor) {
|
||||
FunctionDescriptor functionDescriptor = (FunctionDescriptor) variant;
|
||||
if (functionDescriptor.getName().equals(refName)) {
|
||||
//todo: renamed functions?
|
||||
itemsToShow.add(Pair.create(functionDescriptor, resolveSession));
|
||||
}
|
||||
//todo: renamed functions?
|
||||
itemsToShow.add(Pair.create((FunctionDescriptor) variant, resolveSession));
|
||||
}
|
||||
else if (variant instanceof ClassDescriptor) {
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) variant;
|
||||
if (classDescriptor.getName().equals(refName)) {
|
||||
//todo: renamed classes?
|
||||
for (ConstructorDescriptor constructorDescriptor : classDescriptor.getConstructors()) {
|
||||
itemsToShow.add(Pair.create(constructorDescriptor, resolveSession));
|
||||
}
|
||||
//todo: renamed classes?
|
||||
for (ConstructorDescriptor constructorDescriptor : ((ClassDescriptor) variant).getConstructors()) {
|
||||
itemsToShow.add(Pair.create(constructorDescriptor, resolveSession));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user