Cannot get the XDebuggerTree of another project
Answered
I am developing a plugin that can compare the variables of two projects during debugging. The code base is at Github. The link is shown below.
https://github.com/lgxbslgx/comparer
I want to get the debugging variables of current project and another project, and then compare the variables and highlight the difference. The unfinished code is shown below.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
// get the XDebuggerTree of current project
XDebuggerTree currentTree = XDebuggerTree.getTree(e);
// TODO get another Tree
XDebuggerTree anotherTree = null;
// TODO Compare
compare(currentTree, anotherTree);
}
I can use
XDebuggerTree currentTree = XDebuggerTree.getTree(e);
to get the XDebuggerTree of the current project. But I cannot find an api to get the XDebuggerTree of another project.
Please sign in to leave a comment.
Hi, this is not easy currently. I'd try this:
find the required debug session, use `com.intellij.xdebugger.impl.XDebugSessionImpl#getSessionTab` to get the session tab, then get the UI with `getUi`, there you can try to find the variables view, see `com.intellij.xdebugger.impl.ui.XDebugSessionTab#showView` for a reference , but use `com.intellij.debugger.ui.DebuggerContentInfo#VARIABLES_CONTENT` viewId. Content should probably provide the tree with getData for `com.intellij.xdebugger.impl.ui.tree.XDebuggerTree#XDEBUGGER_TREE_KEY`. Good luck.