Lsp errors that shows when cursor on line that has the error?

I would like to have a keybind for this

  • donio@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    6 days ago

    edit: I missed that it’s LSP messages. Assuming eglot you can get them in a buffer using M-x flymake-show-buffer-diagnostics

    original:

    I don’t use Doom specifically in general you’d do this by switching to the *Messages* buffer and copy the relevant lines from there as usual.

    If you really wanted a command for it you could do something like this:

    (defun my-copy-last-messages (n)
      (interactive "p")
      (with-current-buffer "*Messages*"
        (copy-region-as-kill
         (line-beginning-position
          (- 1 n))
         (point-max))))
    

    This assumes that the cursors is at the end of the Messages buffer as usual. Not sure if that line positioning is correct, only tested it briefly.