How to add breakpoint with my plugin
Hi,
I'm developing a plugin and I'm in a situation where I have a class name and line number and I would like to add a breakpoint for this class and line (condition breakpoint actually, but this I will investigate later).
Thanks for any hint
请先登录再写评论。
It is possible but the required classes aren't included into Open API so use it at your own risk:
DebuggerManagerEx.getInstanceEx(project).getBreakpointManager().addLineBreakpoint(document, line)
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Thank you Nikolay it works. I thought that conditional breakpouint would be easy, but I didn't find a way.
I used following construction
BreakpointFactory testBreakpointFactory = BreakpointFactory.getInstance(new Key<LineBreakpoint>("test"));
and planned to create new breakpoint by the factory (with class, line, condition ....), but there is only method
createBreakpoint(com.intellij.openapi.project.Project project, org.jdom.Element element);
I assume element contains all those params, but I'm wondering what is the structure.
Thanks again Milan
BreakpointManager.addLineBreakpoint() gives you back a LineBreakpoint object. Doesn't it work to do a getCondition().setText("<your condition here>") on the LineBreakpoint instance? Just an idea, didn't test it though.
Thanks Bjorn! I have downloaded the Idea source code during the weekend and now many things make sense ;-). It works perfectly!