Refactored ReferenceVariantsHelper to allow specifying receiver
This commit is contained in:
@@ -328,7 +328,8 @@ abstract class CompletionSession(protected val configuration: CompletionSessionC
|
||||
}
|
||||
|
||||
private fun Collection<CallableDescriptor>.filterShadowedNonImported(): Collection<CallableDescriptor> {
|
||||
return ShadowedDeclarationsFilter(bindingContext, resolutionFacade).filterNonImported(this, referenceVariants, nameExpression!!)
|
||||
val explicitReceiverData = ReferenceVariantsHelper.getExplicitReceiverData(nameExpression!!)
|
||||
return ShadowedDeclarationsFilter(bindingContext, resolutionFacade, nameExpression, explicitReceiverData).filterNonImported(this, referenceVariants)
|
||||
}
|
||||
|
||||
protected fun addAllClasses(kindFilter: (ClassKind) -> Boolean) {
|
||||
|
||||
+3
-3
@@ -90,9 +90,9 @@ class SmartCompletionSession(configuration: CompletionSessionConfiguration, para
|
||||
// special completion for outside parenthesis lambda argument
|
||||
private fun addFunctionLiteralArgumentCompletions() {
|
||||
if (nameExpression != null) {
|
||||
val receiverData = ReferenceVariantsHelper.getExplicitReceiverData(nameExpression)
|
||||
if (receiverData != null && receiverData.second == CallType.INFIX) {
|
||||
val call = receiverData.first.getCall(bindingContext)
|
||||
val (receiverExpression, callType) = ReferenceVariantsHelper.getExplicitReceiverData(nameExpression) ?: return
|
||||
if (callType == CallType.INFIX) {
|
||||
val call = receiverExpression.getCall(bindingContext)
|
||||
if (call != null && call.getFunctionLiteralArguments().isEmpty()) {
|
||||
val dummyArgument = object : FunctionLiteralArgument {
|
||||
override fun getFunctionLiteral() = throw UnsupportedOperationException()
|
||||
|
||||
Reference in New Issue
Block a user