GithubHelp home page GithubHelp logo

flycheck / flycheck-popup-tip Goto Github PK

View Code? Open in Web Editor NEW
33.0 8.0 5.0 88 KB

Display Flycheck error messages using popup.el

License: GNU General Public License v3.0

Emacs Lisp 100.00%
emacs flycheck flycheck-extension elisp popup tooltip

flycheck-popup-tip's Introduction

flycheck-popup-tip

License GPL 3 Build Status Coverage Status

This is extension for Flycheck. It implements minor-mode for displaying errors from Flycheck using popup.el.

flycheck-popup-tip screenshot

There is another official flycheck-pos-tip extension for displaying errors under point. However, it does not display popup if you run Emacs under TTY. It displays message on echo area and that is often used for ELDoc. Also, popups made by pos-tip library does not always look good, especially on macOS and Windows.

Installation

Melpa

Package is available on Melpa.

In your Cask file:

(source gnu)
(source melpa)

(depends-on "flycheck-popup-tip")

In your init.el:

(with-eval-after-load 'flycheck
  '(add-hook 'flycheck-mode-hook 'flycheck-popup-tip-mode))

Configuration options

There is only one configuration option, flycheck-popup-tip-error-prefix. Default value is "\u27a4 ": .

(custom-set-variables
 '(flycheck-popup-tip-error-prefix "* "))

Usage with flycheck-pos-tip

If you are planning to use flycheck-pos-tip with GUI Emacs and this extension on TTY, you can do it with following configuration:

(eval-after-load 'flycheck
  (if (display-graphic-p)
      (flycheck-pos-tip-mode)
    (flycheck-popup-tip-mode)))

You can also do the following:

(setq flycheck-pos-tip-display-errors-tty-function #'flycheck-popup-tip-show-popup)
(flycheck-pos-tip-mode)

That will help if you start Emacs in GUI, but run emacsclient in TTY.

Contributing

We welcome all kinds of contributions, whether you write patches, open pull requests, write documentation, help others with Flycheck issues, or just tell other people about your experiences with Flycheck. Please take a look at our Contributor’s Guide for help and guidance about contributing to Flycheck.

Running tests

UNDERCOVER_FORCE=true UNDERCOVER_CONFIG='("*.el" (:report-file "local-report.json") (:send-report nil))' cask exec buttercup -L . -L tests

This will also generate local-report.json file where you can check if coverage dropped below 100%.

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 http://www.gnu.org/licenses/.

flycheck-popup-tip's People

Contributors

simplify avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flycheck-popup-tip's Issues

Add package to Melpa

@cpitclaudel, I'll like to bring this package in Melpa. flycheck-pos-tip doesn't work for me, I'm using Emacs mostly from TTY. Does it make sense to place to place it under Flycheck org? For me is the same, I'll support it anyway.

Marking where point is, does not work

Bug
Write a .cs script with an error:

|XvoidX Foo() {
^
 \___ Cursor is |. Wait until flycheck-popup-tip shows up indicating an error
      and press C-space then C-e to highlight line

The end result is that the cursor moves to the end of the line (due to C-e), but doesn't mark. Disabling flycheck-popup-tip fixes this problem.

Edit

  1. Moving the cursor to the left, leaving one space char "fixes" the issue.
  2. Marking via C-space twice at the original position (in the diagram) "fixes" the issue.
  3. Moving the cursor to the EOL (C-e) "fixes" the issue.

The Popup clears the selection mark when selecting text with errors

When selecting text in emacs by holding the SHIFT key and moving my cursor around with the ARROW keys, if I step on a word highlighted by flycheck, it will open the popup with the error message, clearing my selection at the same time.

This is particularly infuriating when trying to fix errors reported by flycheck when refactoring code, since selecting the offending piece of code, usually results in stepping on a flycheck error which clears the whole thing.

Steps to reproduce the behavior:

  • Open some file with flycheck errors
  • Position your cursor before an error
  • Hold SHIFT and move your cursor over the error, trying to select the area from before the error, to after the error.
  • Observe the selection being cut in the middle when the cursor was on the flycheck error.

I would expect that, when selecting code, the popup should not open, or if it must, it should not clear the selection.

Conflicts with Lsp-mode

Hello,

I thought I would add this comment here after (finally) figuring out why Emacs would sometimes soft-hang at 100% CPU when hovering over /some/ flycheck errors-hints in a terminal:

  1. This only happens towards the end of the buffer, e.g., if there is an error on the last line and you hover over it, Emacs will freeze.

  2. This is due to some conflict with displaying TUI tooltips when both lsp-ui and flycheck-popup-tip wants to display something.

I haven't really had time to dig into /why/ this happens, and eventually I just concluded that lsp-ui essentially supersedes flycheck-popup-tip anyways so I will just be using that. But, if this occurs to you, now you might now why and have an inkling of how to proceed.

using as fallback in tty, when emacs daemon started graphically

I sometimes open emacsclient -nw after starting emacs daemon with the GUI, in which case the tip about (if (display-graphic-p)… doesn't help, since it's only evaluated on daemon startup. This however seems to work:

  (setq flycheck-pos-tip-display-errors-tty-function #'flycheck-popup-tip-show-popup)
  (flycheck-pos-tip-mode)

Installation instructions do not work

Hi, thanks for this package!

Just thought I'd mention your init.el installation instructions did not work for me. I had to manually enable flycheck-popup-tip-mode in every new buffer.

I am using Emacs 26.1, without x.

I managed to get it to work by using:

(with-eval-after-load 'flycheck
  (flycheck-popup-tip-mode))

instead of

(with-eval-after-load 'flycheck
  '(add-hook 'flycheck-mode-hook 'flycheck-popup-tip-mode))

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.