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

documentation is not hidden automatiically after end typing of the code need manual esc #5906

Closed
victororlyk opened this issue Feb 10, 2023 · 5 comments · Fixed by #8021
Closed
Labels
C-bug Category: This is a bug

Comments

@victororlyk
Copy link

victororlyk commented Feb 10, 2023

Summary

docs poup is not closed automatically when i type outside of that block code. Which may result in not being able to see what you type when you work at the top of the file, or popyp is big enough

Screen.Recording.2023-02-10.at.20.51.24.mov

Reproduction Steps

I tried this:

  1. hx . in rust project
  2. at the top of any file start typing
pub fn some() -> Result<()> {
let i  = 

I expected this to happen:
when i start typing { so i am out of Result block it should stop showing docs for Result

Instead, this happened:
I need to click esc to close docs popup

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

macOS

Terminal Emulator

alacritty

Helix Version

helix 22.12 (96ff64a)

@victororlyk victororlyk added the C-bug Category: This is a bug label Feb 10, 2023
@pascalkuthe
Copy link
Member

I can reproduce this, the popup disappears after deleting some text tough. It's fairly persistent and even sticks around when other documentation popups from a new autocompletion are shown.

@woojiq
Copy link
Contributor

woojiq commented Jul 19, 2023

// lsp doesn't tell us when to close the signature help, so we request
// the help information again after common close triggers which should
// return None, which in turn closes the popup.
let close_triggers = &[')', ';', '.'];

- let close_triggers = &[')', ';', '.'];
+ let close_triggers = &[')', ';', '.', '>'];

This is the only change that needs to be made 😃. I tested manually and it works. But I'm wondering if there are languages where the signature help is closed with }, ] or some other character not mentioned above?

@pascalkuthe
Copy link
Member

that's more of a bandaid, all that does it closing the signature help on > we need a more robust way of closing the signature help

@woojiq
Copy link
Contributor

woojiq commented Jul 19, 2023

Rust-analyzer defines trigger symbols here: https://github.com/rust-lang/rust-analyzer/blob/3759c41d3c6966eb3aa18ad5916c0da65ff19641/crates/rust-analyzer/src/caps.rs#L55C1-L55C1

trigger_characters: Some(vec!["(".to_string(), ",".to_string(), "<".to_string()]),

I see a solution where we take a list of trigger characters from lsp and match it with the corresponding closing characters (( -> ); < -> > etc). The second list is our close_triggers. Sounds good, right 😥?

@pascalkuthe
Copy link
Member

that would be an improvement but doesn't close this issue, signature help doesn't have to be triggered by trigger chars and can occur elsewhere. To fix this issue we would need to rerequest the signature help whenever the document contents change (and the signature help is virible) That's what vs code does too. We might want to debounce this a bit , and the implementation is in essence quite similar to what I will add for completions in the future (using a generailezed event system/debouncer) and should likely wait for those changes.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants