Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions lsp-dart-dap.el
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,22 @@ Call CALLBACK when the device is chosen and started successfully."
(buffer-file-name))))))
(lambda (start-debugging-callback)
(lsp-dart-dap--flutter-get-or-start-device
(-lambda ((&hash "id" device-id "name" device-name))
(funcall start-debugging-callback
(-> pre-conf
(dap--put-if-absent :deviceId device-id)
(dap--put-if-absent :deviceName device-name)
(dap--put-if-absent :dap-server-path (if (lsp-dart-dap-use-sdk-debugger-p)
(append (lsp-dart-flutter-command) (list "debug_adapter" "-d" device-id))
lsp-dart-dap-flutter-debugger-program))
(dap--put-if-absent :flutterPlatform "default")
(dap--put-if-absent :toolArgs `("-d" ,device-id))
(dap--put-if-absent :name (concat "Flutter (" device-name ")")))))))))

(lambda (device-params)
(let ((device-id (lsp-get device-params :id))
(device-name (lsp-get device-params :name)))

(funcall start-debugging-callback
(-> pre-conf
(dap--put-if-absent :deviceId device-id)
(dap--put-if-absent :deviceName device-name)
(dap--put-if-absent :dap-server-path (if (lsp-dart-dap-use-sdk-debugger-p)
(append (lsp-dart-flutter-command) (list "debug_adapter" "-d" device-id))
lsp-dart-dap-flutter-debugger-program))
(dap--put-if-absent :flutterPlatform "default")
(dap--put-if-absent :toolArgs `("-d" ,device-id))
(dap--put-if-absent :name (concat "Flutter (" device-name ")"))))
))))))

(dap-register-debug-provider "flutter" 'lsp-dart-dap--populate-flutter-start-file-args)
(dap-register-debug-template "Flutter :: Debug"
(list :type "flutter"))
Expand Down
Loading