@@ -26,12 +26,14 @@ local devtools_profiler_url = nil
26
26
27
27
local activate_cmd = { " pub" , " global" , " activate" , " devtools" }
28
28
29
- -- Android when flutter run starts a new devtools process
30
- -- OLD: Flutter DevTools, a Flutter debugger and profiler,
31
- -- on sdk gphone x86 arm is available at:
32
- -- http://127.0.0.1:9102?uri=http%3A%2F%2F127.0.0.1%3A46051%2FNvCev-HjyX4%3D%2F
33
- -- NEW: The Flutter DevTools debugger and profiler on sdk gphone x86 arm is available at:
34
- -- http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A35479%2FgQ0BNyM2xB8%3D%2F
29
+ --- Android when flutter run starts a new devtools process
30
+ --- OLD: Flutter DevTools, a Flutter debugger and profiler,
31
+ --- on sdk gphone x86 arm is available at:
32
+ --- http://127.0.0.1:9102?uri=http%3A%2F%2F127.0.0.1%3A46051%2FNvCev-HjyX4%3D%2F
33
+ --- NEW: The Flutter DevTools debugger and profiler on sdk gphone x86 arm is available at:
34
+ --- http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A35479%2FgQ0BNyM2xB8%3D%2F
35
+ --- @param data string
36
+ --- @return unknown
35
37
local function try_get_tools_flutter (data ) return data :match (" (https?://127%.0%.0%.1:%d+%?uri=.+)$" ) end
36
38
37
39
--- Debug service listening on ws://127.0.0.1:44293/heXbxLM_lhM=/ws
@@ -75,7 +77,10 @@ function M.open_dev_tools()
75
77
end
76
78
end
77
79
80
+ --- @param data string ?
78
81
function M .handle_log (data )
82
+ if not data then return end
83
+
79
84
if devtools_profiler_url or (profiler_url and devtools_url ) then return end
80
85
81
86
devtools_profiler_url = try_get_tools_flutter (data )
@@ -233,6 +238,7 @@ function M.on_flutter_shutdown()
233
238
end
234
239
235
240
function M .set_devtools_url (url ) devtools_url = url end
241
+
236
242
function M .set_profiler_url (url ) profiler_url = url end
237
243
238
244
return M
0 commit comments