debugger: Do not swallow `port` property when converting launch.json (#32621)

Piotr Osiewicz and Ben Kunkle created

with JavaScript scenarios.

Closes #32187

Release Notes:

- Fixed `port` property not being respected in debug scenarios converted
from VSC's launch.json

Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>

Change summary

crates/task/src/vscode_debug_format.rs | 4 ++++
1 file changed, 4 insertions(+)

Detailed changes

crates/task/src/vscode_debug_format.rs 🔗

@@ -33,6 +33,9 @@ impl VsCodeDebugTaskDefinition {
         if let Some(config) = config.as_object_mut() {
             if adapter == "JavaScript" {
                 config.insert("type".to_owned(), self.r#type.clone().into());
+                if let Some(port) = self.port {
+                    config.insert("port".to_owned(), port.into());
+                }
             }
         }
         let definition = DebugScenario {
@@ -149,6 +152,7 @@ mod tests {
                         "X": "Y",
                     },
                     "type": "node",
+                    "port": 17,
                 }),
                 tcp_connection: Some(TcpArgumentsTemplate {
                     port: Some(17),