Merge from vscode 70dc55955d586ebd427658b43cdb344f2047f9c2 (#6789)

This commit is contained in:
Anthony Dresser
2019-08-16 21:47:46 -07:00
committed by GitHub
parent fb26126bcb
commit 41d8663b09
79 changed files with 1815 additions and 572 deletions

View File

@@ -123,7 +123,7 @@ export class VariablesView extends ViewletPanel {
this.tree.updateChildren();
}));
this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
this._register(this.tree.onContextMenu(async e => await this.onContextMenu(e)));
this._register(this.onDidChangeBodyVisibility(visible => {
if (visible && this.needsRefresh) {
@@ -152,7 +152,7 @@ export class VariablesView extends ViewletPanel {
}
}
private onContextMenu(e: ITreeContextMenuEvent<IExpression | IScope>): void {
private async onContextMenu(e: ITreeContextMenuEvent<IExpression | IScope>): Promise<void> {
const variable = e.element;
if (variable instanceof Variable && !!variable.value) {
const actions: IAction[] = [];
@@ -174,6 +174,16 @@ export class VariablesView extends ViewletPanel {
return Promise.resolve(undefined);
}));
}
if (session && session.capabilities.supportsDataBreakpoints) {
const response = await session.dataBreakpointInfo(variable.name, variable.parent.reference);
const dataid = response.dataId;
if (dataid) {
actions.push(new Separator());
actions.push(new Action('debug.addDataBreakpoint', nls.localize('setDataBreakpoint', "Set Data Breakpoint"), undefined, true, () => {
return this.debugService.addDataBreakpoint(response.description, dataid, !!response.canPersist);
}));
}
}
this.contextMenuService.showContextMenu({
getAnchor: () => e.anchor,