Giter VIP home page Giter VIP logo

flycheck-pos-tip's Introduction

Flycheck

License GPL 3 Join the chat MELPA MELPA stable version NonGNU ELPA CI Docs Lint Python

https://www.flycheck.org

Modern on-the-fly syntax checking extension for GNU Emacs. Try it!

Getting Started

Flycheck is available for installation with package.el on NonGNU ELPA, MELPA Stable and MELPA.

You can install Flycheck with the following command:

M-x package-install [RET] flycheck [RET]

Finally add this to your Emacs config:

(global-flycheck-mode +1)

Alternatively, if you're into use-package you can do the following:

(use-package flycheck
  :ensure t
  :config
  (add-hook 'after-init-hook #'global-flycheck-mode))

Now you can start using any of the bundled checkers or install additional checkers.

For a more gentle introduction read the Installation instructions and go through Quickstart guide.

Getting Help

Please ask questions about Flycheck on Stack Exchange or in our Gitter chat, and report bugs to our issue tracker.

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.

Sponsoring

You can support financially the development of Flycheck and related packages via:

Open Collective Backers

Open Collective Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

Code of Conduct

We strive to create a safe, friendly and welcoming environment in the Flycheck community and have a Code of Conduct that defines acceptable and welcome behaviour as well as sanctions for violations. All contributors and all participants are expected to follow it, on Github, Gitter, Emacs.SX or any other place that’s part of Flycheck’s broader community.

License

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

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

flycheck-pos-tip's People

Contributors

cpitclaudel avatar fmdkdd avatar hunner avatar krasiyan avatar mattiasb avatar swsnr avatar wyuenho 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  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  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  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flycheck-pos-tip's Issues

flycheck-pos-tip prevents the use of any other tooltips

You can't use tooltips for anything else if flycheck-pos-tip is enabled.

flycheck-pos-tip-hide-messages is in post-command-hook, so a call to pos-tip-show or any other command will hide the tooltip immediately after display.

Steps to reproduce.

  1. Enable flycheck-pos-tip
  2. Run eval-expression M-: (pos-tip-show "FLASH")
  3. You might see a tooltip flash, but more likely you won't see anything.

Possible fixes

  1. Remove the hooks after completing your display and add them when showing an error message.
  2. Use a buffer-local sentinel variable that tracks if you're currently displaying an error message. Only hide tooltips if the sentinel is true.

flycheck-pos-tip-mode does not always preserve flycheck-pos-tip-old-display-function

If you have enabled flycheck-pos-tip-mode in multiple buffers, flycheck-pos-tip-old-display-function is overwritten.

The first time flycheck-pos-tip-mode is called, it sets flycheck-pos-tip-old-display-function correctly. However, on the second time it's activated, it sets flycheck-pos-tip-old-display-function to flycheck-pos-tip-error-messages.

As a result, disabling flycheck-pos-tip-mode with M-x flycheck-pos-tip-mode does not have the intended effect, because flycheck-display-errors-function stays as flycheck-pos-tip-error-messages.

I think a good solution would be to make flycheck-pos-tip-old-display-function a buffer-local variable.

Esc makes the tip disappears but it keeps coming back afterward

When I press Esc (or c-g), the tooltip disappears as expected. Unfortunately (if I leave my cursor at the same position) the tip is coming back after a few seconds which is never what I wish for.

Is there another way to quickly dismiss the tip (without changing the cursor position) ?

I hope this is the right place to submit such issue (or should it go more upstream ?)

Thanks for your support.

PS: I am using spacemacs (develop branch).

Increase font size

Is it possible to change the pop-up's font size? It's really tiny on HiDPI displays.

`popup-delete` calls `delete-char`, causing reverification

Hey Sebastian,

popup.el sometimes seems to make changes to the buffer, causing every point movement over an error span to lead to reverification. This is mostly an issue with checkers that highlight large spans, like tex-lacheck.

Recipe (with flycheck-pos-tip enabled):

  • Open a new .el file
  • Type (defun, wait for syntax check to complete and highlight the whole form.
  • Press C-b; wait for the tooltip. Now every press of C-b causes a reverification to happen.

This seems to be due to popup.el making changes in the buffer; here is a stack trace:

  flycheck-handle-change(13 13 1)
  delete-char(-1)
  popup-delete([cl-struct-popup 9 0 8 58 15 nil 1 nil nil nil 0 popup-tip-face nil popup-tip-face popup-summary-face 0 0 nil nil nil 0 0 0 2 ("-> unmatched \"{\"" "<- unmatched \"end of file /home/clement/flycheck_test.tex\"") 15 nil ("-> unmatched \"{\"" "<- unmatched \"end of file /home/clement/flycheck_test.tex\"") nil])
  #[nil ?\205\302   !\207" [nowait tip popup-delete] 2]()
  popup-tip("-> unmatched \"{\"\n<- unmatched \"end of file /home/clement/flycheck_test.tex\"")
  flycheck-pos-tip-error-messages(([cl-struct-flycheck-error #<buffer test.tex> tex-lacheck "/home/clement/test.tex" 1 nil "-> unmatched \"{\"" warning nil] [cl-struct-flycheck-error #<buffer test.tex> tex-lacheck "/home/clement/test.tex" 1 nil "<- unmatched \"end of file /home/clement/flycheck_test.tex\"" warning nil]))
  flycheck-display-errors(([cl-struct-flycheck-error #<buffer test.tex> tex-lacheck "/home/clement/test.tex" 1 nil "-> unmatched \"{\"" warning nil] [cl-struct-flycheck-error #<buffer test.tex> tex-lacheck "/home/clement/test.tex" 1 nil "<- unmatched \"end of file /home/clement/flycheck_test.tex\"" warning nil]))
  flycheck-display-error-at-point()
  apply(flycheck-display-error-at-point nil)
  timer-event-handler([t 22086 2739 967949 nil flycheck-display-error-at-point nil nil 471000])

Which corresponds to this bit of code:

(defun popup-delete (popup)
  "Delete POPUP instance."
    ...
    ;; Restore newlines state
    (let ((newlines (popup-newlines popup)))
      (when (> newlines 0)
        (popup-save-buffer-state
          (goto-char (point-max))
          (dotimes (i newlines)
            (if (and (char-before)
                     (= (char-before) ?\n))
                (delete-char -1)))))))
  nil)

The delete-char there seems to be triggering a new verification. Can you reproduce the issue?

No themed pos tip any more

I'm using spacemacs and realised after the last few updates that my flycheck pos tip is not themed anymore:
flycheck_error

Since it's just a black box, it can be sometimes annoying when it covers code underneath.

I've reported this issue to syl20bnr/spacemacs#3993 and was referred upstream. Details about my emacs setup:

My .emacs.d is currently at: 50ec30be6dd6be709a742dad51dfb016af1c37f0
My spacemacs config can be found here: https://github.com/romanofski/emacsrc/blob/master/spacemacs
Installed emacs is: emacs-24.5-6.fc23 (on Fedora 23)

I tried to use customize-variable to adjust the flycheck relevant bits towards pos-tip but no effect.

Thank you!

`flycheck-pos-tip` fails on terminals

With the current implementation, flycheck-pos-tip throws an error when emacs is run within a terminal.

Flycheck error display error: (error Window system frame should be used)

It would be nice to handle this case, maybe with a fallback in the echo area when there is no window system.

See syl20bnr/spacemacs#4111 for reference.

confilct in the HiDPi result the misplaced popup

I use a 4k screen. and set the window scaling to 2. result the misplace of the popup tips
screenshot from 2016-11-27 19-24-07
Every thing works good when the window scaling is set to 1 as default
seems the pos-tip haven't consider the scale

Pop-up is messed up

For some reason flycheck compilation error popup can't be displayed over text so it chooses to add each line of compilation error popup at the end of existing line:

Maybe i've built my emacs without some important use flag for this to work properly?

Flycheck popup shows up misplaced and with wrong rendering

The pop up always appears in the left half of the screen, vertically centred on the error. It's not using the theme colours either. I'm using emacs 24.5.1 with spacemacs configuration on Ubuntu 15.10.
I'm not sure if pos-tip is at fault here or something else. Spacemacs ? but I haven't seen anyone with the same issue in their tracker. I'll post my config if you need. (I'm kind of fishing here :))

pos-tip

Empty tooltip on Linux

Hello,

I have a strange behavior in Linux -- just an empty tooltip w/o any text. On macOs, everythin is OK.

macOS
image

Linux
image

In both cases the same GNU Emacs version as well as configuration:

(with-eval-after-load 'flycheck
  ;; Each buffer gets its own idle-change-delay because of the
  ;; buffer-sensitive adjustment above.
  (make-variable-buffer-local 'flycheck-idle-change-delay))

(use-package flycheck
  :if (not (equal system-type 'windows-nt))
  :diminish flycheck-mode
  :preface
  (defun my/adjust-flycheck-automatic-syntax-eagerness ()
    "Adjust how often we check for errors based on if there are any.

This lets us fix any errors as quickly as possible, but in a clean
buffer we're an order of magnitude laxer about checking."
    (setq flycheck-idle-change-delay
	  (if flycheck-current-errors 0.5 30.0)))
  :custom
  (flycheck-indication-mode 'right-fringe)
  (flycheck-standard-error-navigation nil)
  (flycheck-emacs-lisp-load-path 'inherit)
  ;; Remove ‘new-line’ checks, since they would trigger an immediate
  ;; check when we want the idle-change-delay to be effect while
  ;; editing.
  (flycheck-check-syntax-automatically
   '(save idle-change mode-enabled))
  :hook
  ((flycheck-after-sytax-check . my/flycheck-adjust-syntax-eagerness))
  :config
  (global-flycheck-mode))

(use-package flycheck-tip
  :after flycheck
  :custom (flycheck-tip-avoid-show-func nil))

(use-package flycheck-pos-tip
  :defer t
  :if (display-graphic-p)
  :after flycheck
  :commands flycheck-pos-tip-mode
  :hook (flycheck-mode . flycheck-pos-tip-mode))

I'll be happy for any suggestions in the right direction.

If cursor stays on error the tip should not disappear

If the error message is long, it would be great if the tip would stay as long open as the cursor stays on the indicated error. Otherwise studying the error message is cumbersome.

Increasing the timeout is a possible work around, but cumbersome if it stays open for too long under errors/warnings which are unimportant and the cursor has been moved already away.

Disable tooltip timeout by default

Hey guys, I know there's been some bugs in the past regarding the tooltip not disappearing, and that a timeout was added on the tooltip to manage this to some degree, but it seems like these past issues have been fixed, and I think it makes sense in general to not have a timeout on errors.
This way, we're able to read through errors without having to continually re-trigger the error popup.

Hope this suggestion is agreeable to everyone! Thanks for all your work on this cool extension!

Tool-tip not disappearing

With the last version, freshly taken from MELPA (20151109.1056), the tool-tip take ages to disappear. It get updated quickly once on a new error (position and text), but even switching to another windows (like firefox) or changing the workspace (in i3) don't close it.

This issue was confirmed by @TheBB, so it shouldn't be config-specific.

flycheck-pos-tip may block my view / hooks for allowing visualization

Hello, there

Using lsp-mode, I've come across certain situations in which the pos-tip is appearing, but it's getting in the way. Particularly, it has happened to me while in evil-insert-state and with company activated.

I'm proposing a two-part solution:

  • A hook in which anyone can add functions (closures or symbols) to test whether the tooltip should be displayed. If only one of them says that it shouldn't be displayed, the tooltip won't be shown.
  • Add "company is currently being presented" and "currently in evil-insert-mode" to this hook

I'm happy with just the first part, though

This is a very useful package. Thank you so much for your work on it.

Fails when there is no window system

I really like the eye-candy your code provides!
Unfortunately, I often work in a terminal and in that case the function pos-tip-window-system returns nil and flycheck-pos-tip-error-messages fails. My workaround is

(with-eval-after-load 'flycheck
  (defun peters-postip-error-messages (errors)
  (if (pos-tip-window-system)
      (flycheck-pos-tip-error-messages errors)
    (flycheck-display-error-messages errors)))
  (custom-set-variables
   '(flycheck-display-errors-function #'peters-postip-error-messages)))

but you could fix this for all of us by putting the branch into flycheck-pos-tip-error-messages.

Keep up the good work
Peter

Tool tip appears outside of emacs window

Image illustrates the problem:

tool-tip-pos

The tool tip never appears where the cursor is and instead appears outside of the emacs window at the edge of my monitor screen.

System Info 💻

  • OS: darwin
  • Emacs: 25.1.1
  • Spacemacs: 0.200.5
  • Spacemacs branch: master (rev. 664ba6a)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(helm emacs-lisp
      (colors :variables colors-enable-nyan-cat-progress-bar t)
      themes-megapack
      (org :variables org-enable-github-support t)
      elixir erlang html javascript markdown nginx python
      (ruby :variables ruby-enable-enh-ruby-mode t ruby-version-manager 'rbenv ruby-test-runner 'rspec)
      ruby-on-rails yaml vimscript auto-completion gtags
      (syntax-checking :variables syntax-checking-use-original-bitmaps t)
      git github version-control)
  • System configuration features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

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.