highlighting source lines that are attributed to machine code#992
highlighting source lines that are attributed to machine code#992omarArm wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new source-file highlighting feature that queries debug adapter breakpoint locations and decorates source lines with generated machine-code mappings.
Changes:
- Introduces
SourceFileHighlightingand unit tests. - Activates the feature during desktop extension activation.
- Extends the VS Code Jest mock with
Rangeand editor decoration APIs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/features/source-file-highlighting/source-file-highlighting.ts |
Implements executable-line lookup and editor decorations. |
src/features/source-file-highlighting/source-file-highlighting.test.ts |
Adds tests for breakpoint-location requests and decoration behavior. |
src/desktop/extension.ts |
Wires the new highlighting feature into extension activation. |
__mocks__/vscode.js |
Adds mock support for ranges and text editor decoration APIs. |
Comments suppressed due to low confidence (1)
src/features/source-file-highlighting/source-file-highlighting.ts:38
- This callback starts an async operation without awaiting or catching it. If
breakpointLocationsrejects (for example because the active adapter does not support the request), the rejection is unhandled and can surface as an extension error; handle/log the promise rejection at this boundary.
vscode.window.onDidChangeActiveTextEditor(editor => {
this.handleOnDidChangeActiveTextEditor(editor);
});
| vscode.window.onDidChangeActiveTextEditor(editor => { | ||
| this.handleOnDidChangeActiveTextEditor(editor); | ||
| }); |
|
|
||
| private registerToTrackerEvents(): void { | ||
| const onDidChangeActiveDebugSessionDisposable = vscode.debug.onDidChangeActiveDebugSession(session => { | ||
| this.activeDebugSession = session; |
| }); | ||
| this.context.subscriptions.push(onDidChangeActiveDebugSessionDisposable); | ||
| } | ||
|
|
||
| private async handleOnDidChangeActiveTextEditor(editor: vscode.TextEditor | undefined): Promise<void> { | ||
| if (!editor || !this.activeDebugSession) { | ||
| return; | ||
| } | ||
| const breakpointLocations = await this.getBreakpointLocations(editor); | ||
| if (!breakpointLocations) { |
| private executableLineDecorator = vscode.window.createTextEditorDecorationType({ | ||
| // turn it red for testing | ||
| backgroundColor: 'rgba(222, 199, 199, 0.3)', | ||
| // only highlight the margin of the line to avoid obscuring code | ||
| isWholeLine: true, | ||
| }); |
| // turn it red for testing | ||
| backgroundColor: 'rgba(222, 199, 199, 0.3)', | ||
| // only highlight the margin of the line to avoid obscuring code | ||
| isWholeLine: true, |
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (2)
🛟 Help
|

Fixes
Changes
Note: We can agree on what colour to choose for highlighting, that wouldn't be a major change
Screenshots
Checklist