void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (element instanceof PsiExpression) { VirtualFile virtualFile = element.getContainingFile().getVirtualFile(); Editor editor = FileEditorManager.getInstance(project).openTextEditor(new OpenFileDescriptor(project, virtualFile), true); if (editor != null) { JavaIntroduceVariableHandlerBase handler = (JavaIntroduceVariableHandlerBase)JavaRefactoringActionHandlerFactory.getInstance().createIntroduceVariableHandler(); handler.invoke(project, editor, (PsiExpression)element); } } }