提交 93b19767 编写于 作者: I isidor

baseDebugView strict null checks

上级 ec10e5b2
......@@ -33,6 +33,7 @@
"./vs/workbench/services/timer/**/*.ts",
"./vs/workbench/contrib/webview/**/*.ts",
"./vs/workbench/contrib/debug/common/**/*.ts",
"./vs/workbench/contrib/debug/node/**/*.ts",
"./vs/workbench/contrib/preferences/common/**/*.ts",
"./vs/workbench/contrib/preferences/**/settings*.ts",
"./vs/workbench/contrib/terminal/**/*"
......@@ -239,18 +240,9 @@
"./vs/workbench/contrib/debug/browser/debugStatus.ts",
"./vs/workbench/contrib/debug/browser/exceptionWidget.ts",
"./vs/workbench/contrib/debug/browser/linkDetector.ts",
"./vs/workbench/contrib/debug/browser/baseDebugView.ts",
"./vs/workbench/contrib/debug/browser/statusbarColorProvider.ts",
"./vs/workbench/contrib/debug/common/debug.ts",
"./vs/workbench/contrib/debug/common/debugProtocol.d.ts",
"./vs/workbench/contrib/debug/common/debugSchemas.ts",
"./vs/workbench/contrib/debug/common/debugSource.ts",
"./vs/workbench/contrib/debug/common/debugUtils.ts",
"./vs/workbench/contrib/debug/common/debugViewModel.ts",
"./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts",
"./vs/workbench/contrib/debug/node/debugAdapter.ts",
"./vs/workbench/contrib/debug/node/debugger.ts",
"./vs/workbench/contrib/debug/node/telemetryApp.ts",
"./vs/workbench/contrib/debug/node/terminals.ts",
"./vs/workbench/contrib/debug/test/common/debugSource.test.ts",
"./vs/workbench/contrib/debug/test/common/debugUtils.test.ts",
"./vs/workbench/contrib/debug/test/common/mockDebug.ts",
......
......@@ -356,30 +356,30 @@ export interface IExceptionInfo {
export interface IViewModel extends ITreeElement {
/**
* Returns the focused debug session or null if no session is stopped.
* Returns the focused debug session or undefined if no session is stopped.
*/
readonly focusedSession: IDebugSession;
readonly focusedSession: IDebugSession | undefined;
/**
* Returns the focused thread or null if no thread is stopped.
* Returns the focused thread or undefined if no thread is stopped.
*/
readonly focusedThread: IThread;
readonly focusedThread: IThread | undefined;
/**
* Returns the focused stack frame or null if there are no stack frames.
* Returns the focused stack frame or undefined if there are no stack frames.
*/
readonly focusedStackFrame: IStackFrame;
readonly focusedStackFrame: IStackFrame | undefined;
getSelectedExpression(): IExpression;
getSelectedFunctionBreakpoint(): IFunctionBreakpoint;
setSelectedExpression(expression: IExpression): void;
setSelectedFunctionBreakpoint(functionBreakpoint: IFunctionBreakpoint): void;
getSelectedExpression(): IExpression | undefined;
getSelectedFunctionBreakpoint(): IFunctionBreakpoint | undefined;
setSelectedExpression(expression: IExpression | undefined): void;
setSelectedFunctionBreakpoint(functionBreakpoint: IFunctionBreakpoint | undefined): void;
isMultiSessionView(): boolean;
onDidFocusSession: Event<IDebugSession | undefined>;
onDidFocusStackFrame: Event<{ stackFrame: IStackFrame, explicit: boolean }>;
onDidSelectExpression: Event<IExpression>;
onDidFocusStackFrame: Event<{ stackFrame: IStackFrame | undefined, explicit: boolean }>;
onDidSelectExpression: Event<IExpression | undefined>;
}
export interface IEvaluate {
......
......@@ -11,14 +11,14 @@ export class ViewModel implements IViewModel {
firstSessionStart = true;
private _focusedStackFrame: IStackFrame;
private _focusedSession: IDebugSession;
private _focusedThread: IThread;
private selectedExpression: IExpression;
private selectedFunctionBreakpoint: IFunctionBreakpoint;
private _focusedStackFrame: IStackFrame | undefined;
private _focusedSession: IDebugSession | undefined;
private _focusedThread: IThread | undefined;
private selectedExpression: IExpression | undefined;
private selectedFunctionBreakpoint: IFunctionBreakpoint | undefined;
private readonly _onDidFocusSession: Emitter<IDebugSession | undefined>;
private readonly _onDidFocusStackFrame: Emitter<{ stackFrame: IStackFrame, explicit: boolean }>;
private readonly _onDidSelectExpression: Emitter<IExpression>;
private readonly _onDidFocusStackFrame: Emitter<{ stackFrame: IStackFrame | undefined, explicit: boolean }>;
private readonly _onDidSelectExpression: Emitter<IExpression | undefined>;
private multiSessionView: boolean;
private expressionSelectedContextKey: IContextKey<boolean>;
private breakpointSelectedContextKey: IContextKey<boolean>;
......@@ -38,19 +38,19 @@ export class ViewModel implements IViewModel {
return 'root';
}
get focusedSession(): IDebugSession {
get focusedSession(): IDebugSession | undefined {
return this._focusedSession;
}
get focusedThread(): IThread {
get focusedThread(): IThread | undefined {
return this._focusedThread;
}
get focusedStackFrame(): IStackFrame {
get focusedStackFrame(): IStackFrame | undefined {
return this._focusedStackFrame;
}
setFocus(stackFrame: IStackFrame, thread: IThread, session: IDebugSession, explicit: boolean): void {
setFocus(stackFrame: IStackFrame | undefined, thread: IThread | undefined, session: IDebugSession | undefined, explicit: boolean): void {
const shouldEmitForStackFrame = this._focusedStackFrame !== stackFrame;
const shouldEmitForSession = this._focusedSession !== session;
......@@ -72,29 +72,29 @@ export class ViewModel implements IViewModel {
return this._onDidFocusSession.event;
}
get onDidFocusStackFrame(): Event<{ stackFrame: IStackFrame, explicit: boolean }> {
get onDidFocusStackFrame(): Event<{ stackFrame: IStackFrame | undefined, explicit: boolean }> {
return this._onDidFocusStackFrame.event;
}
getSelectedExpression(): IExpression {
getSelectedExpression(): IExpression | undefined {
return this.selectedExpression;
}
setSelectedExpression(expression: IExpression) {
setSelectedExpression(expression: IExpression | undefined) {
this.selectedExpression = expression;
this.expressionSelectedContextKey.set(!!expression);
this._onDidSelectExpression.fire(expression);
}
get onDidSelectExpression(): Event<IExpression> {
get onDidSelectExpression(): Event<IExpression | undefined> {
return this._onDidSelectExpression.event;
}
getSelectedFunctionBreakpoint(): IFunctionBreakpoint {
getSelectedFunctionBreakpoint(): IFunctionBreakpoint | undefined {
return this.selectedFunctionBreakpoint;
}
setSelectedFunctionBreakpoint(functionBreakpoint: IFunctionBreakpoint): void {
setSelectedFunctionBreakpoint(functionBreakpoint: IFunctionBreakpoint | undefined): void {
this.selectedFunctionBreakpoint = functionBreakpoint;
this.breakpointSelectedContextKey.set(!!functionBreakpoint);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册