@Override public void execute(Editor editor, DataContext dataContext) { Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null) { return; } PsiFile psiFile = LangDataKeys.PSI_FILE.getData(dataContext); if (psiFile == null) { return; } process(psiFile, editor, project, editor.getCaretModel().getOffset()); }