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

insert mode: context free popups - hover #5549

Closed
kendfss opened this issue Jan 16, 2023 · 2 comments
Closed

insert mode: context free popups - hover #5549

kendfss opened this issue Jan 16, 2023 · 2 comments
Labels
C-bug Category: This is a bug S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Comments

@kendfss
Copy link

kendfss commented Jan 16, 2023

Summary

I've not yet figured out how to intentionally trigger the 'hover' display from insert-mode without (assumption) using a keymap. I assume it occurs between parentheses (don't know if it's expected to appear elsewhere, I think struct/class/func-names should be possible) but it does not go away when it does come up, even after I've made changes in contexts that don't warrant its presence, like when completions are in view, or should spawn a new instance.

I can close it by esc, but that also exits insert mode.

it also closes when:

  • removing the opened parentheses (gopls)

I have some ideas for a solution, that could also help with #1381 and #4144, but before I get to those its important to at least ask the following question:

  • Should completion and hover displays be simultaneously visible or is this a non-bug?
    • I think it is a bug because the hover display doesn't seem to close when it becomes obsolete unless the user exits insert mode. Then there's the issue of too much auxilliary information on the screen
    • If it is not a bug/this behaviour is intended, I do not want to impose; please feel free to say so and close the issue

A solution should, if even necessary, address or circumvent two things:

  • Failure to auto-close the display
  • Departure from insert-mode to close the screen

The following solutions lean on circumvention, the difficulties are estimates by someone who is admittedly not very familiar with the code base:

  1. change the behaviour of esc handler such that it first looks for sub-displays (command menus, pickers, command palette, /dev/stdout, ..., completions, hovers) and closes the top one before returning. Go to normal mode if, and only if, none are found.
    a) could be easy if all of those sub-displays implement a common interface and those interfaces already have a syntactic access point
  2. when opening a completion display, find and close any hover display(s), before returning
  3. figure out how to automatically close a hover display when its no longer needed

Reproduction Steps

na

Helix log

na

Platform

Linux

Terminal Emulator

Tmux in gnome-terminal

Helix Version

helix 22.12 (051cd78)

@kendfss kendfss added the C-bug Category: This is a bug label Jan 16, 2023
@kendfss kendfss changed the title insert mode: Completion and hovering showing up simultaneously insert mode: context free popups - hover Jan 16, 2023
@the-mikedavis
Copy link
Member

That is signature-help (#1755) rather than hover. It should possible to have signature-help open at the same time as completion. For the overlapping bug, see #3821. For dismissing signature help, you can use Ctrl+c in insert mode or exit to normal mode as you say. There is also this issue discussing when the signature-help pane should be open - #3385 - but that behavior is up to the language server rather than helix: we send trigger events when you type a trigger character like ( or , and the language server sends back signatures.

@kirawi kirawi added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 18, 2023
@kirawi kirawi closed this as completed Feb 6, 2023
@kendfss
Copy link
Author

kendfss commented Feb 9, 2023

Sorry for the late reply, but yeah, this solves my problem. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

No branches or pull requests

3 participants