Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
294,600
void (@NotNull XDebugSessionListener listener, @NotNull Disposable parentDisposable) { myDispatcher.addListener(listener, parentDisposable); }
addSessionListener
294,601
void (@NotNull final XDebugSessionListener listener) { myDispatcher.addListener(listener); }
addSessionListener
294,602
void (@NotNull final XDebugSessionListener listener) { myDispatcher.removeListener(listener); }
removeSessionListener
294,603
void (boolean muted) { ApplicationManager.getApplication().assertReadAccessAllowed(); if (areBreakpointsMuted() == muted) return; mySessionData.setBreakpointsMuted(muted); if (!myBreakpointsDisabled) { processAllBreakpoints(!muted, muted); } myDebuggerManager.getBreakpointManager().getLineBreakpointManager().queueAllBreakpointsUpdate(); myDispatcher.getMulticaster().breakpointsMuted(muted); }
setBreakpointMuted
294,604
void (final boolean ignoreBreakpoints) { rememberUserActionStart(XDebuggerActions.STEP_OVER); if (!myDebugProcess.checkCanPerformCommands()) return; if (ignoreBreakpoints) { setBreakpointsDisabledTemporarily(true); } myDebugProcess.startStepOver(doResume()); }
stepOver
294,605
void () { rememberUserActionStart(XDebuggerActions.STEP_INTO); if (!myDebugProcess.checkCanPerformCommands()) return; myDebugProcess.startStepInto(doResume()); }
stepInto
294,606
void () { rememberUserActionStart(XDebuggerActions.STEP_OUT); if (!myDebugProcess.checkCanPerformCommands()) return; myDebugProcess.startStepOut(doResume()); }
stepOut
294,607
void () { rememberUserActionStart(XDebuggerActions.FORCE_STEP_INTO); if (!myDebugProcess.checkCanPerformCommands()) return; myDebugProcess.startForceStepInto(doResume()); }
forceStepInto
294,608
void (@NotNull final XSourcePosition position, final boolean ignoreBreakpoints) { rememberUserActionStart(XDebuggerActions.RUN_TO_CURSOR); if (!myDebugProcess.checkCanPerformCommands()) return; if (ignoreBreakpoints) { setBreakpointsDisabledTemporarily(true); } myDebugProcess.runToPosition(position, doResume()); }
runToPosition
294,609
void () { rememberUserActionStart(XDebuggerActions.PAUSE); if (!myDebugProcess.checkCanPerformCommands()) return; myDebugProcess.startPausing(); }
pause
294,610
void (final boolean register, final boolean temporary) { ApplicationManager.getApplication().assertReadAccessAllowed(); for (XBreakpointHandler<?> handler : myDebugProcess.getBreakpointHandlers()) { processBreakpoints(handler, register, temporary); } }
processAllBreakpoints
294,611
void (boolean disabled) { ApplicationManager.getApplication().runReadAction(() -> { if (myBreakpointsDisabled == disabled) return; myBreakpointsDisabled = disabled; if (!areBreakpointsMuted()) { processAllBreakpoints(!disabled, disabled); } }); }
setBreakpointsDisabledTemporarily
294,612
void () { if (!myDebugProcess.checkCanPerformCommands()) return; myDebugProcess.resume(doResume()); }
resume
294,613
XSuspendContext () { if (!myPaused.getAndSet(false)) { return null; } myDispatcher.getMulticaster().beforeSessionResume(); XSuspendContext context = mySuspendContext; clearPausedData(); UIUtil.invokeLaterIfNeeded(() -> { if (mySessionTab != null) { mySessionTab.getUi().clearAttractionBy(XDebuggerUIConstants.LAYOUT_VIEW_BREAKPOINT_CONDITION); } }); myDispatcher.getMulticaster().sessionResumed(); return context; }
doResume
294,614
void () { mySuspendContext = null; myCurrentExecutionStack = null; myCurrentStackFrame = null; myTopStackFrame = null; clearActiveNonLineBreakpoint(); updateExecutionPosition(); }
clearPausedData
294,615
void () { updateExecutionPosition(getCurrentSourceKind()); }
updateExecutionPosition
294,616
void (@NotNull XSourceKind navigationSourceKind) { // allowed only for the active session if (myDebuggerManager.getCurrentSession() == this) { boolean isTopFrame = isTopFrameSelected(); XSourcePosition mainSourcePosition = getFrameSourcePosition(myCurrentStackFrame, XSourceKind.MAIN); XSourcePosition alternativeSourcePosition = getFrameSourcePosition(myCurrentStackFrame, XSourceKind.ALTERNATIVE); myExecutionPointManager.setExecutionPoint(mainSourcePosition, alternativeSourcePosition, isTopFrame, navigationSourceKind); updateExecutionPointGutterIconRenderer(); } }
updateExecutionPosition
294,617
boolean () { return myCurrentExecutionStack != null && myIsTopFrame; }
isTopFrameSelected
294,618
void () { if (mySuspendContext != null) { XExecutionStack executionStack = mySuspendContext.getActiveExecutionStack(); if (executionStack != null) { XStackFrame topFrame = executionStack.getTopFrame(); if (topFrame != null) { setCurrentStackFrame(executionStack, topFrame, true); myExecutionPointManager.showExecutionPosition(); } } } }
showExecutionPoint
294,619
void (@NotNull XExecutionStack executionStack, @NotNull XStackFrame frame, boolean isTopFrame) { if (mySuspendContext == null) return; boolean frameChanged = myCurrentStackFrame != frame; myCurrentExecutionStack = executionStack; myCurrentStackFrame = frame; myIsTopFrame = isTopFrame; if (frameChanged) { myDispatcher.getMulticaster().stackFrameChanged(); } activateSession(frameChanged); }
setCurrentStackFrame
294,620
void (@NotNull XBreakpoint<?> removedBreakpoint) { Pair<XBreakpoint<?>, XSourcePosition> pair = myActiveNonLineBreakpoint.get(); if (pair != null && pair.getFirst() == removedBreakpoint) { clearActiveNonLineBreakpoint(); updateExecutionPointGutterIconRenderer(); } }
checkActiveNonLineBreakpointOnRemoval
294,621
void () { myActiveNonLineBreakpoint.set(null); }
clearActiveNonLineBreakpoint
294,622
GutterIconRenderer (boolean isTopFrame) { if (!isTopFrame) { return null; } XBreakpoint<?> activeNonLineBreakpoint = getActiveNonLineBreakpoint(); if (activeNonLineBreakpoint != null) { return ((XBreakpointBase<?, ?, ?>)activeNonLineBreakpoint).createGutterIconRenderer(); } if (myCurrentExecutionStack != null) { return myCurrentExecutionStack.getExecutionLineIconRenderer(); } return null; }
getPositionIconRenderer
294,623
void (@NotNull final XLineBreakpoint<?> breakpoint, @Nullable final Icon icon, @Nullable final String errorMessage) { CustomizedBreakpointPresentation presentation; synchronized (myRegisteredBreakpoints) { presentation = myRegisteredBreakpoints.get(breakpoint); if (presentation == null || (Comparing.equal(presentation.getIcon(), icon) && Comparing.strEqual(presentation.getErrorMessage(), errorMessage))) { return; } presentation.setErrorMessage(errorMessage); presentation.setIcon(icon); long timestamp = presentation.getTimestamp(); if (timestamp != 0 && XDebuggerUtilImpl.getVerifiedIcon(breakpoint).equals(icon)) { long delay = System.currentTimeMillis() - timestamp; presentation.setTimestamp(0); BreakpointsUsageCollector.reportBreakpointVerified(breakpoint, delay); } } XBreakpointManagerImpl debuggerManager = myDebuggerManager.getBreakpointManager(); debuggerManager.getLineBreakpointManager().queueBreakpointUpdate(breakpoint, () -> debuggerManager.fireBreakpointPresentationUpdated(breakpoint, this)); }
updateBreakpointPresentation
294,624
void (@NotNull XLineBreakpoint<?> breakpoint) { updateBreakpointPresentation(breakpoint, XDebuggerUtilImpl.getVerifiedIcon(breakpoint), null); }
setBreakpointVerified
294,625
void (@NotNull XLineBreakpoint<?> breakpoint, @Nullable String errorMessage) { updateBreakpointPresentation(breakpoint, AllIcons.Debugger.Db_invalid_breakpoint, errorMessage); }
setBreakpointInvalid
294,626
boolean (@NotNull final XBreakpoint<?> breakpoint, @Nullable String evaluatedLogExpression, @NotNull XSuspendContext suspendContext) { return breakpointReached(breakpoint, evaluatedLogExpression, suspendContext, true); }
breakpointReached
294,627
void (@NotNull final XBreakpoint<?> breakpoint, @NotNull XSuspendContext suspendContext) { breakpointReached(breakpoint, null, suspendContext, false); }
breakpointReachedNoProcessing
294,628
boolean (@NotNull final XBreakpoint<?> breakpoint, @Nullable String evaluatedLogExpression, @NotNull XSuspendContext suspendContext, boolean doProcessing) { if (doProcessing) { if (breakpoint.isLogMessage()) { XSourcePosition position = breakpoint.getSourcePosition(); OpenFileHyperlinkInfo hyperlinkInfo = position != null ? new OpenFileHyperlinkInfo(myProject, position.getFile(), position.getLine()) : null; printMessage(XDebuggerBundle.message("xbreakpoint.reached.text") + " ", XBreakpointUtil.getShortText(breakpoint), hyperlinkInfo); } if (breakpoint.isLogStack()) { myDebugProcess.logStack(suspendContext, this); } if (evaluatedLogExpression != null) { printMessage(evaluatedLogExpression, null, null); } processDependencies(breakpoint); if (breakpoint.getSuspendPolicy() == SuspendPolicy.NONE) { return false; } } BP_NOTIFICATION_GROUP .createNotification(XDebuggerBundle.message("xdebugger.breakpoint.reached"), MessageType.INFO) .notify(getProject()); if (!(breakpoint instanceof XLineBreakpoint) || ((XLineBreakpoint)breakpoint).getType().canBeHitInOtherPlaces()) { // precompute source position for faster access later myActiveNonLineBreakpoint.set(Pair.create(breakpoint, breakpoint.getSourcePosition())); } else { myActiveNonLineBreakpoint.set(null); } // set this session active on breakpoint, update execution position will be called inside positionReached myDebuggerManager.setCurrentSession(this); positionReachedInternal(suspendContext, true); if (doProcessing && breakpoint instanceof XLineBreakpoint<?> && ((XLineBreakpoint<?>)breakpoint).isTemporary()) { handleTemporaryBreakpointHit(breakpoint); } return true; }
breakpointReached
294,629
void (final XBreakpoint<?> breakpoint) { addSessionListener(new XDebugSessionListener() { private void removeBreakpoint() { XDebuggerUtil.getInstance().removeBreakpoint(myProject, breakpoint); removeSessionListener(this); } @Override public void sessionResumed() { removeBreakpoint(); } @Override public void sessionStopped() { removeBreakpoint(); } }); }
handleTemporaryBreakpointHit
294,630
void () { XDebuggerUtil.getInstance().removeBreakpoint(myProject, breakpoint); removeSessionListener(this); }
removeBreakpoint
294,631
void () { removeBreakpoint(); }
sessionResumed
294,632
void () { removeBreakpoint(); }
sessionStopped
294,633
void (final XBreakpoint<?> breakpoint) { XDependentBreakpointManager dependentBreakpointManager = myDebuggerManager.getBreakpointManager().getDependentBreakpointManager(); if (!dependentBreakpointManager.isMasterOrSlave(breakpoint)) return; List<XBreakpoint<?>> breakpoints = dependentBreakpointManager.getSlaveBreakpoints(breakpoint); breakpoints.forEach(myInactiveSlaveBreakpoints::remove); for (XBreakpoint<?> slaveBreakpoint : breakpoints) { processAllHandlers(slaveBreakpoint, true); } if (dependentBreakpointManager.getMasterBreakpoint(breakpoint) != null && !dependentBreakpointManager.isLeaveEnabled(breakpoint)) { boolean added = myInactiveSlaveBreakpoints.add(breakpoint); if (added) { processAllHandlers(breakpoint, false); myDebuggerManager.getBreakpointManager().getLineBreakpointManager().queueBreakpointUpdate(breakpoint); } } }
processDependencies
294,634
void (final String message, final String hyperLinkText, @Nullable final HyperlinkInfo info) { AppUIUtil.invokeOnEdt(() -> { myConsoleView.print(message, ConsoleViewContentType.SYSTEM_OUTPUT); if (info != null) { myConsoleView.printHyperlink(hyperLinkText, info); } else if (hyperLinkText != null) { myConsoleView.print(hyperLinkText, ConsoleViewContentType.SYSTEM_OUTPUT); } myConsoleView.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT); }); }
printMessage
294,635
void () { myPaused.set(false); }
unsetPaused
294,636
void (@NotNull final XSuspendContext suspendContext, boolean attract) { setBreakpointsDisabledTemporarily(false); mySuspendContext = suspendContext; myCurrentExecutionStack = suspendContext.getActiveExecutionStack(); myCurrentStackFrame = myCurrentExecutionStack != null ? myCurrentExecutionStack.getTopFrame() : null; myIsTopFrame = true; myTopStackFrame = myCurrentStackFrame; XSourcePosition topFramePosition = getTopFramePosition(); myPaused.set(true); boolean isAlternative = myAlternativeSourceHandler != null && myAlternativeSourceHandler.isAlternativeSourceKindPreferred(suspendContext); updateExecutionPosition(isAlternative ? XSourceKind.ALTERNATIVE : XSourceKind.MAIN); logPositionReached(topFramePosition); final boolean showOnSuspend = myShowTabOnSuspend.compareAndSet(true, false); if (showOnSuspend || attract) { AppUIUtil.invokeLaterIfProjectAlive(myProject, () -> { if (showOnSuspend) { initSessionTab(null); showSessionTab(); } // user attractions should only be made if event happens independently (e.g. program paused/suspended) // and should not be made when user steps in the code if (attract) { if (mySessionTab == null) { LOG.debug("Cannot request focus because Session Tab is not initialized yet"); return; } if (XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings().isShowDebuggerOnBreakpoint()) { mySessionTab.toFront(true, this::updateExecutionPosition); } if (topFramePosition == null) { // if there is no source position available, we should somehow tell the user that session is stopped. // the best way is to show the stack frames. XDebugSessionTab.showFramesView(this); } mySessionTab.getUi().attractBy(XDebuggerUIConstants.LAYOUT_VIEW_BREAKPOINT_CONDITION); } }); } myDispatcher.getMulticaster().sessionPaused(); }
positionReachedInternal
294,637
void (@NotNull final XSuspendContext suspendContext) { positionReached(suspendContext, false); }
positionReached
294,638
void (@NotNull XSuspendContext suspendContext, boolean attract) { clearActiveNonLineBreakpoint(); positionReachedInternal(suspendContext, attract); }
positionReached
294,639
void () { doResume(); }
sessionResumed
294,640
boolean () { return myStopped.get(); }
isStopped
294,641
void () { if (!myStopped.compareAndSet(false, true)) { return; } try { removeBreakpointListeners(); } finally { myDebugProcess.stopAsync() .onSuccess(aVoid -> { processStopped(); }); } }
stopImpl
294,642
void () { if (!myProject.isDisposed()) { myProject.getMessageBus().syncPublisher(XDebuggerManager.TOPIC).processStopped(myDebugProcess); } if (mySessionTab != null) { AppUIUtil.invokeOnEdt(() -> { mySessionTab.getUi().attractBy(XDebuggerUIConstants.LAYOUT_VIEW_FINISH_CONDITION); ((XWatchesViewImpl)mySessionTab.getWatchesView()).updateSessionData(); mySessionTab.detachFromSession(); }); } else if (myConsoleView != null) { AppUIUtil.invokeOnEdt(() -> Disposer.dispose(myConsoleView)); } clearPausedData(); if (myValueMarkers != null) { myValueMarkers.clear(); } if (XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings().isUnmuteOnStop()) { mySessionData.setBreakpointsMuted(false); } myDebuggerManager.removeSession(this); myDispatcher.getMulticaster().sessionStopped(); myDispatcher.getListeners().clear(); myProject.putUserData(InlineDebugRenderer.LinePainter.CACHE, null); synchronized (myRegisteredBreakpoints) { myRegisteredBreakpoints.clear(); } }
processStopped
294,643
void () { Disposable breakpointListenerDisposable = myBreakpointListenerDisposable; if (breakpointListenerDisposable != null) { myBreakpointListenerDisposable = null; Disposer.dispose(breakpointListenerDisposable); } }
removeBreakpointListeners
294,644
boolean (final XBreakpoint<?> breakpoint) { return myInactiveSlaveBreakpoints.contains(breakpoint); }
isInactiveSlaveBreakpoint
294,645
void () { ProcessHandler processHandler = myDebugProcess == null ? null : myDebugProcess.getProcessHandler(); if (processHandler == null || processHandler.isProcessTerminated() || processHandler.isProcessTerminating()) return; if (processHandler.detachIsDefault()) { processHandler.detachProcess(); } else { processHandler.destroyProcess(); } }
stop
294,646
void (@NotNull final String message) { reportMessage(message, MessageType.ERROR); }
reportError
294,647
void (@NotNull final String message, @NotNull final MessageType type) { reportMessage(message, type, null); }
reportMessage
294,648
void (@NotNull final String message, @NotNull final MessageType type, @Nullable final HyperlinkListener listener) { Notification notification = XDebuggerManagerImpl.getNotificationGroup().createNotification(message, type.toNotificationType()); if (listener != null) { notification.setListener((__, event) -> { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { listener.hyperlinkUpdate(event); } }); } notification.notify(myProject); }
reportMessage
294,649
void (@NotNull final XBreakpoint<?> breakpoint) { if (processAdd(breakpoint)) { CustomizedBreakpointPresentation presentation = getBreakpointPresentation(breakpoint); if (presentation != null) { if (XDebuggerUtilImpl.getVerifiedIcon(breakpoint).equals(presentation.getIcon())) { BreakpointsUsageCollector.reportBreakpointVerified(breakpoint, 0); } else { presentation.setTimestamp(System.currentTimeMillis()); } } } }
breakpointAdded
294,650
void (@NotNull final XBreakpoint<?> breakpoint) { checkActiveNonLineBreakpointOnRemoval(breakpoint); processRemove(breakpoint); }
breakpointRemoved
294,651
void (@NotNull final XBreakpoint<?> breakpoint) { processRemove(breakpoint); processAdd(breakpoint); }
breakpointChanged
294,652
void (@NotNull final XBreakpoint<?> slave, @NotNull final XBreakpoint<?> master) { boolean added = myInactiveSlaveBreakpoints.add(slave); if (added) { processAllHandlers(slave, false); } }
dependencySet
294,653
void (final XBreakpoint<?> breakpoint) { boolean removed = myInactiveSlaveBreakpoints.remove(breakpoint); if (removed) { processAllHandlers(breakpoint, true); } }
dependencyCleared
294,654
String () { if (myEnvironment != null) { RunProfile profile = myEnvironment.getRunProfile(); if (profile instanceof RunConfiguration) { return ((RunConfiguration)profile).getType().getId(); } } return getSessionName(); }
computeConfigurationName
294,655
ExecutionEnvironment () { return myEnvironment; }
getExecutionEnvironment
294,656
void (@NotNull String action) { myUserRequestStart = System.currentTimeMillis(); myUserRequestAction = action; }
rememberUserActionStart
294,657
void (@Nullable XSourcePosition topFramePosition) { FileType fileType = topFramePosition != null ? topFramePosition.getFile().getFileType() : null; if (myUserRequestAction != null) { long durationMs = System.currentTimeMillis() - myUserRequestStart; if (PERFORMANCE_LOG.isDebugEnabled()) { PERFORMANCE_LOG.debug("Position reached in " + durationMs + "ms"); } XDebuggerPerformanceCollector.logExecutionPointReached(myProject, fileType, myUserRequestAction, durationMs); myUserRequestAction = null; } else { XDebuggerPerformanceCollector.logBreakpointReached(myProject, fileType); } }
logPositionReached
294,658
void (@NotNull final Project project, @NotNull final VirtualFile file, final int line, boolean temporary) { toggleAndReturnLineBreakpoint(project, file, line, temporary); }
toggleLineBreakpoint
294,659
boolean (@NotNull Project project, @NotNull VirtualFile file, int line) { return ContainerUtil.exists(getLineBreakpointTypes(), type -> type.canPutAt(file, line, project)); }
canPutBreakpointAt
294,660
String () { return StringUtil.notNullize(StringUtil.unpluralize(type.getTitle()), type.getTitle()); }
getText
294,661
Icon () { return type.getEnabledIcon(); }
getIcon
294,662
int (int caretOffset, List<? extends XLineBreakpointType.XLineBreakpointVariant> variants) { assert !variants.isEmpty(); TextRange bestRange = null; int bestIndex = -1; for (int i = 0; i < variants.size(); i++) { var variant = variants.get(i); TextRange range = variant.getHighlightRange(); if (range != null && range.contains(caretOffset)) { if (bestRange == null || bestRange.getLength() > range.getLength()) { bestRange = range; bestIndex = i; } } } // Use first variant if nothing interesting is found. return bestIndex == -1 ? 0 : bestIndex; }
getIndexOfBestMatchingInlineVariant
294,663
void (ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { updateHighlighter(((JList<?>)e.getSource()).getSelectedValue()); } }
valueChanged
294,664
void (Object value) { if (myHighlighter == null) { updateHighlighter(value); } }
initialSet
294,665
void () { if (myHighlighter != null) { myHighlighter.dispose(); } }
clearHighlighter
294,666
String (XLineBreakpointType.XLineBreakpointVariant value) { return value.getText(); }
getTextFor
294,667
Icon (XLineBreakpointType.XLineBreakpointVariant value) { return value.getIcon(); }
getIconFor
294,668
void () { selectionListener.clearHighlighter(); res.cancel(); }
canceled
294,669
PopupStep (final XLineBreakpointType.XLineBreakpointVariant selectedValue, boolean finalChoice) { selectionListener.clearHighlighter(); insertBreakpoint(selectedValue.createProperties(), res, breakpointManager, file, line, selectedValue.getType(), temporary); return FINAL_CHOICE; }
onChosen
294,670
int () { return defaultIndex; }
getDefaultOptionIndex
294,671
void () { super.afterShow(); selectionListener.initialSet(getList().getSelectedValue()); }
afterShow
294,672
boolean (final XBreakpointBase<?, ?, ?> breakpoint) { return removeBreakpointWithConfirmation(breakpoint.getProject(), breakpoint); }
removeBreakpointWithConfirmation
294,673
void (@NotNull AnActionEvent e) { if (!(e.getInputEvent() instanceof MouseEvent)) { return; } Project project = e.getProject(); if (project == null) { return; } Editor editor = e.getData(CommonDataKeys.EDITOR); if(editor == null) { return; } if (XDebuggerManager.getInstance(project) instanceof XDebuggerManagerImpl debuggerManagerImpl) { debuggerManagerImpl.reshowInlayToolbar(editor); } }
reshowInlayRunToCursor
294,674
boolean (final Project project, final XBreakpoint<?> breakpoint) { if ((!isEmptyExpression(breakpoint.getConditionExpression()) || !isEmptyExpression(breakpoint.getLogExpressionObject())) && !ApplicationManager.getApplication().isHeadlessEnvironment() && !ApplicationManager.getApplication().isUnitTestMode() && XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings().isConfirmBreakpointRemoval()) { StringBuilder message = new StringBuilder("<html>").append(XDebuggerBundle.message("message.confirm.breakpoint.removal.message")); if (!isEmptyExpression(breakpoint.getConditionExpression())) { message.append("<br>") .append(XDebuggerBundle.message("message.confirm.breakpoint.removal.message.condition")) .append("<br><pre>") .append(StringUtil.escapeXmlEntities(breakpoint.getConditionExpression().getExpression())) .append("</pre>"); } if (!isEmptyExpression(breakpoint.getLogExpressionObject())) { message.append("<br>") .append(XDebuggerBundle.message("message.confirm.breakpoint.removal.message.log")) .append("<br><pre>") .append(StringUtil.escapeXmlEntities(breakpoint.getLogExpressionObject().getExpression())) .append("</pre>"); } //noinspection HardCodedStringLiteral if (Messages.showOkCancelDialog(message.toString(), XDebuggerBundle.message("message.confirm.breakpoint.removal.title"), CommonBundle.message("button.remove"), Messages.getCancelButton(), Messages.getQuestionIcon(), new DialogWrapper.DoNotAskOption.Adapter() { @Override public void rememberChoice(boolean isSelected, int exitCode) { if (isSelected) { XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings() .setConfirmBreakpointRemoval(false); } } }) != Messages.OK) { return false; } } ((XBreakpointManagerImpl)XDebuggerManager.getInstance(project).getBreakpointManager()) .rememberRemovedBreakpoint((XBreakpointBase)breakpoint); getInstance().removeBreakpoint(project, breakpoint); return true; }
removeBreakpointWithConfirmation
294,675
void (boolean isSelected, int exitCode) { if (isSelected) { XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings() .setConfirmBreakpointRemoval(false); } }
rememberChoice
294,676
void (Project project, XBreakpoint<?> breakpoint) { XDebuggerManager.getInstance(project).getBreakpointManager().removeBreakpoint(breakpoint); }
removeBreakpoint
294,677
void (@NotNull Project project) { ((XBreakpointManagerImpl)XDebuggerManager.getInstance(project).getBreakpointManager()).removeAllBreakpoints(); }
removeAllBreakpoints
294,678
XValueContainer (DataContext dataContext) { return XDebuggerTreeActionBase.getSelectedValue(dataContext); }
getValueContainer
294,679
XSourcePosition (@Nullable VirtualFile file, int line) { return file == null ? null : XSourcePositionImpl.create(file, line); }
createPosition
294,680
XSourcePosition (@Nullable VirtualFile file, final int line, final int column) { return file == null ? null : XSourcePositionImpl.create(file, line, column); }
createPosition
294,681
XSourcePosition (final VirtualFile file, final int offset) { return XSourcePositionImpl.createByOffset(file, offset); }
createPositionByOffset
294,682
XSourcePosition (PsiElement element) { return XSourcePositionImpl.createByElement(element); }
createPositionByElement
294,683
XSourcePosition (@NotNull Project project, DataContext context) { Editor editor = getEditor(project, context); if (editor == null) return null; Integer lineNumber = LINE_NUMBER.getData(context); if (lineNumber != null) { return XSourcePositionImpl.create(editor.getVirtualFile(), lineNumber); } Integer offsetFromDataContext = OFFSET.getData(context); if (offsetFromDataContext != null) { return XSourcePositionImpl.createByOffset(editor.getVirtualFile(), offsetFromDataContext); } final Document document = editor.getDocument(); int offset = editor.getCaretModel().getOffset(); VirtualFile file = FileDocumentManager.getInstance().getFile(document); return XSourcePositionImpl.createByOffset(file, offset); }
getCaretPosition
294,684
Editor (@NotNull Project project, DataContext context) { Editor editor = CommonDataKeys.EDITOR.getData(context); if (editor == null) { @Nullable FileEditor fileEditor = context.getData(PlatformDataKeys.LAST_ACTIVE_FILE_EDITOR); return fileEditor instanceof TextEditor ? ((TextEditor)fileEditor).getEditor() : null; } return editor; }
getEditor
294,685
void (@NotNull Project project, @NotNull Document document, int line, @NotNull Processor<? super PsiElement> processor) { int lineStart; int lineEnd; try { lineStart = document.getLineStartOffset(line); lineEnd = document.getLineEndOffset(line); } catch (IndexOutOfBoundsException ignored) { return; } iterateOffsetRange(project, document, lineStart, lineEnd, processor); }
iterateLine
294,686
void (@NotNull Project project, @NotNull Document document, int startOffset, int endOffset, @NotNull Processor<? super PsiElement> processor) { PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document); if (file == null) { return; } PsiElement element; int offset = startOffset; while (offset < endOffset) { element = file.findElementAt(offset); if (element != null && element.getTextLength() > 0) { if (!processor.process(element)) { return; } else { offset = element.getTextRange().getEndOffset(); } } else { offset++; } } }
iterateOffsetRange
294,687
PsiElement (@NotNull VirtualFile virtualFile, int offset, @NotNull Project project, boolean checkXml) { if (!virtualFile.isValid()) { return null; } Document document = FileDocumentManager.getInstance().getDocument(virtualFile); PsiFile file = document == null ? null : PsiManager.getInstance(project).findFile(virtualFile); if (file == null) { return null; } if (offset < 0) { offset = 0; } if (offset > document.getTextLength()) { offset = document.getTextLength(); } int startOffset = offset; int lineEndOffset = document.getLineEndOffset(document.getLineNumber(offset)); PsiElement result = null; do { PsiElement element = file.findElementAt(offset); if (!(element instanceof PsiWhiteSpace) && !(element instanceof PsiComment)) { result = element; break; } offset = element.getTextRange().getEndOffset() + 1; } while (offset < lineEndOffset); if (result == null) { result = file.findElementAt(startOffset); } if (checkXml && result != null && StdFileTypes.XML.getLanguage().equals(result.getLanguage())) { PsiLanguageInjectionHost parent = PsiTreeUtil.getParentOfType(result, PsiLanguageInjectionHost.class); if (parent != null) { result = InjectedLanguageUtil.findElementInInjected(parent, offset); } } return result; }
findContextElement
294,688
void (@NotNull Editor editor) { ValueLookupManager.DISABLE_VALUE_LOOKUP.set(editor, Boolean.TRUE); }
disableValueLookup
294,689
Editor (@NotNull OpenFileDescriptor descriptor) { return createEditor(descriptor); }
openTextEditor
294,690
Editor (@NotNull OpenFileDescriptor descriptor) { if (descriptor.canNavigate()) { FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(descriptor.getProject()); boolean isEditorAreaFocused = IJSwingUtilities.hasFocus(fileEditorManager.getComponent()); return fileEditorManager.openTextEditor(descriptor, isEditorAreaFocused); } return null; }
createEditor
294,691
Navigatable (@NotNull Project project, @NotNull Navigatable navigatable) { return new Navigatable() { @Override public void navigate(boolean requestFocus) { FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project); boolean isEditorAreaFocused = IJSwingUtilities.hasFocus(fileEditorManager.getComponent()); navigatable.navigate(requestFocus && isEditorAreaFocused); } @Override public boolean canNavigate() { return navigatable.canNavigate(); } @Override public boolean canNavigateToSource() { return navigatable.canNavigateToSource(); } }; }
wrapKeepEditorAreaFocusNavigatable
294,692
void (boolean requestFocus) { FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project); boolean isEditorAreaFocused = IJSwingUtilities.hasFocus(fileEditorManager.getComponent()); navigatable.navigate(requestFocus && isEditorAreaFocused); }
navigate
294,693
boolean () { return navigatable.canNavigate(); }
canNavigate
294,694
boolean () { return navigatable.canNavigateToSource(); }
canNavigateToSource
294,695
void (@Nullable Project project) { if (project == null) return; Arrays.stream(XDebuggerManager.getInstance(project).getDebugSessions()) .filter(XDebugSession::isSuspended) .forEach(XDebugSession::rebuildViews); }
rebuildAllSessionsViews
294,696
void (XDebuggerTree tree) { if (tree.isDetached()) { tree.rebuildAndRestore(XDebuggerTreeState.saveState(tree)); } rebuildAllSessionsViews(tree.getProject()); }
rebuildTreeAndViews
294,697
XExpression (@NotNull String text, Language language, String custom, @NotNull EvaluationMode mode) { return new XExpressionImpl(text, language, custom, mode); }
createExpression
294,698
boolean (@Nullable XExpression expression) { return expression == null || StringUtil.isEmptyOrSpaces(expression.getExpression()); }
isEmptyExpression
294,699
void (@NotNull XSuspendContext suspendContext, @NotNull XDebugSession session) { XExecutionStack activeExecutionStack = suspendContext.getActiveExecutionStack(); if (activeExecutionStack != null) { activeExecutionStack.computeStackFrames(0, new XStackFrameContainerEx() { final List<XStackFrame> myFrames = new ArrayList<>(); @Override public void addStackFrames(@NotNull List<? extends XStackFrame> stackFrames, boolean last) { myFrames.addAll(stackFrames); if (last) { print(null); } } @Override public void addStackFrames(@NotNull List<? extends XStackFrame> stackFrames, @Nullable XStackFrame toSelect, boolean last) { addStackFrames(stackFrames, last); } @Override public void errorOccurred(@NotNull String errorMessage) { print(errorMessage); } void print(@Nullable String errorMessage) { ConsoleView view = session.getConsoleView(); Project project = session.getProject(); DebuggerUIUtil.invokeLater(() -> view.print("Stack: ", ConsoleViewContentType.SYSTEM_OUTPUT)); myFrames.forEach(f -> { SimpleColoredText text = new SimpleColoredText(); ReadAction.run(() -> f.customizePresentation(text)); XSourcePosition position = f.getSourcePosition(); Navigatable navigatable = position != null ? position.createNavigatable(project) : null; DebuggerUIUtil.invokeLater(() -> { view.print("\n\t", ConsoleViewContentType.SYSTEM_OUTPUT); view.printHyperlink(text.toString(), p -> { if (navigatable != null) { navigatable.navigate(true); } }); }); }); DebuggerUIUtil.invokeLater(() -> { if (errorMessage != null) { view.print("\n\t" + errorMessage, ConsoleViewContentType.SYSTEM_OUTPUT); } view.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT); }); } }); } }
logStack