Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot see the breakpoint in the fringe when the debugger is started #174

Open
chmouel opened this issue Nov 29, 2024 · 2 comments
Open

Comments

@chmouel
Copy link

chmouel commented Nov 29, 2024

perhaps it's due of my configuration but I can't seem to see the breakpoint when dap started,

while the debugger stopped it shows as expected on the fringe:

image

but when dape is started the fringe gets hidden, so it makes it hard to know where is the breakpoint

image

i did quick hack to highlight the current line instead when toggling the breakpoint

image

It would be nice if you can consider adding that option to highlight the current line instead of just adding it to the fringer

here is my code that does it btw if someone else is looking for it

  (defun highlight-current-line ()
    "Highlight the current line using a custom face."
    (interactive)
    (let ((overlay (make-overlay (line-beginning-position) (line-end-position))))
      (overlay-put overlay 'face 'highlight-current-line-face)
      (overlay-put overlay 'evaporate t)))

  (defface highlight-current-line-face
    '((t (:background "grey80" :foreground "yellow")))
    "Face for highlighting the current line.")

  (defun clear-current-line-highlights ()
    "Clear all current line highlights."
    (interactive)
    (remove-overlays nil nil 'face 'highlight-current-line-face))

  (defun my-dape-breakpoint-toggle-and-hl ()
    "Add or remove breakpoint at current line."
    (interactive)
    (if (cl-member nil (dape--breakpoints-at-point)
                   :key #'dape--breakpoint-type)
        (progn
          (clear-current-line-highlights)
          (dape-breakpoint-remove-at-point))
      (progn
        (dape--breakpoint-place)
        (highlight-current-line))))
@svaante
Copy link
Owner

svaante commented Nov 30, 2024

Hey and thank you for your bug report!

Could you share the logs that dape generate and the other packages that use the fringe and/or margin. I suspect that its related to the other packages that's used.
Are you able to reproduce this independent of the number of breakpoints and where they are placed?
To generate the logs turn on logging with (setq dape-debug t) then share the contents of *dape-connection events* buffer.

Also dape already puts an overlay covering the whole line which can be reused for this purpose. The overlay category was mistakenly removed and is not present in the current elpa version but the latest commit 3a9d35e on master has it.

(put 'dape-breakpoint 'face 'highlight)

@chmouel
Copy link
Author

chmouel commented Dec 9, 2024

Sorry, I wanted to take some time to properly figure this out, but it seems to be an issue with my configuration. Nothing in fringe mode is showing when splitting windows, regardless of the fringe-mode setting I use (unless I disable it, but then it uses the margin instead).

The dape-debug variable unfortunately didn’t help and not showing any issue.

I’ll try to bisect further within my configuration to pinpoint the issue.

Feel free to close this issue or keep it open—I’ll update it here if I manage to figure it out for the benefit of other users.

@chmouel chmouel changed the title Cannot see the breakpoint in the fringer when the debugger is started Cannot see the breakpoint in the fringe when the debugger is started Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants