Automatic activation event for chat context provider#280677
Merged
alexr00 merged 2 commits intomicrosoft:mainfrom Jan 20, 2026
Merged
Automatic activation event for chat context provider#280677alexr00 merged 2 commits intomicrosoft:mainfrom
alexr00 merged 2 commits intomicrosoft:mainfrom
Conversation
Fixes microsoft#280643 The issue was that extensions contributing chat context providers were not being activated when their context providers were needed. This was because the chatContext extension point was missing an activationEventsGenerator. When an extension contributes a chatContext item in package.json, it also defines an activation event like 'onChatContextProvider:my-chat-context-provider'. However, without the activationEventsGenerator, VSCode didn't know to activate the extension when that context provider was requested. This commit adds an activationEventsGenerator to the chatContext extension point registration, following the same pattern used in other extension points like chatParticipants. The generator yields 'onChatContextProvider:${contrib.id}' for each chatContext contribution, ensuring extensions are properly activated when their context providers are needed.
chrmarti
approved these changes
Jan 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #280643
Problem
Extensions contributing chat context providers were not being activated when their context providers were needed. This was because the
chatContextextension point was missing anactivationEventsGenerator.Solution
Added an
activationEventsGeneratorto thechatContextextension point registration, following the same pattern used in other extension points likechatParticipants.The generator yields
onChatContextProvider:${contrib.id}for each chatContext contribution, ensuring extensions are properly activated when their context providers are needed.Testing
This fix enables the activation event pattern documented in the API:
onChatContextProvider:<id>in their activation eventsThe issue was that extensions contributing chat context providers were not being activated when their context providers were needed. This was because the chatContext extension point was missing an activationEventsGenerator.
When an extension contributes a chatContext item in package.json, it also defines an activation event like 'onChatContextProvider:my-chat-context-provider'. However, without the activationEventsGenerator, VSCode didn't know to activate the extension when that context provider was requested.
This commit adds an activationEventsGenerator to the chatContext extension point registration, following the same pattern used in other extension points like chatParticipants. The generator yields 'onChatContextProvider:${contrib.id}' for each chatContext contribution, ensuring extensions are properly activated when their context providers are needed.