Skip to content

Commit d40066d

Browse files
authored
Merge pull request microsoft#97849 from microsoft/aweinand/breakpointmargin
add breakpointMargin property to cell metadata
2 parents 22df24b + 2111514 commit d40066d

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,12 @@ declare module 'vscode' {
15911591
*/
15921592
runnable?: boolean;
15931593

1594+
/**
1595+
* Controls if the cell has a margin to support the breakpoint UI.
1596+
* This metadata is ignored for markdown cell.
1597+
*/
1598+
breakpointMargin?: boolean;
1599+
15941600
/**
15951601
* The order in which this cell was executed.
15961602
*/

src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ export class CellEditorOptions {
159159
get value(): IEditorOptions {
160160
return this._value;
161161
}
162+
163+
setGlyphMargin(gm: boolean): void {
164+
if (gm !== this._value.glyphMargin) {
165+
this._value.glyphMargin = gm;
166+
this._onDidChange.fire(this.value);
167+
}
168+
}
162169
}
163170

164171
abstract class AbstractCellRenderer {
@@ -989,6 +996,10 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
989996
} else {
990997
templateData.timer.clear();
991998
}
999+
1000+
if (typeof metadata.breakpointMargin === 'boolean') {
1001+
this.editorOptions.setGlyphMargin(metadata.breakpointMargin);
1002+
}
9921003
}
9931004

9941005
private renderExecutionOrder(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void {

src/vs/workbench/contrib/notebook/common/notebookCommon.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export enum NotebookCellRunState {
7979
export interface NotebookCellMetadata {
8080
editable?: boolean;
8181
runnable?: boolean;
82+
breakpointMargin?: boolean;
8283
executionOrder?: number;
8384
statusMessage?: string;
8485
runState?: NotebookCellRunState;

0 commit comments

Comments
 (0)