Fix `connect.host` setting being ignored by debugpy (#43190)

Andrew Farkas and Cole Miller created

Closes #42727

Unfortunately we can only support IPv4 addresses right now because
`TcpArguments` only supports an IPv4 address. I'm not sure how difficult
it would be to lift this limitation.

Release Notes:

- Fixed `connect.host` setting being ignored by debugpy

Co-authored-by: Cole Miller <cole@zed.dev>

Change summary

crates/dap_adapters/src/python.rs | 3 +++
1 file changed, 3 insertions(+)

Detailed changes

crates/dap_adapters/src/python.rs 🔗

@@ -368,6 +368,9 @@ impl PythonDebugAdapter {
                 bail!("Cannot have two different ports in debug configuration")
             }
 
+            if let Some(hostname) = config_host {
+                tcp_connection.host = Some(hostname.parse().context("hostname must be IPv4")?);
+            }
             tcp_connection.port = config_port;
             DebugpyLaunchMode::AttachWithConnect { host: config_host }
         } else {