Skip to content

Commit

Permalink
Fix lsp-dart-run not working for dart ^3.0.0.
Browse files Browse the repository at this point in the history
Fixes #197
  • Loading branch information
ericdallo committed May 16, 2023
1 parent 3db9f93 commit a25d24f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions lsp-dart-dap.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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)))

Expand All @@ -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))

Expand All @@ -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))

Expand Down
6 changes: 6 additions & 0 deletions lsp-dart-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a25d24f

Please sign in to comment.