Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zed_dart"
version = "0.3.6"
version = "0.3.7"
Comment thread
FrantisekGazo marked this conversation as resolved.
Outdated
edition = "2021"
publish = false
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id = "dart"
name = "Dart"
description = "Dart support."
version = "0.3.6"
version = "0.3.7"
Comment thread
FrantisekGazo marked this conversation as resolved.
Outdated
schema_version = 1
authors = [
"Abdullah Alsigar <abdullah.alsigar@gmail.com>",
Expand Down
12 changes: 12 additions & 0 deletions src/dart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ impl zed::Extension for DartExtension {
.and_then(|v| v.as_str())
.unwrap_or("web");

// Flutter's DAP does not read the top-level `deviceId` field, so we
// also forward the device id via `toolArgs` (`flutter run -d <id>`),
// which is the only path the DAP actually honors. Only inject when
// the user set `device_id` explicitly — otherwise leave selection to
// Flutter's auto-pick.
let user_device_id = user_config.get("device_id").and_then(|v| v.as_str());
let tool_args: Vec<String> = match user_device_id {
Some(id) => vec!["-d".to_string(), id.to_string()],
None => vec![],
};

let cwd = user_config
.get("cwd")
.and_then(|v| v.as_str())
Expand All @@ -147,6 +158,7 @@ impl zed::Extension for DartExtension {
"args": args,
"flutterMode": "debug",
"deviceId": device_id,
"toolArgs": tool_args,
"platform": platform,
"stopOnEntry": false
})
Expand Down