lsp-ui icon indicating copy to clipboard operation
lsp-ui copied to clipboard

flymake-diagnostic-at-point

Open arkhan opened this issue 5 years ago • 5 comments

Regards, I have a question, since lsp-mode is going to give preference to flymake it could be considered: https://github.com/meqif/flymake-diagnostic-at-point thanks

arkhan avatar Dec 15 '18 16:12 arkhan

I'm currently using this configuration:

(after! flymake-proc
  ;; disable flymake-proc
  (setq-default flymake-diagnostic-functions nil)
  )
(defvar flymake-posframe-delay 0.5)
(defvar flymake-posframe-buffer "*flymake-posframe*")
(defvar-local flymake-posframe--timer nil)
(defvar-local flymake-posframe--last-diag nil)

(defun flymake-posframe-hide ()
  (posframe-hide flymake-posframe-buffer))

(defun flymake-posframe-display ()
  (when flymake-mode
    (if-let (diag (and flymake-mode
                       (get-char-property (point) 'flymake-diagnostic)))
        (unless (and (eq diag flymake-posframe--last-diag)
                     (frame-visible-p (buffer-local-value 'posframe--frame (get-buffer flymake-posframe-buffer))))
          (setq flymake-posframe--last-diag diag)
          (posframe-show
           flymake-posframe-buffer
           :string (propertize (concat "➤ " (flymake--diag-text diag))
                               'face
                               (case (flymake--diag-type diag)
                                 (:error 'error)
                                 (:warning 'warning)
                                 (:note 'info)))))
      (flymake-posframe-hide))))

(add-hook 'post-command-hook #'flymake-posframe-set-timer)
(add-hook! (doom-exit-buffer doom-exit-window) #'flymake-posframe-hide)

MaskRay avatar Dec 26 '18 01:12 MaskRay

my question is if you can integrate something similar to the sideline

arkhan avatar Dec 26 '18 13:12 arkhan

As a side note, we will make sideline errors work for flymake as well.

yyoncho avatar Dec 26 '18 14:12 yyoncho

Very interested in that feature. I just switched to flymake and... no error messages, just markers. Would like to see the explanation - even if only when I hover on the line.

jefftrull avatar May 24 '19 00:05 jefftrull

@jefftrull

You can get the error by using flymake-goto-next/prev-error. It echoes in the mini-buffer at the bottom. Not as nice as a hover, but it works OK.

yilinwei avatar Feb 14 '21 22:02 yilinwei