From 6fe9c0f87ca5a99fdce6ebf64426b2313a4aa1b7 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 7 Mar 2019 14:15:33 +0100 Subject: [PATCH] strict null checks: breakpointsView --- src/tsconfig.strictNullChecks.json | 1 + .../contrib/debug/browser/breakpointsView.ts | 12 ++++++------ src/vs/workbench/contrib/debug/common/debug.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 6add3c9f7a9..0d549242d06 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -242,6 +242,7 @@ "./vs/workbench/contrib/debug/browser/linkDetector.ts", "./vs/workbench/contrib/debug/browser/baseDebugView.ts", "./vs/workbench/contrib/debug/browser/debugActions.ts", + "./vs/workbench/contrib/debug/browser/breakpointsView.ts", "./vs/workbench/contrib/debug/browser/statusbarColorProvider.ts", "./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts", "./vs/workbench/contrib/debug/test/common/debugSource.test.ts", diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index aa3f5428681..8154bafcccb 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -150,7 +150,7 @@ export class BreakpointsView extends ViewletPanel { const breakpointType = element instanceof Breakpoint && element.logMessage ? nls.localize('Logpoint', "Logpoint") : nls.localize('Breakpoint', "Breakpoint"); if (element instanceof Breakpoint || element instanceof FunctionBreakpoint) { - actions.push(new Action('workbench.action.debug.openEditorAndEditBreakpoint', nls.localize('editBreakpoint', "Edit {0}...", breakpointType), undefined, true, () => { + actions.push(new Action('workbench.action.debug.openEditorAndEditBreakpoint', nls.localize('editBreakpoint', "Edit {0}...", breakpointType), '', true, () => { if (element instanceof Breakpoint) { return openBreakpointSource(element, false, false, this.debugService, this.editorService).then(editor => { if (editor) { @@ -164,7 +164,7 @@ export class BreakpointsView extends ViewletPanel { this.debugService.getViewModel().setSelectedFunctionBreakpoint(element); this.onBreakpointsChange(); - return undefined; + return Promise.resolve(undefined); })); actions.push(new Separator()); } @@ -252,7 +252,7 @@ class BreakpointsDelegate implements IListVirtualDelegate { return ExceptionBreakpointsRenderer.ID; } - return undefined; + return ''; } } @@ -535,7 +535,7 @@ class FunctionBreakpointInputRenderer implements IListRenderer { +export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolean, preserveFocus: boolean, debugService: IDebugService, editorService: IEditorService): Promise { if (breakpoint.uri.scheme === DEBUG_SCHEME && debugService.state === State.Inactive) { return Promise.resolve(null); } @@ -543,8 +543,8 @@ export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolea const selection = breakpoint.endLineNumber ? { startLineNumber: breakpoint.lineNumber, endLineNumber: breakpoint.endLineNumber, - startColumn: breakpoint.column, - endColumn: breakpoint.endColumn + startColumn: breakpoint.column || 1, + endColumn: breakpoint.endColumn || Constants.MAX_SAFE_SMALL_INTEGER } : { startLineNumber: breakpoint.lineNumber, startColumn: breakpoint.column || 1, diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index 156851d8448..8b23d25969a 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -828,7 +828,7 @@ export const enum BreakpointWidgetContext { export interface IDebugEditorContribution extends IEditorContribution { showHover(range: Range, focus: boolean): Promise; - showBreakpointWidget(lineNumber: number, column: number, context?: BreakpointWidgetContext): void; + showBreakpointWidget(lineNumber: number, column: number | undefined, context?: BreakpointWidgetContext): void; closeBreakpointWidget(): void; addLaunchConfiguration(): Promise; } -- GitLab