提交 33e6f45d 编写于 作者: I isidor

debug: rename setFocusedStackFrameAndEvaluate -> focusStackFrameAndEvaluate

上级 63e2c090
...@@ -735,6 +735,6 @@ export class FocusProcessAction extends AbstractDebugAction { ...@@ -735,6 +735,6 @@ export class FocusProcessAction extends AbstractDebugAction {
public run(processName: string): TPromise<any> { public run(processName: string): TPromise<any> {
const process = this.debugService.getModel().getProcesses().filter(p => p.name === processName).pop(); const process = this.debugService.getModel().getProcesses().filter(p => p.name === processName).pop();
return this.debugService.setFocusedStackFrameAndEvaluate(null, process); return this.debugService.focusStackFrameAndEvaluate(null, process);
} }
} }
...@@ -372,7 +372,7 @@ export interface IDebugService { ...@@ -372,7 +372,7 @@ export interface IDebugService {
/** /**
* Sets the focused stack frame and evaluates all expresions against the newly focused stack frame, * Sets the focused stack frame and evaluates all expresions against the newly focused stack frame,
*/ */
setFocusedStackFrameAndEvaluate(focusedStackFrame: IStackFrame, process?: IProcess): TPromise<void>; focusStackFrameAndEvaluate(focusedStackFrame: IStackFrame, process?: IProcess): TPromise<void>;
/** /**
* Adds new breakpoints to the model for the file specified with the uri. Notifies debug adapter of breakpoint changes. * Adds new breakpoints to the model for the file specified with the uri. Notifies debug adapter of breakpoint changes.
......
...@@ -280,13 +280,13 @@ export class DebugService implements debug.IDebugService { ...@@ -280,13 +280,13 @@ export class DebugService implements debug.IDebugService {
if (callStack.length > 0) { if (callStack.length > 0) {
// focus first stack frame from top that has source location // focus first stack frame from top that has source location
const stackFrameToFocus = first(callStack, sf => sf.source && sf.source.available, callStack[0]); const stackFrameToFocus = first(callStack, sf => sf.source && sf.source.available, callStack[0]);
this.setFocusedStackFrameAndEvaluate(stackFrameToFocus).done(null, errors.onUnexpectedError); this.focusStackFrameAndEvaluate(stackFrameToFocus).done(null, errors.onUnexpectedError);
this.windowService.getWindow().focus(); this.windowService.getWindow().focus();
aria.alert(nls.localize('debuggingPaused', "Debugging paused, reason {0}, {1} {2}", event.body.reason, stackFrameToFocus.source ? stackFrameToFocus.source.name : '', stackFrameToFocus.lineNumber)); aria.alert(nls.localize('debuggingPaused', "Debugging paused, reason {0}, {1} {2}", event.body.reason, stackFrameToFocus.source ? stackFrameToFocus.source.name : '', stackFrameToFocus.lineNumber));
return this.openOrRevealSource(stackFrameToFocus.source, stackFrameToFocus.lineNumber, false, false); return this.openOrRevealSource(stackFrameToFocus.source, stackFrameToFocus.lineNumber, false, false);
} else { } else {
this.setFocusedStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError); this.focusStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError);
} }
}); });
} }
...@@ -445,7 +445,7 @@ export class DebugService implements debug.IDebugService { ...@@ -445,7 +445,7 @@ export class DebugService implements debug.IDebugService {
return !!this.contextService.getWorkspace(); return !!this.contextService.getWorkspace();
} }
public setFocusedStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame, process?: debug.IProcess): TPromise<void> { public focusStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame, process?: debug.IProcess): TPromise<void> {
const processes = this.model.getProcesses(); const processes = this.model.getProcesses();
if (!process) { if (!process) {
process = focusedStackFrame ? focusedStackFrame.thread.process : processes.length ? processes[0] : null; process = focusedStackFrame ? focusedStackFrame.thread.process : processes.length ? processes[0] : null;
...@@ -512,7 +512,7 @@ export class DebugService implements debug.IDebugService { ...@@ -512,7 +512,7 @@ export class DebugService implements debug.IDebugService {
this.telemetryService.publicLog('debugService/addReplExpression'); this.telemetryService.publicLog('debugService/addReplExpression');
return this.model.addReplExpression(this.viewModel.focusedProcess, this.viewModel.focusedStackFrame, name) return this.model.addReplExpression(this.viewModel.focusedProcess, this.viewModel.focusedStackFrame, name)
// Evaluate all watch expressions again since repl evaluation might have changed some. // Evaluate all watch expressions again since repl evaluation might have changed some.
.then(() => this.setFocusedStackFrameAndEvaluate(this.viewModel.focusedStackFrame)); .then(() => this.focusStackFrameAndEvaluate(this.viewModel.focusedStackFrame));
} }
public logToRepl(value: string | { [key: string]: any }, severity?: severity): void { public logToRepl(value: string | { [key: string]: any }, severity?: severity): void {
...@@ -802,7 +802,7 @@ export class DebugService implements debug.IDebugService { ...@@ -802,7 +802,7 @@ export class DebugService implements debug.IDebugService {
} }
this.model.removeProcess(session.getId()); this.model.removeProcess(session.getId());
this.setFocusedStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError); this.focusStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError);
this.setStateAndEmit(session.getId(), debug.State.Inactive); this.setStateAndEmit(session.getId(), debug.State.Inactive);
if (this.model.getProcesses().length === 0) { if (this.model.getProcesses().length === 0) {
...@@ -906,7 +906,7 @@ export class DebugService implements debug.IDebugService { ...@@ -906,7 +906,7 @@ export class DebugService implements debug.IDebugService {
private transitionToRunningState(session: RawDebugSession, threadId?: number): void { private transitionToRunningState(session: RawDebugSession, threadId?: number): void {
this.model.clearThreads(session.getId(), false, threadId); this.model.clearThreads(session.getId(), false, threadId);
this.setStateAndEmit(session.getId(), session.requestType === debug.SessionRequestType.LAUNCH_NO_DEBUG ? debug.State.RunningNoDebug : debug.State.Running); this.setStateAndEmit(session.getId(), session.requestType === debug.SessionRequestType.LAUNCH_NO_DEBUG ? debug.State.RunningNoDebug : debug.State.Running);
this.setFocusedStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError); this.focusStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError);
} }
private getDebugStringEditorInput(process: debug.IProcess, source: Source, value: string, mtype: string): DebugStringEditorInput { private getDebugStringEditorInput(process: debug.IProcess, source: Source, value: string, mtype: string): DebugStringEditorInput {
......
...@@ -295,7 +295,7 @@ export class CallStackController extends BaseDebugController { ...@@ -295,7 +295,7 @@ export class CallStackController extends BaseDebugController {
process = element; process = element;
} }
this.debugService.setFocusedStackFrameAndEvaluate(stackFrame, process).done(null, errors.onUnexpectedError); this.debugService.focusStackFrameAndEvaluate(stackFrame, process).done(null, errors.onUnexpectedError);
if (stackFrame) { if (stackFrame) {
const sideBySide = (event && (event.ctrlKey || event.metaKey)); const sideBySide = (event && (event.ctrlKey || event.metaKey));
......
...@@ -25,7 +25,7 @@ export class MockDebugService implements debug.IDebugService { ...@@ -25,7 +25,7 @@ export class MockDebugService implements debug.IDebugService {
return null; return null;
} }
public setFocusedStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame): TPromise<void> { public focusStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame): TPromise<void> {
return TPromise.as(null); return TPromise.as(null);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册