@@ -26,12 +26,14 @@ local devtools_profiler_url = nil
2626
2727local activate_cmd = { " pub" , " global" , " activate" , " devtools" }
2828
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
3537local function try_get_tools_flutter (data ) return data :match (" (https?://127%.0%.0%.1:%d+%?uri=.+)$" ) end
3638
3739--- Debug service listening on ws://127.0.0.1:44293/heXbxLM_lhM=/ws
@@ -75,7 +77,10 @@ function M.open_dev_tools()
7577 end
7678end
7779
80+ --- @param data string ?
7881function M .handle_log (data )
82+ if not data then return end
83+
7984 if devtools_profiler_url or (profiler_url and devtools_url ) then return end
8085
8186 devtools_profiler_url = try_get_tools_flutter (data )
@@ -233,6 +238,7 @@ function M.on_flutter_shutdown()
233238end
234239
235240function M .set_devtools_url (url ) devtools_url = url end
241+
236242function M .set_profiler_url (url ) profiler_url = url end
237243
238244return M
0 commit comments