Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export class MoveDebugSession extends LoggingDebugSession {
this.sendEvent(new InitializedEvent());
}

protected async launchRequest(response: DebugProtocol.LaunchResponse, args: ILaunchRequestArguments): Promise<void> {
protected async launchRequest(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and the following) formatting changes were not necessary to achieve the stated goal of this PR but will make the code look better (as a side-note, I don't like TS auto-formatter not formatting these automatically)

response: DebugProtocol.LaunchResponse,
args: ILaunchRequestArguments
): Promise<void> {
logger.setup(convertLoggerLogLevel(args.logLevel ?? LogLevel.None), false);
logger.log("Launching trace viewer for file: " + args.source + " and trace: " + args.traceInfo);
try {
Expand All @@ -161,7 +164,10 @@ export class MoveDebugSession extends LoggingDebugSession {
this.sendEvent(new StoppedEvent("entry", MoveDebugSession.THREAD_ID));
}

protected configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): void {
protected configurationDoneRequest(
response: DebugProtocol.ConfigurationDoneResponse,
_args: DebugProtocol.ConfigurationDoneArguments
): void {
this.sendResponse(response);
}

Expand All @@ -174,7 +180,10 @@ export class MoveDebugSession extends LoggingDebugSession {
this.sendResponse(response);
}

protected stackTraceRequest(response: CustomizedStackTraceResponse, args: DebugProtocol.StackTraceArguments): void {
protected stackTraceRequest(
response: CustomizedStackTraceResponse,
args: DebugProtocol.StackTraceArguments
): void {
try {
const runtimeStack = this.runtime.stack();
const stack_height = runtimeStack.frames.length;
Expand All @@ -195,20 +204,34 @@ export class MoveDebugSession extends LoggingDebugSession {
this.sendResponse(response);
}

protected nextRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {
protected nextRequest(
response: DebugProtocol.NextResponse,
args: DebugProtocol.NextArguments
): void {
try {
this.runtime.step(true);
this.runtime.step(
/* next */ true,
/* stopAtCloseFrame */ false,
/* nextLineSkip */ true
);
} catch (err) {
response.success = false;
response.message = err instanceof Error ? err.message : String(err);
}
this.sendResponse(response);
}

protected stepInRequest(response: DebugProtocol.StepInResponse, args: DebugProtocol.StepInArguments): void {
protected stepInRequest(
response: DebugProtocol.StepInResponse,
args: DebugProtocol.StepInArguments
): void {
let terminate = false;
try {
terminate = this.runtime.step(false);
terminate = this.runtime.step(
/* next */ false,
/* stopAtCloseFrame */ false,
/* nextLineSkip */ true
);
} catch (err) {
response.success = false;
response.message = err instanceof Error ? err.message : String(err);
Expand All @@ -219,17 +242,27 @@ export class MoveDebugSession extends LoggingDebugSession {
this.sendResponse(response);
}

protected stepOutRequest(response: DebugProtocol.StepOutResponse, args: DebugProtocol.StepOutArguments): void {
protected stepOutRequest(
response: DebugProtocol.StepOutResponse,
args: DebugProtocol.StepOutArguments
): void {
let terminate = false;
try {
this.runtime.stepOut();
terminate = this.runtime.stepOut();
} catch (err) {
response.success = false;
response.message = err instanceof Error ? err.message : String(err);
}
if (terminate) {
this.sendEvent(new TerminatedEvent());
}
this.sendResponse(response);
}

protected stepBackRequest(response: DebugProtocol.StepBackResponse, args: DebugProtocol.StepBackArguments): void {
protected stepBackRequest(
response: DebugProtocol.StepBackResponse,
args: DebugProtocol.StepBackArguments
): void {
try {
this.runtime.stepBack();
} catch (err) {
Expand All @@ -239,8 +272,44 @@ export class MoveDebugSession extends LoggingDebugSession {
this.sendResponse(response);
}

protected continueRequest(
response: DebugProtocol.ContinueResponse,
args: DebugProtocol.ContinueArguments
): void {
let terminate = false;
try {
terminate = this.runtime.continue(/* reverse */ false);
} catch (err) {
response.success = false;
response.message = err instanceof Error ? err.message : String(err);
}
if (terminate) {
this.sendEvent(new TerminatedEvent());
}
this.sendResponse(response);
}

protected reverseContinueRequest(
response: DebugProtocol.ReverseContinueResponse,
args: DebugProtocol.ReverseContinueArguments
): void {
let terminate = false;
try {
terminate = this.runtime.continue(/* reverse */ true);
} catch (err) {
response.success = false;
response.message = err instanceof Error ? err.message : String(err);
}
if (terminate) {
this.sendEvent(new TerminatedEvent());
}
this.sendResponse(response);
}

protected disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments): void {
protected disconnectRequest(
response: DebugProtocol.DisconnectResponse,
args: DebugProtocol.DisconnectArguments
): void {
// Cleanup and terminate the debug session
this.sendEvent(new TerminatedEvent());
this.sendResponse(response);
Expand Down
Loading
Loading