Qiskit / qiskit-code-assistant-jupyterlab

A Jupyterlab extension to use the Qiskit Code Assistant
https://pypi.org/project/qiskit-code-assistant-jupyterlab/
Apache License 2.0
15 stars 2 forks source link

`postModelPromptAccept` is not always called when using "Tab" completer #1

Closed ajbozarth closed 2 weeks ago

ajbozarth commented 2 months ago

The Completer code for "Tab" complete includes some edge cases where the postModelPromptAccept callback won't be called. This is because the postModelPromptAccept callback is tied to the Jupyterlab completer:select-file command. This command is not the only way an item from the completer list can be selected though. There are two cases where the Completer will bypass this command when accepting an item:

  1. If there is only one item listed when the user clicks Tab, this should almost never happen unless the default completer is manually disabled in user settings.
  2. If the user selects the item by mouse click.

The second case is the more problematic case since it could be commonly used.


To address this, I created https://github.com/jupyterlab/jupyterlab/pull/16312, which surfaces the completeraccepted signal to extensions.

Once Jupyterlab 4.3 is released, which includes the update, we will want to update the app.commands.commandExecuted call in index.ts