diff --git a/CHANGELOG.md b/CHANGELOG.md index e18dca6..93c88fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Avoid outdated test tree after tests run. * Improve test output to be more precise on output messages. +* Fix `lsp-dart-run` not working for dart ^3.0.0. #197 ## 1.24.1 diff --git a/lsp-dart-dap.el b/lsp-dart-dap.el index 6052724..1b0be4b 100644 --- a/lsp-dart-dap.el +++ b/lsp-dart-dap.el @@ -408,8 +408,8 @@ Run program PATH if not nil passing ARGS if not nil." (-> (list :type "dart" :name "Dart Run" :program path - :args args :noDebug t) + (lsp-dart-plist-put-if args :args args) lsp-dart-dap--populate-dart-start-file-args dap-start-debugging)) @@ -419,8 +419,8 @@ Run program PATH if not nil passing ARGS if not nil." (-> (list :type "flutter" :name "Flutter Run" :program path - :args args :noDebug t) + (lsp-dart-plist-put-if args :args args) lsp-dart-dap--populate-flutter-start-file-args (funcall #'dap-start-debugging))) @@ -445,8 +445,8 @@ Run program PATH if not nil passing ARGS if not nil." lsp-dart-dap-dart-test-debugger-program) :program path :noDebug nil - :shouldConnectDebugger t - :args args) + :shouldConnectDebugger t) + (lsp-dart-plist-put-if args :args args) lsp-dart-dap--base-debugger-args dap-start-debugging)) @@ -460,8 +460,8 @@ Run program PATH if not nil passing ARGS if not nil." :program path :noDebug nil :shouldConnectDebugger t - :flutterMode "debug" - :args args) + :flutterMode "debug") + (lsp-dart-plist-put-if args :args args) lsp-dart-dap--base-debugger-args dap-start-debugging)) diff --git a/lsp-dart-utils.el b/lsp-dart-utils.el index bfc8de0..2039701 100644 --- a/lsp-dart-utils.el +++ b/lsp-dart-utils.el @@ -120,6 +120,12 @@ Order is important." (append list (list value)) list)) +(defun lsp-dart-plist-put-if (plist predicate key value) + "plist-put KEY VALUE to PLIST if PREDICATE is t." + (if predicate + (plist-put plist key value) + plist)) + (defun lsp-dart-flutter-snap-install-p () "Detecting whether this is a Linux system with a Snap style install." (and (string= system-type "gnu/linux")