|
29 | 29 | (require 'lsp-dart-flutter-daemon) |
30 | 30 | (require 'lsp-dart-devtools) |
31 | 31 |
|
32 | | -(defcustom lsp-dart-dap-extension-version "3.19.2" |
| 32 | +(defcustom lsp-dart-dap-extension-version "3.23.0" |
33 | 33 | "The extension version." |
34 | 34 | :group 'lsp-dart |
35 | 35 | :type 'string) |
36 | 36 |
|
| 37 | +(defcustom lsp-dart-dap-extension-url (format "https://github.com/Dart-Code/Dart-Code/releases/download/v%s/dart-code-%s.vsix" |
| 38 | + lsp-dart-dap-extension-version |
| 39 | + lsp-dart-dap-extension-version) |
| 40 | + "The extension url to download from." |
| 41 | + :group 'lsp-dart |
| 42 | + :type 'string) |
| 43 | + |
37 | 44 | (defcustom lsp-dart-dap-debugger-path |
38 | | - (expand-file-name (concat "vscode/Dart-Code.Dart-Code/" lsp-dart-dap-extension-version) |
39 | | - dap-utils-extension-path) |
| 45 | + (f-join dap-utils-extension-path (concat "github/Dart-Code/Dart-Code/" lsp-dart-dap-extension-version)) |
40 | 46 | "The path to dart vscode extension." |
41 | 47 | :group 'lsp-dart |
42 | 48 | :type 'string) |
@@ -157,14 +163,13 @@ Required to support 'Inspect Widget'." |
157 | 163 | (dap--put-if-absent conf :useFlutterStructuredErrors lsp-dart-dap-flutter-structured-errors) |
158 | 164 | (lsp-dart-dap--capabilities-debugger-args conf))) |
159 | 165 |
|
160 | | -;; Dart |
| 166 | +(lsp-dependency |
| 167 | + 'dart-debugger |
| 168 | + `(:download :url lsp-dart-dap-extension-url |
| 169 | + :decompress :zip |
| 170 | + :store-path ,(f-join lsp-dart-dap-debugger-path "dart-code"))) |
161 | 171 |
|
162 | | -(dap-utils-vscode-setup-function |
163 | | - "dap-dart" |
164 | | - "Dart-Code" |
165 | | - "Dart-Code" |
166 | | - lsp-dart-dap-debugger-path |
167 | | - lsp-dart-dap-extension-version) |
| 172 | +;; Dart |
168 | 173 |
|
169 | 174 | (defun lsp-dart-dap--populate-dart-start-file-args (conf) |
170 | 175 | "Populate CONF with the required arguments for dart debug." |
@@ -389,6 +394,17 @@ Call CALLBACK when the device is chosen and started successfully." |
389 | 394 |
|
390 | 395 | ;; Public Interface |
391 | 396 |
|
| 397 | +(defun lsp-dart-dap-setup () |
| 398 | + "Install the Dart/Flutter debugger extension." |
| 399 | + (interactive) |
| 400 | + (lsp-package-ensure 'dart-debugger |
| 401 | + (lambda (&rest _) (lsp-dart-log "Dart debugger installed successfully!")) |
| 402 | + (lambda (e) |
| 403 | + (lsp-dart-log "Error installing Dart debugger. %s" e)))) |
| 404 | + |
| 405 | +(defalias 'dap-dart-setup 'lsp-dart-dap-setup) |
| 406 | +(make-obsolete 'dap-dart-setup 'lsp-dart-dap-setup "lsp-dart 1.19.0") |
| 407 | + |
392 | 408 | (defun lsp-dart-dap-flutter-hot-restart () |
393 | 409 | "Hot restart current Flutter debug session." |
394 | 410 | (interactive) |
|
0 commit comments