Giter VIP home page Giter VIP logo

sideline-flycheck's Issues

How to start automatically?

Hi there. I'm loving sideline-flycheck :)

This is more of a question than an issue. How can I start it automatically? I can start it manually by typing M-x sideline-flycheck-mode per buffer, but can I have it running by default for every buffer?

Relevant part of my .emacs:

;; Use sideline and sideline-flycheck to display messages from flycheck.
(use-package sideline
  :init
  (global-sideline-mode)
  (setq
   sideline-backends-right '(sideline-flycheck)
   ;; sideline-backends-skip-current-line t  ; don't display on current line
   sideline-order-right 'down                ; or 'up
   sideline-format-left "%s   "              ; format for left aligment
   sideline-format-right "   %s"             ; format for right aligment
   sideline-priority 100                     ; overlays' priority
   sideline-display-backend-name t           ; display the backend name
   )
  )
(use-package sideline-flycheck
  :init (sideline-flycheck-mode)
  :hook
  (flycheck-mode-hook . sideline-mode)
  (flycheck-mode-hook . sideline-flycheck-setup)
  )

`flycheck-display-errors-delay` must be larger than `sideline-delay` for this to work

Apparently it currently works like this:

  1. sideline-render is called after an idle timer of sideline-delay (default 0.2s)
  2. Inside sideline-render, it calls sideline-flycheck backend which is async. sideline-flycheck only keeps the callback for future use
  3. flycheck-display-error-at-point is called after an idle timer of flycheck-display-errors-delay (default 0.9s)
  4. Inside flycheck-display-error-at-point, it calls sideline-flycheck--show which in turn calls the sideline render callback in step 2.

So this process only works when flycheck-display-error-at-point is larger than sideline-delay.

Customize faces used by sideline-flycheck

I was investigating why neither my sideline-backend nor sideline-default font settings were honored and found:

(let* ((level (flycheck-error-level err))
(face (if (eq level 'info) 'success level))

I'm not certain, yet, but wonder if the sideline display of flycheck-* faces warrants a replacement. I use smaller and variable width sideline fonts to put more info there, for example.

My thinking is to map all flycheck-* fonts to sideline-flycheck-* faces that by default merely inherit from their flycheck counterparts.

E.g. this:

(defgroup sideline-flycheck-faces nil
  "Faces used to display on-the-fly syntax checking in the sideline."
  :prefix "sideline-flycheck-"
  :group 'sideline-flycheck)

(defface sideline-flycheck-error-list-error
  '((t :inherit flycheck-error-list-error))
  "Sideline Flycheck face for error messages in the error list."
  :package-version '(sideline-flycheck . "0.1")
  :group 'sideline-flycheck-faces)

What do you think about that?

Exported list of error faces

flycheck-error                           Flycheck face for errors.                                                       
flycheck-error-list-id                   Face for the error ID in the error list.                                        
flycheck-error-delimiter                 Flycheck face for errors spanning multiple lines.                               
flycheck-error-list-info                 Flycheck face for info messages in the error list.                              
flycheck-error-list-error                Flycheck face for error messages in the error list.                             
flycheck-error-list-warning              Flycheck face for warning messages in the error list.                           
flycheck-error-list-filename             Face for filenames in the error list.                                           
flycheck-error-list-highlight            Flycheck face to highlight errors in the error list.                            
flycheck-error-list-line-number          Face for line numbers in the error list.                                        
flycheck-error-list-checker-name         Face for the syntax checker name in the error list.                             
flycheck-error-list-column-number        Face for line numbers in the error list.                                        
flycheck-error-list-error-message        Face for the error message in the error list.                                   
flycheck-error-list-id-with-explainer    Face for the error ID in the error list, for errors that have an explainer.     

Error messages not displayed at all for long lines

I encountered an issue with the display of error messages, particularly in C++ where error messages can be quite long. If the first line of an error message exceeds the horizontal character limit of the window, the entire message is not displayed.

Arguably, the error message should be truncated to fit within the window's horizontal character limit but should still be displayed.

Message not being full displayed

See the screenshots below.

lsp-ui
Screenshot 2023-11-19 at 15 24 43

sideline
Screenshot 2023-11-19 at 15 26 25

config

(use-package sideline
  :hook ((flycheck-mode . sideline-mode))
  :init
  (setq sideline-delay .1
        sideline-backends-right '(sideline-flycheck))

  :config
  (set-face-attribute 'sideline-default nil :inherit 'success :foreground 'unspecified))

(use-package sideline-flycheck
  :hook (flycheck-mode . sideline-flycheck-setup))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.