Skip to content

Commit

Permalink
ProjectManager getSourceLocation can now take column number
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdp committed Jan 22, 2025
1 parent 491829b commit 6b115ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/managers/ProjectManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ export class ProjectManager {
/**
* @param debuggerPath
* @param debuggerLineNumber - the 1-based line number from the debugger
* @param debuggerColumnNumber - the 1-based column number from the debugger
*/
public async getSourceLocation(debuggerPath: string, debuggerLineNumber: number) {
public async getSourceLocation(debuggerPath: string, debuggerLineNumber: number, debuggerColumnNumber = 1) {
return this.sourceLocationCache.getOrAdd(`${debuggerPath}-${debuggerLineNumber}`, async () => {
//get source location using
let stagingFileInfo = await this.getStagingFileInfo(debuggerPath);
Expand All @@ -123,7 +124,7 @@ export class ProjectManager {

let sourceLocation = await this.locationManager.getSourceLocation({
lineNumber: debuggerLineNumber,
columnIndex: 0,
columnIndex: debuggerColumnNumber - 1,
fileMappings: project.fileMappings,
rootDir: project.rootDir,
stagingFilePath: stagingFileInfo.absolutePath,
Expand All @@ -142,7 +143,7 @@ export class ProjectManager {
return {
filePath: stagingFileInfo.absolutePath,
lineNumber: sourceLocation?.lineNumber || debuggerLineNumber,
columnIndex: 0
columnIndex: debuggerColumnNumber - 1
} as SourceLocation;
} else {
return sourceLocation;
Expand Down

0 comments on commit 6b115ff

Please sign in to comment.