提交 8f9a2b0f 编写于 作者: I isidor

move restart frame to StackFrame

上级 99fd4c42
...@@ -333,12 +333,11 @@ export class RestartFrameAction extends AbstractDebugAction { ...@@ -333,12 +333,11 @@ export class RestartFrameAction extends AbstractDebugAction {
} }
public run(frame: debug.IStackFrame): TPromise<any> { public run(frame: debug.IStackFrame): TPromise<any> {
if (!frame) {
frame = this.debugService.getViewModel().focusedStackFrame;
}
const frameId = (frame && frame instanceof model.StackFrame) return frame.restart();
? frame.frameId
: this.debugService.getViewModel().focusedStackFrame.frameId;
return this.debugService.restartFrame(frameId);
} }
} }
......
...@@ -75,6 +75,7 @@ export interface IBaseSession { ...@@ -75,6 +75,7 @@ export interface IBaseSession {
disconnect(restart?: boolean, force?: boolean): TPromise<DebugProtocol.DisconnectResponse>; disconnect(restart?: boolean, force?: boolean): TPromise<DebugProtocol.DisconnectResponse>;
custom(request: string, args: any): TPromise<DebugProtocol.Response>; custom(request: string, args: any): TPromise<DebugProtocol.Response>;
onDidEvent: Event<DebugProtocol.Event>; onDidEvent: Event<DebugProtocol.Event>;
restartFrame(args: DebugProtocol.RestartFrameArguments): TPromise<DebugProtocol.RestartFrameResponse>;
} }
export interface ISession extends IBaseSession, ITreeElement { export interface ISession extends IBaseSession, ITreeElement {
...@@ -93,7 +94,6 @@ export interface ISession extends IBaseSession, ITreeElement { ...@@ -93,7 +94,6 @@ export interface ISession extends IBaseSession, ITreeElement {
continue(args: DebugProtocol.ContinueArguments): TPromise<DebugProtocol.ContinueResponse>; continue(args: DebugProtocol.ContinueArguments): TPromise<DebugProtocol.ContinueResponse>;
pause(args: DebugProtocol.PauseArguments): TPromise<DebugProtocol.PauseResponse>; pause(args: DebugProtocol.PauseArguments): TPromise<DebugProtocol.PauseResponse>;
setVariable(args: DebugProtocol.SetVariableArguments): TPromise<DebugProtocol.SetVariableResponse>; setVariable(args: DebugProtocol.SetVariableArguments): TPromise<DebugProtocol.SetVariableResponse>;
restartFrame(args: DebugProtocol.RestartFrameArguments): TPromise<DebugProtocol.RestartFrameResponse>;
completions(args: DebugProtocol.CompletionsArguments): TPromise<DebugProtocol.CompletionsResponse>; completions(args: DebugProtocol.CompletionsArguments): TPromise<DebugProtocol.CompletionsResponse>;
next(args: DebugProtocol.NextArguments): TPromise<DebugProtocol.NextResponse>; next(args: DebugProtocol.NextArguments): TPromise<DebugProtocol.NextResponse>;
source(args: DebugProtocol.SourceArguments): TPromise<DebugProtocol.SourceResponse>; source(args: DebugProtocol.SourceArguments): TPromise<DebugProtocol.SourceResponse>;
...@@ -166,6 +166,7 @@ export interface IStackFrame extends ITreeElement { ...@@ -166,6 +166,7 @@ export interface IStackFrame extends ITreeElement {
frameId: number; frameId: number;
source: Source; source: Source;
getScopes(): TPromise<IScope[]>; getScopes(): TPromise<IScope[]>;
restart(): TPromise<any>;
} }
export interface IEnablement extends ITreeElement { export interface IEnablement extends ITreeElement {
...@@ -461,7 +462,6 @@ export interface IDebugService { ...@@ -461,7 +462,6 @@ export interface IDebugService {
stepBack(threadId: number): TPromise<void>; stepBack(threadId: number): TPromise<void>;
continue(threadId: number): TPromise<void>; continue(threadId: number): TPromise<void>;
pause(threadId: number): TPromise<any>; pause(threadId: number): TPromise<any>;
restartFrame(frameId: number): TPromise<any>;
completions(text: string, position: Position): TPromise<ISuggestion[]>; completions(text: string, position: Position): TPromise<ISuggestion[]>;
} }
......
...@@ -330,6 +330,10 @@ export class StackFrame implements debug.IStackFrame { ...@@ -330,6 +330,10 @@ export class StackFrame implements debug.IStackFrame {
return this.scopes; return this.scopes;
} }
public restart(): TPromise<any> {
return this.thread.process.restartFrame({ frameId: this.frameId });
}
} }
export class Thread implements debug.IThread { export class Thread implements debug.IThread {
...@@ -515,6 +519,10 @@ export class Process implements debug.IProcess { ...@@ -515,6 +519,10 @@ export class Process implements debug.IProcess {
public get onDidEvent(): Event<DebugProtocol.Event> { public get onDidEvent(): Event<DebugProtocol.Event> {
return this.session.onDidEvent; return this.session.onDidEvent;
} }
public restartFrame(args: DebugProtocol.RestartFrameArguments): TPromise<DebugProtocol.RestartFrameResponse> {
return this.session.restartFrame(args);
}
} }
export class Breakpoint implements debug.IBreakpoint { export class Breakpoint implements debug.IBreakpoint {
......
...@@ -942,14 +942,6 @@ export class DebugService implements debug.IDebugService { ...@@ -942,14 +942,6 @@ export class DebugService implements debug.IDebugService {
return this.session.pause({ threadId }); return this.session.pause({ threadId });
} }
public restartFrame(frameId: number): TPromise<any> {
if (!this.session) {
return TPromise.as(null);
}
return this.session.restartFrame({ frameId });
}
public completions(text: string, position: Position): TPromise<ISuggestion[]> { public completions(text: string, position: Position): TPromise<ISuggestion[]> {
if (!this.session || !this.session.configuration.capabilities.supportsCompletionsRequest) { if (!this.session || !this.session.configuration.capabilities.supportsCompletionsRequest) {
return TPromise.as([]); return TPromise.as([]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册