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

editor.action.showHover does not focus the hover when called programatically #211582

Open
musjj opened this issue Apr 28, 2024 · 0 comments
Open
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-hover Editor mouse hover

Comments

@musjj
Copy link

musjj commented Apr 28, 2024

Does this issue occur when all extensions are disabled?: Yes

  • VS Code version: Code 1.88.1 (e170252, 2024-04-10T17:34:12.840Z)
  • OS version: Linux x64 6.6.28

Steps to Reproduce:

  1. Call vscode.commands.executeCommand('editor.action.showHover') twice from a plugin.

When called from a regular binding, this will focus the hover. When called from a plugin, this will just close and re-open the hover again.

For a real-world example, this is a problem for the Vim plugin: VSCodeVim/Vim#3740 (comment)

The relevant code:

src/actions/commands/actions.ts

@RegisterAction
class ActionTriggerHover extends BaseCommand {
  modes = [Mode.Normal];
  keys = ['g', 'h'];
  override runsOnceForEveryCursor() {
    return false;
  }

  public override async exec(position: Position, vimState: VimState): Promise<void> {
    await vscode.commands.executeCommand('editor.action.showHover');
  }
}
@aiday-mar aiday-mar added editor-hover Editor mouse hover bug Issue identified by VS Code Team member as probable bug labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug editor-hover Editor mouse hover
Projects
None yet
Development

No branches or pull requests

2 participants