Skip to content

Commit e1ac87a

Browse files
Pi Songkunthamgrouma
authored andcommitted
Added a flag for enabling Dart Debug Extension backend. (#487)
* Added a flag for enabling Dart Debug Extension backend.
1 parent 9682c00 commit e1ac87a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

webdev/lib/src/command/configuration.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import '../logging.dart';
1010

1111
const autoOption = 'auto';
1212
const chromeDebugPortFlag = 'chrome-debug-port';
13+
const debugExtensionFlag = 'debug-extension';
1314
const debugFlag = 'debug';
1415
const hostnameFlag = 'hostname';
1516
const hotReloadFlag = 'hot-reload';
@@ -70,6 +71,7 @@ ReloadConfiguration _parseReloadConfiguration(ArgResults argResults) {
7071
class Configuration {
7172
final bool _autoRun;
7273
final int _chromeDebugPort;
74+
final bool _debugExtension;
7375
final bool _debug;
7476
final String _hostname;
7577
final bool _launchInChrome;
@@ -85,6 +87,7 @@ class Configuration {
8587
Configuration({
8688
bool autoRun,
8789
int chromeDebugPort,
90+
bool debugExtension,
8891
bool debug,
8992
String hostname,
9093
bool launchInChrome,
@@ -98,6 +101,7 @@ class Configuration {
98101
bool verbose,
99102
}) : _autoRun = autoRun,
100103
_chromeDebugPort = chromeDebugPort,
104+
_debugExtension = debugExtension,
101105
_debug = debug,
102106
_hostname = hostname,
103107
_launchInChrome = launchInChrome,
@@ -113,6 +117,8 @@ class Configuration {
113117

114118
int get chromeDebugPort => _chromeDebugPort ?? 0;
115119

120+
bool get debugExtension => _debugExtension ?? false;
121+
116122
bool get debug => _debug ?? false;
117123

118124
String get hostname => _hostname ?? 'localhost';
@@ -140,6 +146,10 @@ class Configuration {
140146
? int.parse(argResults[chromeDebugPortFlag] as String)
141147
: defaultConfiguration.chromeDebugPort;
142148

149+
var debugExtension = argResults.options.contains(debugExtensionFlag)
150+
? argResults[debugExtensionFlag] as bool
151+
: defaultConfiguration.debugExtension;
152+
143153
var debug = argResults.options.contains(debugFlag)
144154
? argResults[debugFlag] as bool
145155
: defaultConfiguration.debug;
@@ -199,6 +209,7 @@ class Configuration {
199209

200210
return Configuration(
201211
chromeDebugPort: chromeDebugPort,
212+
debugExtension: debugExtension,
202213
debug: debug,
203214
hostname: hostname,
204215
launchInChrome: launchInChrome,

webdev/lib/src/command/serve_command.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ refresh: Performs a full page refresh.
5858
..addFlag(debugFlag,
5959
help: 'Enable the launching of DevTools (Alt + D / Option + D). '
6060
'This also enables --$launchInChromeFlag.')
61+
..addFlag(debugExtensionFlag,
62+
help: 'Enable the backend for the Dart Debug Extension.', hide: true)
6163
..addSeparator('Advanced:')
6264
..addOption(chromeDebugPortFlag,
6365
help: 'Specify which port the Chrome debugger is listening on. '

0 commit comments

Comments
 (0)