提交 6fe9c0f8 编写于 作者: I isidor

strict null checks: breakpointsView

上级 04f74856
...@@ -242,6 +242,7 @@ ...@@ -242,6 +242,7 @@
"./vs/workbench/contrib/debug/browser/linkDetector.ts", "./vs/workbench/contrib/debug/browser/linkDetector.ts",
"./vs/workbench/contrib/debug/browser/baseDebugView.ts", "./vs/workbench/contrib/debug/browser/baseDebugView.ts",
"./vs/workbench/contrib/debug/browser/debugActions.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/browser/statusbarColorProvider.ts",
"./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts", "./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts",
"./vs/workbench/contrib/debug/test/common/debugSource.test.ts", "./vs/workbench/contrib/debug/test/common/debugSource.test.ts",
......
...@@ -150,7 +150,7 @@ export class BreakpointsView extends ViewletPanel { ...@@ -150,7 +150,7 @@ export class BreakpointsView extends ViewletPanel {
const breakpointType = element instanceof Breakpoint && element.logMessage ? nls.localize('Logpoint', "Logpoint") : nls.localize('Breakpoint', "Breakpoint"); const breakpointType = element instanceof Breakpoint && element.logMessage ? nls.localize('Logpoint', "Logpoint") : nls.localize('Breakpoint', "Breakpoint");
if (element instanceof Breakpoint || element instanceof FunctionBreakpoint) { 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) { if (element instanceof Breakpoint) {
return openBreakpointSource(element, false, false, this.debugService, this.editorService).then(editor => { return openBreakpointSource(element, false, false, this.debugService, this.editorService).then(editor => {
if (editor) { if (editor) {
...@@ -164,7 +164,7 @@ export class BreakpointsView extends ViewletPanel { ...@@ -164,7 +164,7 @@ export class BreakpointsView extends ViewletPanel {
this.debugService.getViewModel().setSelectedFunctionBreakpoint(element); this.debugService.getViewModel().setSelectedFunctionBreakpoint(element);
this.onBreakpointsChange(); this.onBreakpointsChange();
return undefined; return Promise.resolve(undefined);
})); }));
actions.push(new Separator()); actions.push(new Separator());
} }
...@@ -252,7 +252,7 @@ class BreakpointsDelegate implements IListVirtualDelegate<IEnablement> { ...@@ -252,7 +252,7 @@ class BreakpointsDelegate implements IListVirtualDelegate<IEnablement> {
return ExceptionBreakpointsRenderer.ID; return ExceptionBreakpointsRenderer.ID;
} }
return undefined; return '';
} }
} }
...@@ -535,7 +535,7 @@ class FunctionBreakpointInputRenderer implements IListRenderer<IFunctionBreakpoi ...@@ -535,7 +535,7 @@ class FunctionBreakpointInputRenderer implements IListRenderer<IFunctionBreakpoi
} }
} }
export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolean, preserveFocus: boolean, debugService: IDebugService, editorService: IEditorService): Promise<IEditor> { export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolean, preserveFocus: boolean, debugService: IDebugService, editorService: IEditorService): Promise<IEditor | null> {
if (breakpoint.uri.scheme === DEBUG_SCHEME && debugService.state === State.Inactive) { if (breakpoint.uri.scheme === DEBUG_SCHEME && debugService.state === State.Inactive) {
return Promise.resolve(null); return Promise.resolve(null);
} }
...@@ -543,8 +543,8 @@ export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolea ...@@ -543,8 +543,8 @@ export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolea
const selection = breakpoint.endLineNumber ? { const selection = breakpoint.endLineNumber ? {
startLineNumber: breakpoint.lineNumber, startLineNumber: breakpoint.lineNumber,
endLineNumber: breakpoint.endLineNumber, endLineNumber: breakpoint.endLineNumber,
startColumn: breakpoint.column, startColumn: breakpoint.column || 1,
endColumn: breakpoint.endColumn endColumn: breakpoint.endColumn || Constants.MAX_SAFE_SMALL_INTEGER
} : { } : {
startLineNumber: breakpoint.lineNumber, startLineNumber: breakpoint.lineNumber,
startColumn: breakpoint.column || 1, startColumn: breakpoint.column || 1,
......
...@@ -828,7 +828,7 @@ export const enum BreakpointWidgetContext { ...@@ -828,7 +828,7 @@ export const enum BreakpointWidgetContext {
export interface IDebugEditorContribution extends IEditorContribution { export interface IDebugEditorContribution extends IEditorContribution {
showHover(range: Range, focus: boolean): Promise<void>; showHover(range: Range, focus: boolean): Promise<void>;
showBreakpointWidget(lineNumber: number, column: number, context?: BreakpointWidgetContext): void; showBreakpointWidget(lineNumber: number, column: number | undefined, context?: BreakpointWidgetContext): void;
closeBreakpointWidget(): void; closeBreakpointWidget(): void;
addLaunchConfiguration(): Promise<any>; addLaunchConfiguration(): Promise<any>;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册