Skip to content

Commit

Permalink
Merge pull request #225 from jheld/bugfix-flutter-run
Browse files Browse the repository at this point in the history
Bugfix flutter run
  • Loading branch information
ericdallo authored Nov 14, 2024
2 parents 9ffbafb + 7b88321 commit 54c6dce
Showing 1 changed file with 16 additions and 12 deletions.
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

0 comments on commit 54c6dce

Please sign in to comment.