void (@NotNull Caret hostCaret, @Nullable DataContext context, @NotNull CaretTask task) { DataContext caretContext = context == null ? null : CaretSpecificDataContext.create(context, hostCaret); Editor editor = hostCaret.getEditor(); if (myWorksInInjected && caretContext != null) { DataContext injectedCaretContext = AnActionEvent.getInjectedDataContext(caretContext); Caret injectedCaret = CommonDataKeys.CARET.getData(injectedCaretContext); if (injectedCaret != null && injectedCaret != hostCaret && isEnabledForCaret(injectedCaret.getEditor(), injectedCaret, injectedCaretContext)) { task.perform(injectedCaret, injectedCaretContext); return; } } if (isEnabledForCaret(editor, hostCaret, caretContext)) { task.perform(hostCaret, caretContext); } }