Skip to content

Commit 6062697

Browse files
committed
Fix unused session variable
1 parent 72b6327 commit 6062697

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lsp-dart-dap.el

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ Required to support 'Inspect Widget'."
163163
(dap--put-if-absent conf :useFlutterStructuredErrors lsp-dart-dap-flutter-structured-errors)
164164
(lsp-dart-dap--capabilities-debugger-args conf)))
165165

166+
(defun lsp-dart-dap--enable-mode ()
167+
"Enable `lsp-dart-dap-mode'."
168+
(lsp-dart-dap-mode 1))
169+
170+
(defun lsp-dart-dap--disable-mode ()
171+
"Enable `lsp-dart-dap-mode'."
172+
(lsp-dart-dap-mode -1))
173+
166174
(lsp-dependency
167175
'dart-debugger
168176
`(:download :url lsp-dart-dap-extension-url
@@ -301,7 +309,7 @@ Call CALLBACK when the device is chosen and started successfully."
301309
:originalUrl url
302310
:exposedUrl url)))
303311

304-
(cl-defmethod dap-handle-event ((_event (eql dart.webLaunchUrl)) session params)
312+
(cl-defmethod dap-handle-event ((_event (eql dart.webLaunchUrl)) _session params)
305313
"Open url in browser from SESSION and PARAMS."
306314
(-let (((&hash "launched" "url") params))
307315
(unless launched
@@ -436,7 +444,8 @@ Call CALLBACK when the device is chosen and started successfully."
436444
(t
437445
(remove-hook 'after-save-hook #'lsp-dart-dap--on-save))))
438446

439-
(add-hook 'dap-session-created-hook #'lsp-dart-dap-mode)
447+
(add-hook 'dap-session-created-hook #'lsp-dart-dap--enable-mode)
448+
(add-hook 'dap-terminated-hook #'lsp-dart-dap--disable-mode)
440449

441450
(provide 'lsp-dart-dap)
442451
;;; lsp-dart-dap.el ends here

0 commit comments

Comments
 (0)