void (@NotNull PsiDeclarationStatement declaration) { final PsiElement[] declaredElements = declaration.getDeclaredElements(); for (PsiElement declaredElement : declaredElements) { if (declaredElement instanceof PsiVariable variable) { final PsiExpression initializer = variable.getInitializer(); if (wrappedExpression.equals(initializer)) { expectedType = variable.getType(); return; } } } }