private <B extends XBreakpoint<?>> XLineBreakpoint addXLineBreakpoint(Class<? extends XBreakpointType<B, ?>> typeCls, Document document, final int lineIndex, Consumer<XBreakpointProperties> propertiesSetup) {
    final XBreakpointType<B, ?> type = XDebuggerUtil.getInstance().findBreakpointType(typeCls);
    final VirtualFile file = FileDocumentManager.getInstance().getFile(document);
    return WriteAction.compute(() -> {
      var properties = ((XLineBreakpointType<?>)type).createBreakpointProperties(file, lineIndex);
      propertiesSetup.accept(properties);
      return XDebuggerManager.getInstance(myProject).getBreakpointManager()
        .addLineBreakpoint((XLineBreakpointType)type, file.getUrl(), lineIndex, properties);
    });
  }
private <B extends XBreakpoint<?>> XLineBreakpoint addXLineBreakpoint(Class<? extends XBreakpointType<B, ?>> typeCls, Document document, final int lineIndex, Consumer<XBreakpointProperties> propertiesSetup)