Giter Site home page Giter Site logo

sideline-flycheck's Introduction

License: GPL v3 JCS-ELPA MELPA MELPA Stable

sideline-flycheck

Show flycheck errors with sideline

CI

demo

๐Ÿ”จ Quickstart

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

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

๐Ÿ”ง Customization

๐Ÿงช Variables

  • sideline-flycheck-display-mode - Method type to when sideline will display flycheck's errors.
  • sideline-flycheck-show-checker-name - If non-nil, show the checker's name at the back.
  • sideline-flycheck-max-lines - Maximum number of lines to show.

๐Ÿ› ๏ธ Contribute

PRs Welcome Elisp styleguide Donate on paypal Become a patron

If you would like to contribute to this project, you may either clone and make pull requests to this repository. Or you can clone the project and establish your own branch of this tool. Any methods are welcome!

๐Ÿ”ฌ Development

To run the test locally, you will need the following tools:

Install all dependencies and development dependencies:

$ eask install-deps --dev

To test the package's installation:

$ eask package
$ eask install

To test compilation:

$ eask compile

๐Ÿชง The following steps are optional, but we recommend you follow these lint results!

The built-in checkdoc linter:

$ eask lint checkdoc

The standard package linter:

$ eask lint package

๐Ÿ“ P.S. For more information, find the Eask manual at https://emacs-eask.github.io/.

โšœ๏ธ License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

See LICENSE for details.

sideline-flycheck's People

Contributors

dependabot[bot] avatar jcs090218 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sideline-flycheck's Issues

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.     

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)
  )

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))

`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.

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.