Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
296,300
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,301
void (@NotNull AnActionEvent e) { super.update(e); Presentation presentation = e.getPresentation(); presentation.setVisible(presentation.isEnabled()); }
update
296,302
boolean (@NotNull XValueNodeImpl node, @NotNull AnActionEvent e) { return node.getValueContainer().getReferrersProvider() != null; }
isEnabled
296,303
void (XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) { XReferrersProvider referrersProvider = node.getValueContainer().getReferrersProvider(); if (referrersProvider != null) { XDebuggerTree tree = node.getTree(); XDebugSession session = DebuggerUIUtil.getSession(e); if (session != null) { XValue referringObjectsRoot = referrersProvider.getReferringObjectsValue(); DialogWrapper dialog; if (referringObjectsRoot instanceof ReferrersTreeCustomizer referrersTreeCustomizer) { dialog = referrersTreeCustomizer.getDialog(tree, nodeName, session); } else { dialog = new XInspectDialog(tree.getProject(), tree.getEditorsProvider(), tree.getSourcePosition(), nodeName, referringObjectsRoot, tree.getValueMarkers(), session, false); dialog.setTitle(XDebuggerBundle.message("showReferring.dialog.title", nodeName)); } dialog.show(); } } }
perform
296,304
void (@NotNull AnActionEvent e) { super.update(e); XDebugSession session = e.getData(XDebugSession.DATA_KEY); e.getPresentation().setEnabledAndVisible(session != null && !session.getDebugProcess().isValuesCustomSorted()); }
update
296,305
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,306
boolean (@NotNull AnActionEvent e) { return XDebuggerSettingManagerImpl.getInstanceImpl().getDataViewSettings().isSortValues(); }
isSelected
296,307
void (@NotNull AnActionEvent e, boolean state) { XDebuggerSettingManagerImpl.getInstanceImpl().getDataViewSettings().setSortValues(state); XDebuggerUtilImpl.rebuildAllSessionsViews(e.getProject()); }
setSelected
296,308
void (XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) { CopyPasteManager.getInstance().setContents(new StringSelection(nodeName)); }
perform
296,309
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,310
boolean (@NotNull final XValueNodeImpl node, @NotNull AnActionEvent e) { return super.isEnabled(node, e) && DebuggerUIUtil.getWatchesView(e) != null; }
isEnabled
296,311
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
296,312
void (@NotNull AnActionEvent e) { for (XValueNodeImpl node : getSelectedNodes(e.getDataContext())) { if (node != null) { String nodeName = node.getName(); if (nodeName != null) { perform(node, nodeName, e); } } } }
actionPerformed
296,313
void (final XValueNodeImpl node, @NotNull final String nodeName, final AnActionEvent e) { final XWatchesView watchesView = DebuggerUIUtil.getWatchesView(e); if (watchesView != null) { DebuggerUIUtil.addToWatches(watchesView, node); } }
perform
296,314
void (@NotNull final AnActionEvent e) { XValueNodeImpl node = getSelectedNode(e.getDataContext()); if (node != null) { String nodeName = node.getName(); if (nodeName != null) { perform(node, nodeName, e); } } }
actionPerformed
296,315
void (@NotNull final AnActionEvent e) { XValueNodeImpl node = getSelectedNode(e.getDataContext()); e.getPresentation().setEnabled(node != null && isEnabled(node, e)); }
update
296,316
boolean (final @NotNull XValueNodeImpl node, @NotNull AnActionEvent e) { return node.getName() != null; }
isEnabled
296,317
List<XValueNodeImpl> (@NotNull DataContext dataContext) { return XDebuggerTree.getSelectedNodes(dataContext); }
getSelectedNodes
296,318
XValue (@NotNull DataContext dataContext) { XValueNodeImpl node = getSelectedNode(dataContext); return node != null ? node.getValueContainer() : null; }
getSelectedValue
296,319
void (final Project project, final String value, XDebuggerTree tree) { if (tree == null) return; List<? extends WatchNode> watchNodes = XWatchesTreeActionBase.getSelectedNodes(tree, WatchNode.class); if (watchNodes.isEmpty()) { CopyPasteManager.getInstance().setContents(new StringSelection(value)); } else { CopyPasteManager.getInstance().setContents( new XWatchTransferable(value, ContainerUtil.map(watchNodes, WatchNode::getExpression))); } }
handle
296,320
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,321
void (final Project project, final String value, XDebuggerTree tree) { UIUtil.invokeLaterIfNeeded(() -> { DiffRequest request = DiffRequestFactory.getInstance().createClipboardVsValue(value); DiffManager.getInstance().showDiff(project, request); }); }
handle
296,322
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,323
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,324
void (XValueNodeImpl node, @NotNull final String nodeName, AnActionEvent e) { XDebuggerTree tree = node.getTree(); XValue value = node.getValueContainer(); XInspectDialog dialog = new XInspectDialog(tree.getProject(), tree.getEditorsProvider(), tree.getSourcePosition(), nodeName, value, tree.getValueMarkers(), DebuggerUIUtil.getSession(e), true); dialog.show(); }
perform
296,325
void (final XValueNodeImpl node, @NotNull final String nodeName, final AnActionEvent e) { XValue value = node.getValueContainer(); final XDebuggerEvaluationDialog dialog = e.getData(XDebuggerEvaluationDialog.KEY); XNavigatable navigatable = sourcePosition -> { if (sourcePosition != null) { final Project project = node.getTree().getProject(); AppUIExecutor.onUiThread().expireWith(project).submit(() -> { sourcePosition.createNavigatable(project).navigate(true); if (dialog != null && Registry.is("debugger.close.dialog.on.navigate")) { dialog.close(DialogWrapper.CANCEL_EXIT_CODE); } }); } }; startComputingSourcePosition(value, navigatable); }
perform
296,326
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,327
void (@NotNull final AnActionEvent e) { super.update(e); XValueNodeImpl node = getSelectedNode(e.getDataContext()); Presentation presentation = e.getPresentation(); if (node instanceof WatchNode) { presentation.setEnabledAndVisible(false); } else { presentation.setVisible(true); } }
update
296,328
boolean (@NotNull XValueNodeImpl node, @NotNull AnActionEvent e) { return super.isEnabled(node, e) && node.getValueContainer().getModifier() != null; }
isEnabled
296,329
void (final XValueNodeImpl node, @NotNull final String nodeName, final AnActionEvent e) { SetValueInplaceEditor.show(node, nodeName); }
perform
296,330
void (XValue value, XNavigatable navigatable) { value.computeTypeSourcePosition(navigatable); }
startComputingSourcePosition
296,331
boolean (@NotNull XValueNodeImpl node, @NotNull AnActionEvent e) { return super.isEnabled(node, e) && node.getValueContainer().canNavigateToTypeSource(); }
isEnabled
296,332
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,333
boolean (@NotNull XValueNodeImpl node, @NotNull AnActionEvent e) { return super.isEnabled(node, e) && getConsoleExecuteAction(e) != null; }
isEnabled
296,334
void (@NotNull AnActionEvent e) { if (getConsoleExecuteAction(e) != null) { e.getPresentation().setVisible(true); super.update(e); } else { e.getPresentation().setEnabledAndVisible(false); } }
update
296,335
ActionUpdateThread () { return super.getActionUpdateThread(); }
getActionUpdateThread
296,336
ConsoleExecuteAction (@NotNull AnActionEvent e) { return XEvaluateInConsoleFromEditorActionHandler.getConsoleExecuteAction(e.getData(LangDataKeys.CONSOLE_VIEW)); }
getConsoleExecuteAction
296,337
void (XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) { final ConsoleExecuteAction action = getConsoleExecuteAction(e); if (action != null) { node.calculateEvaluationExpression() .onSuccess(expression -> { if (expression != null) { action.execute(null, expression.getExpression(), null); } }); } }
perform
296,338
DataFlavor[] () { return ArrayUtil.mergeArrays(super.getTransferDataFlavors(), new DataFlavor[]{EXPRESSIONS_FLAVOR}); }
getTransferDataFlavors
296,339
boolean (DataFlavor flavor) { if (EXPRESSIONS_FLAVOR.equals(flavor)) return true; return super.isDataFlavorSupported(flavor); }
isDataFlavorSupported
296,340
void (XValue value, XNavigatable navigatable) { value.computeSourcePosition(navigatable); }
startComputingSourcePosition
296,341
boolean (@NotNull XValueNodeImpl node, @NotNull AnActionEvent e) { return super.isEnabled(node, e) && node.getValueContainer().canNavigateToSource(); }
isEnabled
296,342
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,343
void (@NotNull AnActionEvent e) { Project project = e.getProject(); e.getPresentation().setEnabled(session != null && project != null && LookupManager.getInstance(project).getActiveLookup() == null); }
update
296,344
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
296,345
void (@NotNull AnActionEvent e) { //doOKAction(); // do not evaluate on add to watches addToWatches(); }
actionPerformed
296,346
void (@NotNull AnActionEvent e) { IdeFocusManager.getInstance(project).requestFocus(myTreePanel.getTree(), true); }
actionPerformed
296,347
void () { ApplicationManager.getApplication().invokeLater(() -> close(CANCEL_EXIT_CODE)); }
sessionStopped
296,348
void () { updateSourcePosition(); }
stackFrameChanged
296,349
void () { updateSourcePosition(); }
sessionPaused
296,350
void () { super.dispose(); myMainPanel.removeAll(); }
dispose
296,351
void () { if (mySession == null) return; ApplicationManager.getApplication().invokeLater(() -> { mySourcePosition = mySession.getCurrentPosition(); getInputEditor().setSourcePosition(mySourcePosition); }); }
updateSourcePosition
296,352
void () { DebuggerEvaluationStatisticsCollector.EVALUATE.log(myProject, myMode); FeatureUsageTracker.getInstance().triggerFeatureUsed("debugger.evaluate.expression"); evaluate(); }
doOKAction
296,353
void () { super.createDefaultActions(); myOKAction = new OkAction(){ @Override public void actionPerformed(ActionEvent e) { super.actionPerformed(e); if (mySession != null && (e.getModifiers() & ADD_WATCH_MODIFIERS) == ADD_WATCH_MODIFIERS) { addToWatches(); } } }; }
createDefaultActions
296,354
void (ActionEvent e) { super.actionPerformed(e); if (mySession != null && (e.getModifiers() & ADD_WATCH_MODIFIERS) == ADD_WATCH_MODIFIERS) { addToWatches(); } }
actionPerformed
296,355
void () { if (myMode == EvaluationMode.EXPRESSION) { XExpression expression = getInputEditor().getExpression(); if (!XDebuggerUtilImpl.isEmptyExpression(expression)) { XDebugSessionTab tab = ((XDebugSessionImpl)mySession).getSessionTab(); if (tab != null) { tab.getWatchesView().addWatchExpression(expression, -1, true); getInputEditor().requestFocusInEditor(); } } } }
addToWatches
296,356
String () { return "debugging.debugMenu.evaluate"; }
getHelpId
296,357
JButton (Action action) { final JButton button = super.createJButtonForAction(action); if (action == mySwitchModeAction) { int width1 = new JButton(getSwitchButtonText(EvaluationMode.EXPRESSION)).getPreferredSize().width; int width2 = new JButton(getSwitchButtonText(EvaluationMode.CODE_FRAGMENT)).getPreferredSize().width; final Dimension size = new Dimension(Math.max(width1, width2), button.getPreferredSize().height); button.setMinimumSize(size); button.setPreferredSize(size); } return button; }
createJButtonForAction
296,358
XExpression () { return getInputEditor().getExpression(); }
getExpression
296,359
void (EvaluationMode mode, XExpression text) { if (myMode == mode) return; myMode = mode; Editor oldEditor = (myInputComponent != null) ? myInputComponent.getInputEditor().getEditor() : null; myInputComponent = createInputComponent(mode, text); myMainPanel.removeAll(); myInputComponent.addComponent(myMainPanel, myResultPanel); XDebuggerEditorBase.copyCaretPosition(oldEditor, myInputComponent.getInputEditor().getEditor()); mySwitchModeAction.putValue(Action.NAME, getSwitchButtonText(mode)); getInputEditor().requestFocusInEditor(); }
switchToMode
296,360
XDebuggerEditorBase () { return myInputComponent.getInputEditor(); }
getInputEditor
296,361
EvaluationInputComponent (EvaluationMode mode, XExpression text) { text = XExpressionImpl.changeMode(text, mode); if (mode == EvaluationMode.EXPRESSION) { ExpressionInputComponent component = new ExpressionInputComponent(myProject, myEditorsProvider, "evaluateExpression", mySourcePosition, text, myDisposable, mySession != null); component.getInputEditor().setExpandHandler(() -> mySwitchModeAction.actionPerformed(null)); return component; } else { CodeFragmentInputComponent component = new CodeFragmentInputComponent(myProject, myEditorsProvider, mySourcePosition, text, getDimensionServiceKey() + ".splitter", myDisposable); component.getInputEditor().addCollapseButton(() -> mySwitchModeAction.actionPerformed(null)); return component; } }
createInputComponent
296,362
void () { final XDebuggerEditorBase inputEditor = getInputEditor(); int offset = -1; //try to save caret position Editor editor = inputEditor.getEditor(); if (editor != null) { offset = editor.getCaretModel().getOffset(); } final XDebuggerTree tree = myTreePanel.getTree(); tree.markNodesObsolete(); tree.setRoot(new EvaluatingExpressionRootNode(this, tree), false); tree.selectNodeOnLoad(XDebuggerEvaluationDialog::isFirstChild, Conditions.alwaysFalse()); myResultPanel.invalidate(); //editor is already changed editor = inputEditor.getEditor(); inputEditor.requestFocusInEditor(); //try to restore caret position and clear selection if (offset >= 0 && editor != null) { offset = Math.min(editor.getDocument().getTextLength(), offset); editor.getCaretModel().moveToOffset(offset); editor.getSelectionModel().setSelection(offset, offset); } }
evaluate
296,363
boolean (TreeNode node) { return node.getParent() instanceof EvaluatingExpressionRootNode; }
isFirstChild
296,364
void () { getInputEditor().saveTextInHistory(); super.doCancelAction(); }
doCancelAction
296,365
String () { return "#xdebugger.evaluate"; }
getDimensionServiceKey
296,366
JComponent () { return myMainPanel; }
createCenterPanel
296,367
void (@NotNull XDebuggerEvaluator.XEvaluationCallback evaluationCallback) { final XDebuggerEditorBase inputEditor = getInputEditor(); inputEditor.saveTextInHistory(); XExpression expression = inputEditor.getExpression(); XDebuggerEvaluator evaluator = mySession == null ? myEvaluatorSupplier.get() : mySession.getDebugProcess().getEvaluator(); if (evaluator == null) { evaluationCallback.errorOccurred(XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator")); } else { evaluator.evaluate(expression, evaluationCallback, null); } }
startEvaluation
296,368
void () { if (mySession != null) mySession.rebuildViews(); }
evaluationDone
296,369
JComponent () { return getInputEditor().getPreferredFocusedComponent(); }
getPreferredFocusedComponent
296,370
void (ActionEvent e) { XExpression text = getInputEditor().getExpression(); EvaluationMode newMode = (myMode == EvaluationMode.EXPRESSION) ? EvaluationMode.CODE_FRAGMENT : EvaluationMode.EXPRESSION; // remember only on user selection XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings().setEvaluationDialogMode(newMode); DebuggerEvaluationStatisticsCollector.MODE_SWITCH.log(myProject, newMode); switchToMode(newMode, text); }
actionPerformed
296,371
Object (@NotNull @NonNls String dataId) { if (KEY.is(dataId)) { return XDebuggerEvaluationDialog.this; } return null; }
getData
296,372
Dimension () { Dimension d = super.getMinimumSize(); d.width = Math.max(d.width, JBUI.scale(450)); return d; }
getMinimumSize
296,373
XDebuggerEditorBase () { return myMultilineEditor; }
getInputEditor
296,374
JPanel () { return myMainForm.getMainPanel(); }
getMainComponent
296,375
void (JPanel contentPanel, JPanel resultPanel) { final JBSplitter splitter = new JBSplitter(true, 0.3f, 0.2f, 0.7f); splitter.setSplitterProportionKey(mySplitterProportionKey); contentPanel.add(splitter, BorderLayout.CENTER); splitter.setFirstComponent(myMainForm.getMainPanel()); splitter.setSecondComponent(resultPanel); }
addComponent
296,376
String () { return myTitle; }
getTitle
296,377
void (EditorEx editor) { super.prepareEditor(editor); Font font = EditorUtil.getEditorFont(); editor.getColorsScheme().setEditorFontName(font.getFontName()); editor.getColorsScheme().setEditorFontSize(font.getSize()); editor.getSettings().setLineCursorWidth(EditorUtil.getDefaultCaretWidth()); }
prepareEditor
296,378
void (JPanel contentPanel, JPanel resultPanel) { contentPanel.add(resultPanel, BorderLayout.CENTER); contentPanel.add(myMainForm.getMainPanel(), BorderLayout.NORTH); }
addComponent
296,379
JPanel () { return myMainForm.getMainPanel(); }
getMainComponent
296,380
XDebuggerEditorBase () { return myExpressionEditor; }
getInputEditor
296,381
void (JComponent component) { myLanguageChooserPanel.add(component); }
addLanguageComponent
296,382
void (JComponent component) { myExpressionPanel.add(component); }
addExpressionComponent
296,383
void (@Nls String name) { myNameLabel.setText(name); }
setName
296,384
JPanel () { return myMainPanel; }
getMainPanel
296,385
Tree (@NotNull Pair<XValue, String> descriptor) { final XDebuggerTree tree = new XDebuggerTree(myProject, myProvider, myPosition, XDebuggerActions.INSPECT_TREE_POPUP_GROUP, myMarkers); final XValueNodeImpl root = new XValueNodeImpl(tree, null, descriptor.getSecond(), descriptor.getFirst()); tree.setRoot(root, true); tree.setSelectionRow(0); // expand root on load tree.expandNodesOnLoad(node -> node == root); return tree; }
createTree
296,386
String (@NotNull Pair<XValue, String> descriptor) { return descriptor.getSecond(); }
getTitle
296,387
void (Object node, ResultConsumer<? super Pair<XValue, String>> resultConsumer) { if (node instanceof XValueNodeImpl valueNode) { resultConsumer.onSuccess(Pair.create(valueNode.getValueContainer(), valueNode.getName())); } }
createDescriptorByNode
296,388
boolean (@NotNull final Project project) { XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession(); return session != null && session.getDebugProcess().getEvaluator() != null; }
isEnabled
296,389
AbstractValueHint (@NotNull Project project, @NotNull Editor editor, @NotNull Point point, ValueHintType type) { return null; }
createValueHint
296,390
CancellableHint (@NotNull final Project project, @NotNull final Editor editor, @NotNull final Point point, final ValueHintType type) { final XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession(); if (session == null) { return CancellableHint.resolved(null); } final XDebuggerEvaluator evaluator = session.getDebugProcess().getEvaluator(); if (evaluator == null) { return CancellableHint.resolved(null); } int offset = AbstractValueHint.calculateOffset(editor, point); Document document = editor.getDocument(); // adjust offset to match with other actions, like go to declaration offset = TargetElementUtil.adjustOffset(PsiDocumentManager.getInstance(project).getPsiFile(document), document, offset); Promise<ExpressionInfo> infoPromise = getExpressionInfo(evaluator, project, type, editor, offset); Promise<AbstractValueHint> hintPromise = infoPromise .thenAsync(expressionInfo -> { AsyncPromise<AbstractValueHint> resultPromise = new AsyncPromise<>(); UIUtil.invokeLaterIfNeeded(() -> { int textLength = document.getTextLength(); if (expressionInfo == null) { resultPromise.setResult(null); return; } TextRange range = expressionInfo.getTextRange(); if (range.getStartOffset() > range.getEndOffset() || range.getStartOffset() < 0 || range.getEndOffset() > textLength) { LOG.error("invalid range: " + range + ", text length = " + textLength + ", evaluator: " + evaluator); resultPromise.setResult(null); return; } resultPromise.setResult(new XValueHint(project, editor, point, type, expressionInfo, evaluator, session, false)); }); return resultPromise; }); return new CancellableHint(hintPromise, infoPromise); }
createValueHintAsync
296,391
Promise<ExpressionInfo> (final XDebuggerEvaluator evaluator, final Project project, final ValueHintType type, @NotNull Editor editor, final int offset) { SelectionModel selectionModel = editor.getSelectionModel(); int selectionStart = selectionModel.getSelectionStart(); int selectionEnd = selectionModel.getSelectionEnd(); if ((type == ValueHintType.MOUSE_CLICK_HINT || type == ValueHintType.MOUSE_ALT_OVER_HINT) && selectionModel.hasSelection() && selectionStart <= offset && offset <= selectionEnd) { return Promises.resolvedPromise(new ExpressionInfo(new TextRange(selectionStart, selectionEnd))); } return evaluator.getExpressionInfoAtOffsetAsync (project, editor.getDocument(), offset, type == ValueHintType.MOUSE_CLICK_HINT || type == ValueHintType.MOUSE_ALT_OVER_HINT); }
getExpressionInfo
296,392
boolean (@NotNull final Project project) { return isEnabled(project); }
canShowHint
296,393
int (Project project) { return XDebuggerSettingsManager.getInstance().getDataViewSettings().getValueLookupDelay(); }
getValueLookupDelay
296,394
void () { disposeVisibleHint(); }
onHintHidden
296,395
void () { super.hideHint(); disposeVisibleHint(); }
hideHint
296,396
void () { AtomicBoolean showEvaluating = new AtomicBoolean(true); EdtExecutorService.getScheduledExecutorInstance().schedule(() -> { if (!isHintHidden() && !isShowing() && showEvaluating.get()) { SimpleColoredComponent component = HintUtil.createInformationComponent(); component.append(XDebuggerUIConstants.getEvaluatingExpressionMessage()); showHint(component); } }, 200, TimeUnit.MILLISECONDS); XEvaluationCallbackBase callback = new XEvaluationCallbackBase() { @Override public void evaluated(@NotNull final XValue result) { result.computePresentation(new XValueNodePresentationConfigurator.ConfigurableXValueNodeImpl() { private XFullValueEvaluator myFullValueEvaluator; private boolean myShown = false; @Override public void applyPresentation(@Nullable Icon icon, @NotNull XValuePresentation valuePresenter, boolean hasChildren) { showEvaluating.set(false); if (isHintHidden()) { return; } SimpleColoredText text = new SimpleColoredText(); XValueNodeImpl.buildText(valuePresenter, text, false); if (!hasChildren) { showTooltipPopup(createHintComponent(icon, text, valuePresenter, myFullValueEvaluator)); } else if (getType() == ValueHintType.MOUSE_CLICK_HINT) { if (!myShown) { Runnable showPopupRunnable = getShowPopupRunnable(result, myFullValueEvaluator); showPopupRunnable.run(); } } else { if (getType() == ValueHintType.MOUSE_OVER_HINT) { if (myFromKeyboard) { text.insert(0, "(" + KeymapUtil.getFirstKeyboardShortcutText("ShowErrorDescription") + ") ", SimpleTextAttributes.GRAYED_ATTRIBUTES); } // first remove a shortcut created for any previous presentation (like "Collecting data...") disposeVisibleHint(); myDisposable = Disposer.newDisposable(); ShortcutSet shortcut = KeymapUtil.getActiveKeymapShortcuts(IdeActions.ACTION_SHOW_ERROR_DESCRIPTION); DumbAwareAction.create(e -> showTree(result)) .registerCustomShortcutSet(shortcut, getEditor().getContentComponent(), myDisposable); } showTooltipPopup(createExpandableHintComponent(icon, text, getShowPopupRunnable(result, myFullValueEvaluator), myFullValueEvaluator)); } myShown = true; } @Override public void setFullValueEvaluator(@NotNull XFullValueEvaluator fullValueEvaluator) { myFullValueEvaluator = fullValueEvaluator; } @Override public boolean isObsolete() { return isHintHidden(); } }, XValuePlace.TOOLTIP); } @Override public void errorOccurred(@NotNull final String errorMessage) { showEvaluating.set(false); ApplicationManager.getApplication().invokeLater(() -> { if (getType() == ValueHintType.MOUSE_CLICK_HINT) { showHint(HintUtil.createErrorLabel(errorMessage)); } else { hideCurrentHint(); } }); LOG.debug("Cannot evaluate '" + myExpression + "':" + errorMessage); } }; if (myElement != null && myEvaluator instanceof XDebuggerPsiEvaluator) { ((XDebuggerPsiEvaluator)myEvaluator).evaluate(myElement, callback); } else { myEvaluator.evaluate(myExpression, callback, myExpressionPosition); } }
evaluateAndShowHint
296,397
void (@NotNull final XValue result) { result.computePresentation(new XValueNodePresentationConfigurator.ConfigurableXValueNodeImpl() { private XFullValueEvaluator myFullValueEvaluator; private boolean myShown = false; @Override public void applyPresentation(@Nullable Icon icon, @NotNull XValuePresentation valuePresenter, boolean hasChildren) { showEvaluating.set(false); if (isHintHidden()) { return; } SimpleColoredText text = new SimpleColoredText(); XValueNodeImpl.buildText(valuePresenter, text, false); if (!hasChildren) { showTooltipPopup(createHintComponent(icon, text, valuePresenter, myFullValueEvaluator)); } else if (getType() == ValueHintType.MOUSE_CLICK_HINT) { if (!myShown) { Runnable showPopupRunnable = getShowPopupRunnable(result, myFullValueEvaluator); showPopupRunnable.run(); } } else { if (getType() == ValueHintType.MOUSE_OVER_HINT) { if (myFromKeyboard) { text.insert(0, "(" + KeymapUtil.getFirstKeyboardShortcutText("ShowErrorDescription") + ") ", SimpleTextAttributes.GRAYED_ATTRIBUTES); } // first remove a shortcut created for any previous presentation (like "Collecting data...") disposeVisibleHint(); myDisposable = Disposer.newDisposable(); ShortcutSet shortcut = KeymapUtil.getActiveKeymapShortcuts(IdeActions.ACTION_SHOW_ERROR_DESCRIPTION); DumbAwareAction.create(e -> showTree(result)) .registerCustomShortcutSet(shortcut, getEditor().getContentComponent(), myDisposable); } showTooltipPopup(createExpandableHintComponent(icon, text, getShowPopupRunnable(result, myFullValueEvaluator), myFullValueEvaluator)); } myShown = true; } @Override public void setFullValueEvaluator(@NotNull XFullValueEvaluator fullValueEvaluator) { myFullValueEvaluator = fullValueEvaluator; } @Override public boolean isObsolete() { return isHintHidden(); } }, XValuePlace.TOOLTIP); }
evaluated
296,398
void (@Nullable Icon icon, @NotNull XValuePresentation valuePresenter, boolean hasChildren) { showEvaluating.set(false); if (isHintHidden()) { return; } SimpleColoredText text = new SimpleColoredText(); XValueNodeImpl.buildText(valuePresenter, text, false); if (!hasChildren) { showTooltipPopup(createHintComponent(icon, text, valuePresenter, myFullValueEvaluator)); } else if (getType() == ValueHintType.MOUSE_CLICK_HINT) { if (!myShown) { Runnable showPopupRunnable = getShowPopupRunnable(result, myFullValueEvaluator); showPopupRunnable.run(); } } else { if (getType() == ValueHintType.MOUSE_OVER_HINT) { if (myFromKeyboard) { text.insert(0, "(" + KeymapUtil.getFirstKeyboardShortcutText("ShowErrorDescription") + ") ", SimpleTextAttributes.GRAYED_ATTRIBUTES); } // first remove a shortcut created for any previous presentation (like "Collecting data...") disposeVisibleHint(); myDisposable = Disposer.newDisposable(); ShortcutSet shortcut = KeymapUtil.getActiveKeymapShortcuts(IdeActions.ACTION_SHOW_ERROR_DESCRIPTION); DumbAwareAction.create(e -> showTree(result)) .registerCustomShortcutSet(shortcut, getEditor().getContentComponent(), myDisposable); } showTooltipPopup(createExpandableHintComponent(icon, text, getShowPopupRunnable(result, myFullValueEvaluator), myFullValueEvaluator)); } myShown = true; }
applyPresentation
296,399
void (@NotNull XFullValueEvaluator fullValueEvaluator) { myFullValueEvaluator = fullValueEvaluator; }
setFullValueEvaluator