Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "additional options" to launch debugger with #363

Merged
merged 3 commits into from
Aug 17, 2022
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
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@
"type": "string",
"description": "Relative path from the godot.project file to a TSCN file. If launch_scene and launch_game_instance are true, and this file is defined, will launch the specified file instead of looking for an active TSCN file.",
"default": ""
},
"additional_options":{
"type":"string",
"description": "Additional command line arguments.",
"default":""
}
}
}
Expand All @@ -286,7 +291,8 @@
"port": 6007,
"address": "127.0.0.1",
"launch_game_instance": true,
"launch_scene": false
"launch_scene": false,
"additional_options":""
}
],
"configurationSnippets": [
Expand All @@ -300,7 +306,8 @@
"port": 6007,
"address": "127.0.0.1",
"launch_game_instance": true,
"launch_scene": false
"launch_scene": false,
"additional_options":""
}
}
]
Expand Down
3 changes: 3 additions & 0 deletions src/debugger/debug_session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArguments {
port: number;
project: string;
scene_file: string;
additional_options: string;
}

export class GodotDebugSession extends LoggingDebugSession {
Expand Down Expand Up @@ -235,6 +236,8 @@ export class GodotDebugSession extends LoggingDebugSession {
args.port,
args.launch_game_instance,
args.launch_scene,
args.scene_file,
args.additional_options,
get_configuration("scene_file_config", "") || args.scene_file,
]);

Expand Down
1 change: 1 addition & 0 deletions src/debugger/debugger_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class GodotConfigurationProvider implements DebugConfigurationProvider {
config.address = "127.0.0.1";
config.launch_game_instance = true;
config.launch_scene = false;
config.additional_options = "";
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/debugger/mediator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Mediator {
let message_content: string = line[0];
//let message_kind: number = line[1];

// OutputChannel doesn't give a way to distinguish between a
// OutputChannel doesn't give a way to distinguish between a
// regular string (message_kind == 0) and an error string (message_kind == 1).

this.output.appendLine(message_content);
Expand Down Expand Up @@ -149,6 +149,7 @@ export class Mediator {
parameters[3],
parameters[4],
parameters[5],
parameters[6],
this.debug_data
);
break;
Expand Down
4 changes: 4 additions & 0 deletions src/debugger/server_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class ServerController {
launch_instance: boolean,
launch_scene: boolean,
scene_file: string | undefined,
additional_options: string | undefined,
debug_data: GodotDebugData
) {
this.debug_data = debug_data;
Expand All @@ -118,6 +119,9 @@ export class ServerController {
}
executable_line += ` "${filename}"`;
}
if(additional_options){
executable_line += " " + additional_options;
}
executable_line += this.breakpoint_string(
debug_data.get_all_breakpoints(),
project_path
Expand Down