Skip to content

Commit 671fa02

Browse files
authored
dap-feature->modes: remove buffer local mode (emacs-lsp#282)
1 parent 0833f3b commit 671fa02

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

dap-java.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ initiate `compile' and attach to the process."
226226
(interactive (list (dap-java--populate-default-args nil)))
227227
(dap-start-debugging debug-args))
228228

229+
(defvar testng-report-directory)
230+
229231
(defun dap-java--run-unit-test-command (runner run-method?)
230232
"Run debug test with the following arguments.
231233
RUNNER is the test executor. RUN-METHOD? when t it will try to
@@ -309,7 +311,7 @@ attaching to the test."
309311
port)
310312
nil))))
311313

312-
(cl-defmethod dap-handle-event ((event (eql hotcodereplace)) session _params)
314+
(cl-defmethod dap-handle-event ((_event (eql hotcodereplace)) session _params)
313315
(when (eq dap-java-hot-reload 'always)
314316
(-let [(&hash "changedClasses" classes) (dap-request session "redefineClasses")]
315317
(if classes

dap-mode.el

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ The hook will be called with the session file and the new set of breakpoint loca
157157
(expressions . (dap-ui-expressions . dap-ui--expressions-buffer))))
158158

159159
(defconst dap-features->modes
160-
'((sessions . dap-ui-sessions-mode)
161-
(breakpoints . dap-ui-breakpoints-mode)
162-
(controls . (dap-ui-controls-mode . posframe))
160+
'((controls . (dap-ui-controls-mode . posframe))
163161
(tooltip . dap-tooltip-mode)))
164162

165163
(defvar dap--debug-configuration nil
@@ -1154,8 +1152,9 @@ RESULT to use for the callback."
11541152
stack-frames
11551153
(-lambda ((frame &as &hash "name"))
11561154
(if-let (frame-path (dap--get-path-for-frame frame))
1157-
(format "%s: %s (in %s)" (incf index) name frame-path)
1158-
(format "%s: %s" (incf index) name)))
1155+
(format "%s: %s (in %s)"
1156+
(cl-incf index) name frame-path)
1157+
(format "%s: %s" (cl-incf index) name)))
11591158
nil
11601159
t)))
11611160
(dap--go-to-stack-frame (dap--cur-session) new-stack-frame))

dap-ui.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ DEBUG-SESSION is the debug session triggering the event."
476476

477477
(declare-function posframe-show "ext:posframe")
478478
(declare-function posframe-hide "ext:posframe")
479+
(declare-function posframe-poshandler-frame-top-center "ext:posframe")
480+
(defvar posframe-mouse-banish)
479481

480482
(defun dap-ui--update-controls (&rest _)
481483
(let* ((session (dap--cur-session))
@@ -507,13 +509,14 @@ DEBUG-SESSION is the debug session triggering the event."
507509
(dap-ui--create-command "disconnect.png" #'dap-disconnect "Disconnect")
508510
" "
509511
(dap-ui--create-command "restart.png" #'dap-debug-restart "Restart")))
510-
(posframe-mouse-banish nil)
512+
posframe-mouse-banish
511513
(pos-frame (-first
512514
(lambda (frame)
513515
(let ((buffer-info (frame-parameter frame 'posframe-buffer)))
514516
(or (equal dap-ui--control-buffer (car buffer-info))
515517
(equal dap-ui--control-buffer (cdr buffer-info)))))
516518
(frame-list))))
519+
(ignore posframe-mouse-banish)
517520
(when (eq (selected-frame) pos-frame)
518521
(select-frame (frame-parent pos-frame)))
519522
(posframe-show dap-ui--control-buffer

0 commit comments

Comments
 (0)