CaretSpecificDataContext (@NotNull DataContext delegate, @NotNull Caret caret) { if (delegate instanceof CaretSpecificDataContext && CommonDataKeys.CARET.getData(delegate) == caret) { return (CaretSpecificDataContext)delegate; } return new CaretSpecificDataContext(delegate, caret); }