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

Improve registration for Assistant code action providers (cherry-pick #23099) #23136

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

gcp-cherry-pick-bot[bot]
Copy link

Cherry-picked Improve registration for Assistant code action providers (#23099)

This PR is a follow-up to
#22911 to further improve the
registration of code action providers for the Assistant in order to
prevent duplicates.

The CodeActionProvider trait now has an id method that is used to
return a unique ID for a code action provider. We use this to prevent
registering duplicates of the same provider.

The registration of the code action providers for Assistant1 and
Assistant2 have also been reworked. Previously we were not call the
registration function—and thus setting up the subscriptions—until we
resolved the feature flags. However, this could lead to the registration
happening too late for existing workspace items.

We now perform the registration right away and then remove the undesired
code action providers once the feature flags have been resolved.

Release Notes:

  • N/A

This PR is a follow-up to
#22911 to further improve the
registration of code action providers for the Assistant in order to
prevent duplicates.

The `CodeActionProvider` trait now has an `id` method that is used to
return a unique ID for a code action provider. We use this to prevent
registering duplicates of the same provider.

The registration of the code action providers for Assistant1 and
Assistant2 have also been reworked. Previously we were not call the
registration function—and thus setting up the subscriptions—until we
resolved the feature flags. However, this could lead to the registration
happening too late for existing workspace items.

We now perform the registration right away and then remove the undesired
code action providers once the feature flags have been resolved.

Release Notes:

- N/A
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 14, 2025
@SomeoneToIgnore SomeoneToIgnore merged commit e74e286 into v0.169.x Jan 14, 2025
12 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the cherry-pick-3b7ca4-v0.169.x branch January 14, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants