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 {
customTool:
args
.
customTool
,
customToolReplacesArgs:
args
.
customToolReplacesArgs
,
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
this
.
customTool
,
this
.
customToolReplacesArgs
,
this
.
vmServiceUri
,
this
.
program
,
super
.
restart
,
super
.
name
,
super
.
cwd
,
...
...
@@ -35,6 +36,7 @@ class FlutterAttachRequestArguments
customTool
=
obj
[
'customTool'
]
as
String
?,
customToolReplacesArgs
=
obj
[
'customToolReplacesArgs'
]
as
int
?,
vmServiceUri
=
obj
[
'vmServiceUri'
]
as
String
?,
program
=
obj
[
'program'
]
as
String
?,
super
.
fromMap
();
static
FlutterAttachRequestArguments
fromJson
(
Map
<
String
,
Object
?>
obj
)
=>
...
...
@@ -64,6 +66,9 @@ class FlutterAttachRequestArguments
/// The VM Service URI of the running Flutter app to connect to.
final
String
?
vmServiceUri
;
/// The program/Flutter app to be run.
final
String
?
program
;
@override
Map
<
String
,
Object
?>
toJson
()
=>
<
String
,
Object
?>{
...
super
.
toJson
(),
...
...
@@ -151,7 +156,8 @@ class FlutterLaunchRequestArguments
if
(
args
!=
null
)
'args'
:
args
,
if
(
toolArgs
!=
null
)
'toolArgs'
:
toolArgs
,
if
(
customTool
!=
null
)
'customTool'
:
customTool
,
if
(
customToolReplacesArgs
!=
null
)
'customToolReplacesArgs'
:
customToolReplacesArgs
,
if
(
customToolReplacesArgs
!=
null
)
'customToolReplacesArgs'
:
customToolReplacesArgs
,
};
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() {
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
{
final
MockFlutterDebugAdapter
adapter
=
MockFlutterDebugAdapter
(
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