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

Copilot onActivated event #234426

Open
alenakhineika opened this issue Nov 22, 2024 · 2 comments
Open

Copilot onActivated event #234426

alenakhineika opened this issue Nov 22, 2024 · 2 comments
Assignees

Comments

@alenakhineika
Copy link

We use the following check to decide whether or not to display copilot-related CTAs:

vscode.extensions.getExtension('github.copilot-chat')?.isActive

This check doesn't properly work through right after our participant extension startup. It seems that it takes time to activate the copilot and it happens after our extension is up and running. Is there a way to listen for the activation of github.copilot-chat?

I also tried vscode.extensions.onDidChange to hide copilot-related CTAs when a user disables the copilot chat extension, but it looks like the event doesn't happen on disabling, only when you enable the extension.

@alenakhineika
Copy link
Author

Just found out that it works as expected with vscode.extensions.getExtension('GitHub.copilot').

@alenakhineika
Copy link
Author

Actually, I played with this more, and GitHub.copilot also does not handle all cases. It looks like it is being activated earlier than github.copilot-chat so it covers out case to show or hide an icon when our extension is activated. But if we listen for vscode.extensions.onDidChange events considering that users might enable/disable the copilot in the meanwhile, the onDidChange is being triggered when the GitHub.copilot extension was enabled, but the isActive returns false. So the initial question is still valid, is there a way to listen for the onActivated state in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants