void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) { final PsiElement original = parameters.getOriginalPosition(); final int offset = parameters.getOffset(); if (original == null) return; final CompletionResultSet dictCompletion = createResult(original, result, offset); final PySubscriptionExpression subscription = PsiTreeUtil.getParentOfType(original, PySubscriptionExpression.class); if (subscription == null) return; final PyExpression operand = subscription.getOperand(); if (addCompletionIfOperandIsTypedDict(operand, subscription.getIndexExpression(), dictCompletion)) { return; } if (operand instanceof PyReferenceExpression) { final PyExpression resolvedElement = PyResolveUtil.fullResolveLocally((PyReferenceExpression)operand); if (resolvedElement instanceof PyDictLiteralExpression) { addDictLiteralKeys((PyDictLiteralExpression)resolvedElement, dictCompletion); addAdditionalKeys(parameters.getOriginalFile(), operand, dictCompletion); } if (resolvedElement instanceof PyCallExpression) { addDictConstructorKeys((PyCallExpression)resolvedElement, dictCompletion); addAdditionalKeys(parameters.getOriginalFile(), operand, dictCompletion); } } }