GithubHelp home page GithubHelp logo

emacs-sideline / sideline-flymake Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 8.0 775 KB

Show flymake errors with sideline

License: GNU General Public License v3.0

Makefile 10.06% Emacs Lisp 89.94%
flymake sideline

sideline-flymake's Introduction

License: GPL v3 JCS-ELPA MELPA MELPA Stable

sideline-flymake

Show flymake errors with sideline

CI

demo

🔨 Quickstart

(use-package sideline-flymake
  :hook (flymake-mode . sideline-mode)
  :init
  (setq sideline-flymake-display-mode 'point) ; 'point to show errors only on point
                                              ; 'line to show errors on the current line
  (setq sideline-backends-right '(sideline-flymake)))

🔧 Customization

🧪 Variables

  • sideline-flymake-display-mode - Method type to when sideline will display flymake's errors.
  • sideline-flymake-show-backend-name - If non-nil, show the checker's name at the back.
  • sideline-flymake-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-flymake's People

Contributors

dependabot[bot] avatar djgoku avatar jcs090218 avatar matasar avatar philipmw avatar toniz4 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

sideline-flymake's Issues

[feature] Customize faces

I noticed there is no face that can be customized in sideline-flymake. In sideline-flymake--show-errors, error, warning and success are used. It's better add some faces can be customized by users.

Error running timer ‘sideline-render’: (void-function sideline-flymake)

I just installed sideline-20240222.151 into Emacs 29.2 on macOS. When I open a file that triggers it (a Clojure file in this case), I get this in *Messages*:

Error running timer ‘sideline-render’: (void-function sideline-flymake)

The error repeats for each such file I open.

As an Emacs newbie, I don't know how to debug this further.

Option to get errors from the whole line

By default, lsp-ui shows errors for the whole line, and now that i'm using flymake, I wanted to keep that behaviour. So I had to do this:

(defun my-sideline-flymake--get-errors ()
  (flymake-diagnostics (line-beginning-position) (line-end-position)))

(advice-add 'sideline-flymake--get-errors :override #'my-sideline-flymake--get-errors)

The result is this:
image

It's kinda hacky, and it would be nice if there was a variable that you could toggle that funcionality.

Is this something that you are interested? I could make a PR making that possible, letting the default be the current behaviour.

Eglot diagnostics don't display with right type

All diagnostics were showing as notes for me in eglot. To make diagnostics show with the type I expect I had to do this:

(defun sideline-flymake--show-errors (callback &rest _)
    "Execute CALLBACK to display with sideline."
    (when flymake-mode
      (when-let ((errors (sideline-flymake--get-errors)))
        (dolist (err errors)
          (let* ((text (flymake-diagnostic-text err))
                 (type (flymake-diagnostic-type err))
                 (face (cl-case type
                         ('eglot-error 'error)  ;; NOTE: These were missing
                         ('eglot-warning 'warning)
                         (:error 'error)
                         (:warning 'warning)
                         (t 'success))))
            (add-face-text-property 0 (length text) face nil text)
            (funcall callback (list text)))))))

I don't know if there's a better way but this worked for me.

Misalignment with errors spanning multiple lines

@jcs090218 I believe that this doesn't work when the flymake error takes multiple lines. Consider that I'm using eglot with the haskell-language-server-wrapper LSP server.

In particular looking at the sideline-flymake--show-errors it seems that the candidates are always only one i.e. a string potentially containing multiple lines. And this implies that sideline shows things horizontally misaligned.

image

Changing the last line of the function to (funcall callback (split-string text "\n")) seems to improve a bit the situation but the order is now wrong:

image

Also notice that probably it would make sense removing all the whitespaces a the beginning of each line.

PS: this is my configuration

(use-package sideline
  :delight
  :hook (flymake-mode . sideline-mode)
  :custom
  (sideline-flymake-display-mode 'line)
  (sideline-backends-right '(sideline-flymake))
  (sideline-flymake-max-lines 5)
)

Haven't tried with -Q because I don't think this is due to other packages.

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.