@Override public void unregisterBreakpoint(@NotNull XLineBreakpoint<DlvBreakpointProperties> breakpoint, boolean temporary) { XSourcePosition breakpointPosition = breakpoint.getSourcePosition(); if (breakpointPosition == null) return; Integer id = breakpoint.getUserData(ID); if (id == null) return; // obsolete breakpoint.putUserData(ID, null); breakpoints.remove(id); send(new DlvRequest.ClearBreakpoint(id)); } }
@Override public void unregisterBreakpoint( @NotNull XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint, boolean temporary) { // If the state was set to disabled as a result of a server update, // then we do not need to update the server side. if (!ideBreakpoint.getProperties().isDisabledByServer()) { String breakpointId = ideBreakpoint.getUserData(CLOUD_ID); if (!Strings.isNullOrEmpty(breakpointId)) { process.getStateController().deleteBreakpointAsync(breakpointId); } else { LOG.warn("could not delete breakpoint because it was not added through the cloud handler."); } } // reset this flag: either it has been disabled by the server or the client has deleted it, in // both cases we need to add it again, if it is re-enabled ideBreakpoint.getProperties().setAddedOnServer(false); } }
when(virtualFile.getUrl()).thenReturn(MOCK_FILE_URL); when(xLineBreakpoint.getUserData(com.intellij.debugger.ui.breakpoints.Breakpoint.DATA_KEY)) .thenReturn(cloudLineBreakpoint); when(xLineBreakpoint.getProperties()).thenReturn(cloudLineBreakpointProperties);