Skip to content
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

Triggering flycheck-popup-tip clears the selected region #7242

Closed
4 tasks done
hartikainen opened this issue May 17, 2023 · 5 comments
Closed
4 tasks done

Triggering flycheck-popup-tip clears the selected region #7242

hartikainen opened this issue May 17, 2023 · 5 comments
Assignees
Labels
is:upstream Originates from outside the project and cannot be fully addressed here module:checkers/syntax Pertains to Doom's :checkers syntax module

Comments

@hartikainen
Copy link

hartikainen commented May 17, 2023

I confirm that...

  • I have searched the issue tracker, documentation, FAQ, Discourse, and Google, in case this issue has already been reported/resolved.
  • I have read "How to Debug Issues", and will use it to provide as much information about this issue as possible.
  • The issue can be reproduced on the latest available commit of Doom.
  • The issue can be reproduced on a stable release of Emacs, such as 27 or 28. (Doom does not support development builds like 29+ or any version ending in .50 or .9x)

Expected behavior

With eglot enabled, when I set mark and move the cursor within a buffer, I would expected the region to stay active and expand/shrink based on my cursors position. Here's an example of the expected behavior, without eglot, that is, otherwise the same setup as the current behavior below, but recorded after eglot-shutdown.

without-eglot.mov

Current behavior

With eglot enabled, when the cursor moves onto a line with eglot error, the region gets cleared/unselected. See the video below. The region selection works as expected on the first couple of lines, but when I move the cursor to a region where eglot reports an error, the region suddenly disappears.

with-eglot.mov

Steps to reproduce

  1. Open emacs with (lsp +eglot) and (python +lsp +pyright +conda +cython) configurations in init.el.
  2. Write a python file with syntax error, similar to the example in the videos above.
  3. Open the python file in a new buffer and make sure that eglot is enabled.
  4. Set mark in the buffer.
  5. Move cursor over to a point where eglot reports an error.
  6. The region gets cleared.

System Information

https://pastebin.com/EMjHtP6w

@hartikainen hartikainen added is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels May 17, 2023
@hartikainen
Copy link
Author

I want to note that there's a syntax error, i.e. a missing comma, on line 15 in the code above. Adding a comma makes the region work as expected. I think the bug still stands as I would expect the region to stay active despite the syntax error.

@totallyuniquelily
Copy link

I've run into what I believe to be this issue, and it can be triggered without eglot (though if it turns out to just be similar I'll open a new issue).
Posting this in the hope that a possibly more minimal repro is useful.

I have eglot disabled, but I lose my region in elisp scratch buffers when I move my cursor over an error.
Disabling flycheck-mode fixes it for me (though that might just be because there's no errors)

I've managed to reproduce with only the following:

  1. disabled all modules aside from emacs-lisp, syntax, and (default +bindings +smartparens)) and doom{,-dashboard,-quit}
  2. Open a new scratch buffer, and set emacs-lisp-mode
  3. Write code. It can be correct, as flycheck will whine about there being no heading or footer.
  4. Same as in original report, set mark and move over an error.
    You may also press shift-down while on a line with an error, and that line will not be selected
2024-04-07.22-07-11.mp4

my doom info:

@hlissner
Copy link
Member

hlissner commented Apr 7, 2024

This is probably flycheck-popup-tip's doing. See if enabling the +childframe flag on the :checkers syntax module fixes this for you (it'll use a child frame to display those errors instead).

EDIT: sure enough: flycheck/flycheck-popup-tip#14. And this will only affect non-evil users, thanks to this advice.

@hlissner hlissner added module:checkers/syntax Pertains to Doom's :checkers syntax module is:upstream Originates from outside the project and cannot be fully addressed here and removed is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels Apr 7, 2024
@hlissner hlissner added this to Triage Apr 7, 2024
@hlissner hlissner moved this to Investigating in Triage Apr 7, 2024
@totallyuniquelily
Copy link

can indeed confirm that +childframe fixes it!

@hlissner hlissner changed the title Eglot interferes with and clears the selected region Triggering flycheck-popup-tip clears the selected region Apr 7, 2024
@hlissner hlissner moved this from Investigating to In progress in Triage Apr 7, 2024
@hlissner hlissner added this to the modules v24.05 milestone Apr 7, 2024
@hlissner hlissner self-assigned this Apr 7, 2024
@hlissner hlissner moved this from In progress to Resolved in Triage Apr 7, 2024
@hlissner
Copy link
Member

hlissner commented Apr 7, 2024

As of 6756911 this should be resolved for folks not using +childframe. Thanks for bringing it to my attention!

peterhoeg pushed a commit to peterhoeg/doomemacs that referenced this issue Apr 8, 2024
Moving the cursor over a flycheck-highlighted error will display the
error message in a popup. Displaying that popup could clear the active
selection (doomemacs#7242), which is disruptive. This only affected non-Evil
users and users not using the module's +childframe flag, but should no
longer affect anyone after this commit.

Fix: doomemacs#7242
Ref: flycheck/flycheck-popup-tip#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:upstream Originates from outside the project and cannot be fully addressed here module:checkers/syntax Pertains to Doom's :checkers syntax module
Projects
Status: Resolved
Development

No branches or pull requests

3 participants