gpt4 book ai didi

com.intellij.xdebugger.XSourcePosition.getLine()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 21:39:05 33 4
gpt4 key购买 nike

本文整理了Java中com.intellij.xdebugger.XSourcePosition.getLine()方法的一些代码示例,展示了XSourcePosition.getLine()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSourcePosition.getLine()方法的具体详情如下:
包路径:com.intellij.xdebugger.XSourcePosition
类名称:XSourcePosition
方法名:getLine

XSourcePosition.getLine介绍

暂无

代码示例

代码示例来源:origin: KronicDeth/intellij-elixir

public int getLine() {
 return mySourcePosition.getLine();
}

代码示例来源:origin: ballerina-platform/ballerina-lang

private XBreakpoint<BallerinaBreakpointProperties> findBreakPoint(@NotNull BreakPoint breakPoint) {
  String fileName = breakPoint.getFileName();
  String packagePath = breakPoint.getPackagePath();
  String relativeFilePathInProject;
  // If the package is ".", full path of the file will be sent as the filename.
  if (".".equals(packagePath)) {
    // Then we need to get the actual filename from the path.
    int index = fileName.lastIndexOf(File.separator);
    if (index <= -1) {
      return null;
    }
    relativeFilePathInProject = fileName.substring(index);
  } else {
    // If the absolute path is not sent, we need to construct the relative file path in the project.
    relativeFilePathInProject = packagePath.replaceAll("\\.", File.separator) + File.separator + fileName;
  }
  int lineNumber = breakPoint.getLineNumber();
  for (XBreakpoint<BallerinaBreakpointProperties> breakpoint : breakpoints) {
    XSourcePosition breakpointPosition = breakpoint.getSourcePosition();
    if (breakpointPosition == null) {
      continue;
    }
    VirtualFile fileInBreakpoint = breakpointPosition.getFile();
    int line = breakpointPosition.getLine() + 1;
    if (fileInBreakpoint.getPath().endsWith(relativeFilePathInProject) && line == lineNumber) {
      return breakpoint;
    }
  }
  return null;
}

代码示例来源:origin: ballerina-platform/ballerina-lang

int line = breakpointPosition.getLine();
Project project = getSession().getProject();

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
public void registerBreakpoint(@NotNull XLineBreakpoint<DlvBreakpointProperties> breakpoint) {
 XSourcePosition breakpointPosition = breakpoint.getSourcePosition();
 if (breakpointPosition == null) return;
 VirtualFile file = breakpointPosition.getFile();
 int line = breakpointPosition.getLine();
 send(new DlvRequest.CreateBreakpoint(file.getPath(), line + 1))
  .done(b -> {
   breakpoint.putUserData(ID, b.id);
   breakpoints.put(b.id, breakpoint);
   getSession().updateBreakpointPresentation(breakpoint, AllIcons.Debugger.Db_verified_breakpoint, null);
  })
  .rejected(t -> {
   String message = t == null ? null : t.getMessage();
   getSession().updateBreakpointPresentation(breakpoint, AllIcons.Debugger.Db_invalid_breakpoint, message);
  });
}

代码示例来源:origin: intellij-dlanguage/intellij-dlanguage

@Override
public void runToPosition(@NotNull XSourcePosition position, XSuspendContext context) {
  m_gdb.sendCommand(String.format("%s %s:%s", "-exec-until", position.getFile().getPath(), (position.getLine() + 1)));
}

代码示例来源:origin: intellij-dlanguage/intellij-dlanguage

component.append(function + "():" + (sourcePosition.getLine() + 1),
      SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.append(" (" + sourcePosition.getFile().getName() + ")",
    sourcePosition.getFile().getName() + ":" + (sourcePosition.getLine() + 1),
    SimpleTextAttributes.REGULAR_ATTRIBUTES);
} else {

代码示例来源:origin: Camelcade/Perl5-IDEA

@Nullable
 public static PerlLineBreakPointDescriptor createFromSourcePosition(XSourcePosition position, PerlDebugThread debugThread) {
  VirtualFile virtualFile = position.getFile();
  String virtualFilePath = virtualFile.getCanonicalPath();
  if (virtualFilePath == null) {
   return null;
  }
  String filePath = debugThread.getDebugProfileState().mapPathToRemote(virtualFilePath);
  if (filePath == null) {
   return null;
  }

  PerlLineBreakPointDescriptor descriptor = new PerlLineBreakPointDescriptor();
  descriptor.path = filePath;
  descriptor.line = position.getLine();
  return descriptor;
 }
}

代码示例来源:origin: intellij-dlanguage/intellij-dlanguage

String command = "-break-insert -f " + filePath + ":" + (sourcePosition.getLine() + 1);
m_gdb.sendCommand(command, new Gdb.GdbEventCallback() {
  @Override

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

when(sourcePosition.getLine()).thenReturn(sourceLine);
when(sourcePosition.getFile()).thenReturn(mockFile);
when(mockFile.isValid()).thenReturn(Boolean.TRUE);

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

location.setLine(ideBreakpoint.getSourcePosition().getLine() + 1);

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com