Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add breakpointMargin property to cell metadata #97849

Merged
merged 1 commit into from May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/vs/vscode.proposed.d.ts
Expand Up @@ -1591,6 +1591,12 @@ declare module 'vscode' {
*/
runnable?: boolean;

/**
* Controls if the cell has a margin to support the breakpoint UI.
* This metadata is ignored for markdown cell.
*/
breakpointMargin?: boolean;

/**
* The order in which this cell was executed.
*/
Expand Down
Expand Up @@ -159,6 +159,13 @@ export class CellEditorOptions {
get value(): IEditorOptions {
return this._value;
}

setGlyphMargin(gm: boolean): void {
if (gm !== this._value.glyphMargin) {
this._value.glyphMargin = gm;
this._onDidChange.fire(this.value);
}
}
}

abstract class AbstractCellRenderer {
Expand Down Expand Up @@ -989,6 +996,10 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
} else {
templateData.timer.clear();
}

if (typeof metadata.breakpointMargin === 'boolean') {
this.editorOptions.setGlyphMargin(metadata.breakpointMargin);
}
}

private renderExecutionOrder(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void {
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/notebook/common/notebookCommon.ts
Expand Up @@ -79,6 +79,7 @@ export enum NotebookCellRunState {
export interface NotebookCellMetadata {
editable?: boolean;
runnable?: boolean;
breakpointMargin?: boolean;
executionOrder?: number;
statusMessage?: string;
runState?: NotebookCellRunState;
Expand Down