diff --git a/src/vs/workbench/parts/debug/browser/debugHover.ts b/src/vs/workbench/parts/debug/browser/debugHover.ts index 0d7ed1c32e57f356c78bb0103d54938b1687bd59..ed8e1d0e01dcbb78b7cc87d53e4099fd2b60cc6e 100644 --- a/src/vs/workbench/parts/debug/browser/debugHover.ts +++ b/src/vs/workbench/parts/debug/browser/debugHover.ts @@ -86,7 +86,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { namesToFind.push(hoveringOver); namesToFind[0] = namesToFind[0].substring(namesToFind[0].lastIndexOf(' ') + 1); - this.getExpression(namesToFind).done(expression => { if (!expression || !expression.available) { this.hide(); diff --git a/src/vs/workbench/parts/debug/browser/debugViewer.ts b/src/vs/workbench/parts/debug/browser/debugViewer.ts index 3e80dc7c74c54b3e98bfe6f3114d4618735053c9..db7906f647a4e7165268c4f47fc49d90c0ef02c2 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewer.ts @@ -742,8 +742,8 @@ export class BreakpointsActionProvider implements renderer.IActionProvider { actions.push(this.instantiationService.createInstance(debugactions.DisableAllBreakpointsAction, debugactions.DisableAllBreakpointsAction.ID, debugactions.DisableAllBreakpointsAction.LABEL)); actions.push(new actionbar.Separator()); - // actions.push(this.instantiationService.createInstance(debugactions.AddFunctionBreakpointAction, debugactions.AddFunctionBreakpointAction.ID, debugactions.AddFunctionBreakpointAction.LABEL)); - // actions.push(new actionbar.Separator()); + actions.push(this.instantiationService.createInstance(debugactions.AddFunctionBreakpointAction, debugactions.AddFunctionBreakpointAction.ID, debugactions.AddFunctionBreakpointAction.LABEL)); + actions.push(new actionbar.Separator()); actions.push(this.instantiationService.createInstance(debugactions.ReapplyBreakpointsAction, debugactions.ReapplyBreakpointsAction.ID, debugactions.ReapplyBreakpointsAction.LABEL)); diff --git a/src/vs/workbench/parts/debug/browser/debugViewlet.ts b/src/vs/workbench/parts/debug/browser/debugViewlet.ts index acdfbfda9ec21763f0ab5b4c8518a55f5b19eaad..a36432dd251692735277917dd526ee109261cd98 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewlet.ts @@ -395,7 +395,7 @@ class BreakpointsView extends viewlet.AdaptiveCollapsibleViewletView { public getActions(): actions.IAction[] { return [ - // this.instantiationService.createInstance(debugactions.AddFunctionBreakpointAction, debugactions.AddFunctionBreakpointAction.ID, debugactions.AddFunctionBreakpointAction.LABEL), + this.instantiationService.createInstance(debugactions.AddFunctionBreakpointAction, debugactions.AddFunctionBreakpointAction.ID, debugactions.AddFunctionBreakpointAction.LABEL), this.instantiationService.createInstance(debugactions.ReapplyBreakpointsAction, debugactions.ReapplyBreakpointsAction.ID, debugactions.ReapplyBreakpointsAction.LABEL), this.instantiationService.createInstance(debugactions.ToggleBreakpointsActivatedAction, debugactions.ToggleBreakpointsActivatedAction.ID, debugactions.ToggleBreakpointsActivatedAction.LABEL), this.instantiationService.createInstance(debugactions.RemoveAllBreakpointsAction, debugactions.RemoveAllBreakpointsAction.ID, debugactions.RemoveAllBreakpointsAction.LABEL) diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index de0b12471b6b10af241975e15992034fab728f18..c07d984adcbcc0f4345ad9b333da424bd0a23dfc 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -86,6 +86,7 @@ export interface IBreakpoint extends IEnablement { export interface IFunctionBreakpoint extends IEnablement { name: string; + verified: boolean; } export interface IExceptionBreakpoint extends IEnablement { diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index b2b41903754f034ee8ddd6c1f2e233fd59a9b272..43a961a3eb1c4ce66fa2723bdd9dd081a2d96c5a 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -301,10 +301,10 @@ export class Breakpoint implements debug.IBreakpoint { export class FunctionBreakpoint implements debug.IFunctionBreakpoint { private id: string; - public error: boolean; + public verified: boolean; constructor(public name: string, public enabled: boolean) { - this.error = false; + this.verified = false; this.id = uuid.generateUuid(); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 9528afdd24f1db735d597f4fe79cfc38746a2fa6..8a8fb94fcd84b0cf0c6295f5eee147f49d9aea70 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -226,7 +226,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService private registerSessionListeners(): void { this.toDispose.push(this.session.addListener2(debug.SessionEvents.INITIALIZED, (event: DebugProtocol.InitializedEvent) => - this.sendAllBreakpoints().then(() => this.sendExceptionBreakpoints()).then(() => { + this.sendAllBreakpoints().then(() => { if (this.session.capablities.supportsConfigurationDoneRequest) { this.session.configurationDone().done(null, errors.onUnexpectedError); } @@ -413,8 +413,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService const breakpoint = element; return this.sendBreakpoints(breakpoint.source.uri); } else if (element instanceof model.FunctionBreakpoint) { - return TPromise.as(null); - // TODO@Isidor send function breakpoints and return + return this.sendFunctionBreakpoints(); } return this.sendExceptionBreakpoints(); @@ -445,20 +444,17 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService public addFunctionBreakpoint(functionName?: string): TPromise { this.model.addFunctionBreakpoint(functionName); - // TODO@Isidor send updated function breakpoints - return TPromise.as(null); + return this.sendFunctionBreakpoints(); } public renameFunctionBreakpoint(id: string, newFunctionName: string): TPromise { this.model.renameFunctionBreakpoint(id, newFunctionName); - // TODO@Isidor send updated function breakpoints - return TPromise.as(null); + return this.sendFunctionBreakpoints(); } public removeFunctionBreakpoints(id?: string): TPromise { this.model.removeFunctionBreakpoints(id); - // TODO@Isidor send updated function breakpoints - return TPromise.as(null); + return this.sendFunctionBreakpoints(); } public addReplExpression(name: string): TPromise { @@ -784,12 +780,15 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService } public sendAllBreakpoints(): TPromise { - return TPromise.join(arrays.distinct(this.model.getBreakpoints(), bp => bp.source.uri.toString()).map(bp => this.sendBreakpoints(bp.source.uri))); + return TPromise.join(arrays.distinct(this.model.getBreakpoints(), bp => bp.source.uri.toString()).map(bp => this.sendBreakpoints(bp.source.uri))) + .then(() => this.sendFunctionBreakpoints()) + // send exception breakpoints at the end since some debug adapters rely on the order + .then(() => this.sendExceptionBreakpoints()); } private sendBreakpoints(modelUri: uri): TPromise { if (!this.session || !this.session.readyForBreakpoints) { - return TPromise.as(undefined); + return TPromise.as(null); } const breakpointsToSend = arrays.distinct( @@ -810,13 +809,25 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService }); } + private sendFunctionBreakpoints(): TPromise { + if (!this.session || !this.session.readyForBreakpoints) { + return TPromise.as(null); + } + + const breakpoints = this.model.getFunctionBreakpoints().filter(fbp => fbp.enabled); + return this.session.setFunctionBreakpoints({ breakpoints }).then(response => { + let index = 0; + breakpoints.forEach(bp => bp.verified = response.body.breakpoints[index++].verified); + }); + } + private sendExceptionBreakpoints(): TPromise { if (!this.session || !this.session.readyForBreakpoints) { - return TPromise.as(undefined); + return TPromise.as(null); } - const enabledExBreakpoints = this.model.getExceptionBreakpoints().filter(exb => exb.enabled); - return this.session.setExceptionBreakpoints({ filters: enabledExBreakpoints.map(exb => exb.name) }); + const enabledExceptionBps = this.model.getExceptionBreakpoints().filter(exb => exb.enabled); + return this.session.setExceptionBreakpoints({ filters: enabledExceptionBps.map(exb => exb.name) }); } private onFileChanges(fileChangesEvent: FileChangesEvent): void { diff --git a/src/vs/workbench/parts/debug/node/rawDebugSession.ts b/src/vs/workbench/parts/debug/node/rawDebugSession.ts index 128227d1e558615da51861bcb9d285f402af1f98..bb0c332875a0c9949e4d4199cf5e83b698b3c86a 100644 --- a/src/vs/workbench/parts/debug/node/rawDebugSession.ts +++ b/src/vs/workbench/parts/debug/node/rawDebugSession.ts @@ -136,6 +136,10 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes return this.send('setBreakpoints', args); } + public setFunctionBreakpoints(args: DebugProtocol.SetFunctionBreakpointsArguments): TPromise { + return this.send('setFunctionBreakpoints', args); + } + public setExceptionBreakpoints(args: DebugProtocol.SetExceptionBreakpointsArguments): TPromise { return this.send('setExceptionBreakpoints', args); }