PsiExpression (@Nullable PsiExpression expression) { expression = PsiUtil.skipParenthesizedExprDown(expression); if (expression instanceof PsiReferenceExpression reference && reference.resolve() instanceof PsiLocalVariable variable && !(variable instanceof PsiResourceVariable)) { PsiExpression initializer = variable.getInitializer(); if (initializer != null && ReferencesSearch.search(variable).allMatch(ref -> ref == reference)) { return initializer; } } return expression; }