Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
46e48ba3
Unverified
Commit
46e48ba3
authored
Jan 09, 2023
by
Helin Shiah
Committed by
GitHub
Jan 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use program during attach if provided (#118130)
parent
5bf6357d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
flutter_adapter.dart
...flutter_tools/lib/src/debug_adapters/flutter_adapter.dart
+1
-0
flutter_adapter_args.dart
...er_tools/lib/src/debug_adapters/flutter_adapter_args.dart
+7
-1
flutter_adapter_test.dart
...er_tools/test/general.shard/dap/flutter_adapter_test.dart
+28
-0
No files found.
packages/flutter_tools/lib/src/debug_adapters/flutter_adapter.dart
View file @
46e48ba3
...
@@ -148,6 +148,7 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter {
...
@@ -148,6 +148,7 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter {
customTool:
args
.
customTool
,
customTool:
args
.
customTool
,
customToolReplacesArgs:
args
.
customToolReplacesArgs
,
customToolReplacesArgs:
args
.
customToolReplacesArgs
,
userToolArgs:
args
.
toolArgs
,
userToolArgs:
args
.
toolArgs
,
targetProgram:
args
.
program
,
);
);
}
}
...
...
packages/flutter_tools/lib/src/debug_adapters/flutter_adapter_args.dart
View file @
46e48ba3
...
@@ -17,6 +17,7 @@ class FlutterAttachRequestArguments
...
@@ -17,6 +17,7 @@ class FlutterAttachRequestArguments
this
.
customTool
,
this
.
customTool
,
this
.
customToolReplacesArgs
,
this
.
customToolReplacesArgs
,
this
.
vmServiceUri
,
this
.
vmServiceUri
,
this
.
program
,
super
.
restart
,
super
.
restart
,
super
.
name
,
super
.
name
,
super
.
cwd
,
super
.
cwd
,
...
@@ -35,6 +36,7 @@ class FlutterAttachRequestArguments
...
@@ -35,6 +36,7 @@ class FlutterAttachRequestArguments
customTool
=
obj
[
'customTool'
]
as
String
?,
customTool
=
obj
[
'customTool'
]
as
String
?,
customToolReplacesArgs
=
obj
[
'customToolReplacesArgs'
]
as
int
?,
customToolReplacesArgs
=
obj
[
'customToolReplacesArgs'
]
as
int
?,
vmServiceUri
=
obj
[
'vmServiceUri'
]
as
String
?,
vmServiceUri
=
obj
[
'vmServiceUri'
]
as
String
?,
program
=
obj
[
'program'
]
as
String
?,
super
.
fromMap
();
super
.
fromMap
();
static
FlutterAttachRequestArguments
fromJson
(
Map
<
String
,
Object
?>
obj
)
=>
static
FlutterAttachRequestArguments
fromJson
(
Map
<
String
,
Object
?>
obj
)
=>
...
@@ -64,6 +66,9 @@ class FlutterAttachRequestArguments
...
@@ -64,6 +66,9 @@ class FlutterAttachRequestArguments
/// The VM Service URI of the running Flutter app to connect to.
/// The VM Service URI of the running Flutter app to connect to.
final
String
?
vmServiceUri
;
final
String
?
vmServiceUri
;
/// The program/Flutter app to be run.
final
String
?
program
;
@override
@override
Map
<
String
,
Object
?>
toJson
()
=>
<
String
,
Object
?>{
Map
<
String
,
Object
?>
toJson
()
=>
<
String
,
Object
?>{
...
super
.
toJson
(),
...
super
.
toJson
(),
...
@@ -151,7 +156,8 @@ class FlutterLaunchRequestArguments
...
@@ -151,7 +156,8 @@ class FlutterLaunchRequestArguments
if
(
args
!=
null
)
'args'
:
args
,
if
(
args
!=
null
)
'args'
:
args
,
if
(
toolArgs
!=
null
)
'toolArgs'
:
toolArgs
,
if
(
toolArgs
!=
null
)
'toolArgs'
:
toolArgs
,
if
(
customTool
!=
null
)
'customTool'
:
customTool
,
if
(
customTool
!=
null
)
'customTool'
:
customTool
,
if
(
customToolReplacesArgs
!=
null
)
'customToolReplacesArgs'
:
customToolReplacesArgs
,
if
(
customToolReplacesArgs
!=
null
)
'customToolReplacesArgs'
:
customToolReplacesArgs
,
};
};
static
FlutterLaunchRequestArguments
fromJson
(
Map
<
String
,
Object
?>
obj
)
=>
static
FlutterLaunchRequestArguments
fromJson
(
Map
<
String
,
Object
?>
obj
)
=>
...
...
packages/flutter_tools/test/general.shard/dap/flutter_adapter_test.dart
View file @
46e48ba3
...
@@ -209,6 +209,34 @@ void main() {
...
@@ -209,6 +209,34 @@ void main() {
expect
(
adapter
.
processArgs
,
containsAllInOrder
(<
String
>[
'attach'
,
'--machine'
]));
expect
(
adapter
.
processArgs
,
containsAllInOrder
(<
String
>[
'attach'
,
'--machine'
]));
});
});
test
(
'runs "flutter attach" with program if passed in'
,
()
async
{
final
MockFlutterDebugAdapter
adapter
=
MockFlutterDebugAdapter
(
fileSystem:
MemoryFileSystem
.
test
(
style:
fsStyle
),
platform:
platform
,
);
final
Completer
<
void
>
responseCompleter
=
Completer
<
void
>();
final
FlutterAttachRequestArguments
args
=
FlutterAttachRequestArguments
(
cwd:
'/project'
,
program:
'program/main.dart'
,
);
await
adapter
.
configurationDoneRequest
(
MockRequest
(),
null
,
()
{});
await
adapter
.
attachRequest
(
MockRequest
(),
args
,
responseCompleter
.
complete
);
await
responseCompleter
.
future
;
expect
(
adapter
.
processArgs
,
containsAllInOrder
(<
String
>[
'attach'
,
'--machine'
,
'--target'
,
'program/main.dart'
]));
});
test
(
'does not record the VMs PID for terminating'
,
()
async
{
test
(
'does not record the VMs PID for terminating'
,
()
async
{
final
MockFlutterDebugAdapter
adapter
=
MockFlutterDebugAdapter
(
final
MockFlutterDebugAdapter
adapter
=
MockFlutterDebugAdapter
(
fileSystem:
MemoryFileSystem
.
test
(
style:
fsStyle
),
fileSystem:
MemoryFileSystem
.
test
(
style:
fsStyle
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment