branch: elpa/dart-mode
commit 9ad52e862d6e795ffe1b63eae587fae04ab25b88
Author: Brady Trainor <[email protected]>
Commit: Brady Trainor <[email protected]>

    Search for sdk from flutter if no dart on path
---
 dart-mode.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dart-mode.el b/dart-mode.el
index 1bbdb61..79eea39 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -265,7 +265,11 @@ Only set in `dart-popup-mode'.")
 (defcustom dart-sdk-path
   ;; Use Platform.resolvedExecutable so that this logic works through symlinks
   ;; and wrapper scripts.
-  (-when-let (dart (executable-find "dart"))
+  (-when-let (dart (or (executable-find "dart")
+                       (let ((flutter (executable-find "flutter")))
+                         (when flutter
+                           (expand-file-name "cache/dart-sdk/bin/dart"
+                                             (file-name-directory flutter))))))
     (dart--with-temp-file input
       (with-temp-file input (insert "
         import 'dart:io';

Reply via email to