Skip to content

Commit

Permalink
debug: fix location references not working on remotes
Browse files Browse the repository at this point in the history
Fixes #225967
  • Loading branch information
connor4312 committed Aug 21, 2024
1 parent d193e4b commit e9de57d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/vs/workbench/contrib/debug/browser/linkDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,12 @@ export class LinkDetector {
const link = this.createLink(text);
this.decorateLink(link, undefined, text, hoverBehavior, async (preserveFocus: boolean) => {
const location = await session.resolveLocationReference(locationReference);

await this.editorService.openEditor({
resource: location.source.uri,
options: {
preserveFocus,
selection: {
startLineNumber: location.line,
startColumn: location.column,
endLineNumber: location.endLine,
endColumn: location.endColumn,
},
},
});
await location.source.openInEditor(this.editorService, {
startLineNumber: location.line,
startColumn: location.column,
endLineNumber: location.endLine ?? location.line,
endColumn: location.endColumn ?? location.column,
}, preserveFocus);
});

return link;
Expand Down
3 changes: 3 additions & 0 deletions src/vs/workbench/contrib/debug/common/debugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ function convertPaths(msg: DebugProtocol.ProtocolMessage, fixSourcePath: (toDA:
di.body?.instructions.forEach(di => fixSourcePath(false, di.location));
}
break;
case 'locations':
fixSourcePath(false, (<DebugProtocol.LocationsResponse>response).body?.source);
break;
default:
break;
}
Expand Down

0 comments on commit e9de57d

Please sign in to comment.