Java Code Examples for com.intellij.xdebugger.breakpoints.XLineBreakpoint#getSourcePosition()

The following examples show how to use com.intellij.xdebugger.breakpoints.XLineBreakpoint#getSourcePosition() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MuleBreakpointType.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project)
{
    final XSourcePosition position = breakpoint.getSourcePosition();
    if (position == null)
    {
        return null;
    }

    final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
    if (file == null)
    {
        return null;
    }

    return new MuleDebuggerEditorsProvider();
}
 
Example 2
Source File: WeaveBreakpointType.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project)
{
    final XSourcePosition position = breakpoint.getSourcePosition();
    if (position == null)
    {
        return null;
    }

    final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
    if (file == null)
    {
        return null;
    }

    return new WeaveDebuggerEditorsProvider();
}
 
Example 3
Source File: HaxeDebugRunner.java    From intellij-haxe with Apache License 2.0 6 votes vote down vote up
private void registerBreakpoint
  (@NotNull final XLineBreakpoint<XBreakpointProperties> breakpoint) {
  final XSourcePosition position = breakpoint.getSourcePosition();
  if (position == null) {
    return;
  }

  String path = getRelativePath(mProject, position.getFile());

  DebugProcess.this.enqueueCommand
    (debugger.Command.AddFileLineBreakpoint
      (path, position.getLine() + 1), new MessageListener() {
      public void handleMessage(int messageId,
                                debugger.Message message) {
        if (messageId == JavaProtocol.IdFileLineBreakpointNumber) {
          mMap.put(breakpoint, (Integer)(message.params[0]));
        }
        else {
          getSession().updateBreakpointPresentation
            (breakpoint,
             AllIcons.Debugger.Db_invalid_breakpoint, null);
          DebugProcess.this.warn("Cannot set breakpoint");
        }
      }
    });
}
 
Example 4
Source File: XQueryBreakpointHandler.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
@Override
public void registerBreakpoint(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint) {
    final XSourcePosition sourcePosition = breakpoint.getSourcePosition();
    if (isSourcePositionInvalid(sourcePosition)) return;

    final int lineNumber = getActualLineNumber(breakpoint.getLine());
    if (handleInvalidLine(breakpoint, lineNumber)) return;
    debugProcess.setBreakpoint(getFileUrl(sourcePosition), lineNumber, breakpoint.getConditionExpression());
}
 
Example 5
Source File: XQueryBreakpointHandler.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
@Override
public void unregisterBreakpoint(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, boolean temporary) {
    final XSourcePosition sourcePosition = breakpoint.getSourcePosition();
    if (isSourcePositionInvalid(sourcePosition)) return;

    final int lineNumber = getActualLineNumber(breakpoint.getLine());
    if (handleInvalidLine(breakpoint, lineNumber)) return;
    debugProcess.removeBreakpoint(getFileUrl(sourcePosition), lineNumber);
}
 
Example 6
Source File: XQueryBreakpointType.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project) {
    final XSourcePosition position = breakpoint.getSourcePosition();
    if (position == null) {
        return null;
    }
    final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
    if (file == null) {
        return null;
    }
    return new XQueryEditorsProvider();
}
 
Example 7
Source File: MuleConfigUtils.java    From mule-intellij-plugins with Apache License 2.0 4 votes vote down vote up
@NotNull
public static Breakpoint toMuleBreakpoint(Project project, XLineBreakpoint<XBreakpointProperties> lineBreakpoint, @Nullable Map<String, String> modulesToAppsMap) {
    final XSourcePosition sourcePosition = lineBreakpoint.getSourcePosition();
    final XExpression conditionExpression = lineBreakpoint.getConditionExpression();
    return toMuleBreakpoint(project, sourcePosition, conditionExpression, modulesToAppsMap);
}
 
Example 8
Source File: AddBreakpointCommand.java    From CppTools with Apache License 2.0 4 votes vote down vote up
private static String fileName(XLineBreakpoint<XBreakpointProperties> breakpoint) {
  XSourcePosition sourcePosition = breakpoint.getSourcePosition();

  return sourcePosition != null ? sourcePosition.getFile().getName():"unknown.cpp";
}