Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Debugger accept array of sourcefiles (rather than string) #2236

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 1 addition & 2 deletions src/debugger/adapter/DebugAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ class PrepackDebugSession extends DebugSession {
let adapterChannel = new AdapterChannel(inFilePath, outFilePath);
this._adapterChannel = adapterChannel;
this._registerMessageCallbacks();
let separatedSourceFiles = args.sourceFile.trim().split(/\s+/g); // Split on all whitespace
let launchArgs: PrepackLaunchArguments = {
kind: "launch",
sourceFiles: separatedSourceFiles,
sourceFiles: args.sourceFiles,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to inline all fields of args into launchArgs? If so, these three lines can be simplified using spread operation: ...args

prepackRuntime: args.prepackRuntime,
prepackArguments: args.prepackArguments,
debugInFilePath: inFilePath,
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/common/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export type EvaluateResult = {
export type LaunchRequestArguments = {
...DebugProtocol.LaunchRequestArguments,
noDebug?: boolean,
sourceFile: string,
sourceFiles: Array<string>,
prepackRuntime: string,
prepackArguments: Array<string>,
};
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/mock-ui/UISession.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class UISession {
_processInitializeResponse(response: DebugProtocol.InitializeResponse) {
let launchArgs: LaunchRequestArguments = {
prepackRuntime: this._prepackRuntime,
sourceFile: this._sourceFiles.join(" "),
sourceFiles: this._sourceFiles,
prepackArguments: this._prepackArguments,
};
this._sendLaunchRequest(launchArgs);
Expand Down