[WIP] Feat: show tab-specific icon status and turn on/off completion on each page manually
Add a contextMenu option to control the behavior on the current tab:
Three status:
idle: The extension is enabled, but the URL is not in white list or no editor can be injected
off: the extension is disabled by the user
active: the completion is working on this page.
Implementation issues:
contentScript.ts and the injected script.ts are running independently, so we have to construct so many messages to communicate between different environments. Temporarily, the "disabled" feature is hacked by passing the global variable codeium_disabled and let the completion provider in Monaco/CodeMirror be dummy when observing codeium_disabled become false, instead of implementing a real clean up script to unregister all completion handlers. It may be problematic, for example, Colab supports inline completion for some eligible users. If we turn off the Codeium extension, the built-in colab completion is also disabled.
For issue #49 (for now, only 1 and 3 are done)
Adding @kevinzlu to take a look if he has time, since I am OOO right now.
@li-xin-yi is this PR still a WIP or is it ready for review? I was not able to get the contextMenu item when I tested it + failed to get completions in Colab.
Hi @kevinzlu , Thanks for testing.
- When creating this PR, I just waited for the review to make sure if I understand @pqn 's suggestion correctly. This PR is not finished, I'll implement the popup window to finish the feature 2 in #49
- Can you provide more details about the failure? If on Colab, I think the colab itself overwrote the contextmenu on cell areas, but the default contextmenu does show up when clicking on other regions, such as the header.
This PR is still in process, I just posted it to know if it understand the requirement correctly.