@Nullable @Override public XSourcePosition getSourcePosition() { VirtualFile file = findFile(); return file == null ? null : XDebuggerUtil.getInstance().createPosition(file, myLocation.line - 1); }
/** * Returns the source position. This is used to show the debug hit in the file. */ @Nullable @Override public XSourcePosition getSourcePosition() { VirtualFile file = findFile(); return file == null ? null : XDebuggerUtil.getInstance().createPosition(file, myFrame.getLineID() - 1); }
@Nullable public static SourcePosition create(@NotNull String filePath, int line) { VirtualFile file = LocalFileSystem.getInstance().findFileByPath(filePath); XSourcePosition sourcePosition = XDebuggerUtil.getInstance().createPosition(file, line); if (sourcePosition != null) { return new SourcePosition(sourcePosition); } else { return null; } }
/** Initialize the frame. */ public CloudStackFrame( @NotNull Project project, @NotNull StackFrame frame, @NotNull List<Variable> variableTable, @Nullable List<Variable> evaluatedExpressions, @NotNull ServerToIdeFileResolver fileResolver) { this.frame = frame; this.variableTable = variableTable; this.evaluatedExpressions = evaluatedExpressions; String path = frame.getLocation().getPath(); if (!Strings.isNullOrEmpty(path)) { sourcePosition = XDebuggerUtil.getInstance() .createPosition( fileResolver.getFileFromPath(project, path), frame.getLocation().getLine() - 1); } else { sourcePosition = null; } }
/** * Gets the source position of the stack frame, if available. * * @return The source position, or null if it is not available. */ @Nullable @Override public XSourcePosition getSourcePosition() { if (m_frame.fileAbsolute == null || m_frame.line == null) { return null; } String path = m_frame.fileAbsolute.replace(File.separatorChar, '/'); if (SdkUtil.isWslPath(path)) { path = SdkUtil.translateWslPosixToWindowsPath(path); } VirtualFile file = LocalFileSystem.getInstance().findFileByPath(path); if (file == null) { return null; } return XDebuggerUtil.getInstance().createPosition(file, m_frame.line - 1); }