MapDataContext (VirtualFile f) { MapDataContext context = new MapDataContext(); context.put(CommonDataKeys.EDITOR, getEditor(f)); context.put(CommonDataKeys.PSI_FILE, getTestPsiFile(f)); context.put(CommonDataKeys.PSI_ELEMENT, TargetElementUtil.findTargetElement(getEditor(f), TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED | TargetElementUtil.ELEMENT_NAME_ACCEPTED)); return context; }