-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[layers/+lang/haskell] Prolong flycheck popup duration in Haskell layer. #13803
[layers/+lang/haskell] Prolong flycheck popup duration in Haskell layer. #13803
Conversation
Setting Let's make a Remove that variable assignment Add these lines: (defvar syntax-checking-auto-hide-tooltips 5
"Seconds until the tooltip auto hides (default 5).
If nil, keep tooltips open until the cursor is moved.") before this
Then in the
after the Add this variable assignment: (setq flycheck-pos-tip-timeout (or syntax-checking-auto-hide-tooltips -1)) The function ends up looking like this: (defun syntax-checking/init-flycheck-pos-tip ()
(use-package flycheck-pos-tip
:if syntax-checking-enable-tooltips
:defer t
:init
(with-eval-after-load 'flycheck
(flycheck-pos-tip-mode)
(setq flycheck-pos-tip-timeout (or syntax-checking-auto-hide-tooltips -1))))) That will make it possible to change the tooltip duration by adding the new variable to the Keep the tooltip open until the cursor is moved: (syntax-checking :variables syntax-checking-auto-hide-tooltips nil) Or set it to a specific number of seconds: (syntax-checking :variables syntax-checking-auto-hide-tooltips 20) And could you add an entry in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check duiantos review and fix the open points. This setting is not layer specific but rather a flycheck wide setting and should therefore be part of the syntax-checking layer to be configured.
The default could be 10 seconds, but is documented in "syntax-checking" layer. With this people could adapt the popup timeout to match their habit.
Remember that this is only valid for non lsp powered modes. If lsp is used lsp-ui
will take care to project the warning into the buffer without a popup, hence there is no timeout.
Also document the new layer variable in After the Add this or something more descriptive:
|
Any news here, @Martinsos? Do you wish to try to implement duiantos idea, or should I take over that change? |
Sorry for not replying sooner @duianto and @smile13241324 ! I would like to implement this and other
issues/PRs I opened, I was slow with responses because I am on summer
vacation, but I will be back in couple of days and will get to it then!
…On Wed, 19 Aug 2020, 23:16 Maximilian Wolff, ***@***.***> wrote:
Any news here, @Martinsos <https://github.com/Martinsos>? Do you wish to
try to implement duiantos idea, or should I take over that change?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13803 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALXFBZYYBTGIVCUHZVPBA3SBQ6KRANCNFSM4PN6SX3A>
.
|
@duianto and @smile13241324 thank you for very detailed instructions, since I am beginner with spacemacs they helped a lot and helped me learn more about how spacemacs works. I implemented your suggestions, with only difference being using I believe this is it, but I do still have questions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good so far, just the default I would change to nil so that the popups do not longer autohide
@Martinsos while I agree that a default timeout should be set to 0, as I would also expect a tooltip not to disappear automatically, this is still unrelated to the language used. In spacemacs all auto complete and syntax checking decisions are centralised so that these behave consistent in all languages, therefore this setting cannot be set on a layer basis. @duianto do you see any reasons why not to set the default to "0" hence let the popup not disappear automatically? |
Btw @Martinsos can you add your change to the changelog.develop please, we hope to use this for documenting the main changes when we finally have another release. |
I just used the default value that's defined upstream in flycheck-pos-tip:
There seems to be some reports requesting both behaviors:
I don't have a preference either way. But since you mentioned that lsp mode doesn't have a timeout for the popups, then it might be more consistent if both types of tooltips (lsp and flycheck) behaved the same. |
Yep, I have not yet noticed that, you are right yes LSP has no popup hence there is no timeout the information is projected into the right side of the screen as long as your cursor is on the warning. So lets set the default to no popup, then the people who wish to have it autohide can set it accordingly, and the others who do not want to see any popup and rather see it in the mini buffer, eldoc style, can disable tool-tips all together. |
@smile13241324 and @duianto sounds good, I am also in favor of not auto-hiding the tooltips by default. I added commit where I set @smile13241324 regarding changelog.develop, I already added the change there, is that it? |
The readme needs to be updated to reflect that the tooltips aren't hidden automatically by default. And can you squash the commits, the recommendation https://github.com/syl20bnr/spacemacs/blob/develop/CONTRIBUTING.org#ideally-for-simple-prs-most-of-them |
9f653cd
to
3295b78
Compare
@duianto ah I forgot about the README! Ok updated, and I squashed the commits! I normally squash commits when working on my code, but I do it when PR is done so I don't mess up with the comments on github because it can happen they become outdated otherwise and it becomes harder to track the conversation. |
I'm observing the issue that's described here: The tooltip is displayed on top of all applications when switching to an application that's on top of Emacs.
It seems to have been fixed when it was reported in 2015. Maybe something's changed since then. UpdateI reported it in that upstream issue: flycheck/flycheck-pos-tip#6 (comment) |
@duianto true, I can also replicate this! Never noticed it before. |
While recently using haskell layer, I realized that flycheck popups dissapear after 5 seconds, which was making my development really hard -> error messages in haskell are usually pretty complex and lenghty, and trying to read them in 5 seconds is in most cases impossible, so I would repeatedly have to move and return my cursor on the position of error to see the message again and again.
After some digging and help from people on gitter, I learned that by default flycheck shows popup for 5 seconds (this default is coming from flycheck-pos-tip), and that duration of popup can be modified with
flycheck-pos-tip-timeout
variable. I put it to 20 seconds since I believe that is fairly long, we could even put it to something longer. I am not even sure if this popup timeout is useful at all to be honest.This is my first commit and I am not very proficient with elisp so I put it is most obvious place and I can confirm that it works, however I don't know if there is a better location to put this command, I am hoping you will tell me!