Skip to content

Initial extension interaction service #9927

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

Merged
merged 25 commits into from
Jun 25, 2025

Conversation

adamint
Copy link
Member

@adamint adamint commented Jun 18, 2025

Adds a basic interaction service implementation on the CLI and fixes some of the rpc connection logic between CLI and extension.

Specifically,

  • adds the ExtensionBackchannel
  • adds the ExtensionBackchannelConnector background service that attempts backchannel connection immediately after CLI program start and provides a method to wait for connection
  • implements the ExtensionRpcTarget to provide CLI versioning and prompt verification arguments
  • catches ExtensionInputCanceledException (thrown if a user cancels instead of confirming/entering information in VS code) in commands
  • implements the ExtensionInteractionService. for now, this impl will call the console interaction service for allh non-prompting invocations, and calls into the extension for prompting and confirmation methods
  • opens the created project in the workspace if there are no open folders in the workspace

You can test the e2e connection by building the aspire.cli project and then running the extension (open extension in vs code and f5).

@adamint adamint changed the title [draft] initial extension interaction service Initial extension interaction service Jun 18, 2025
… ValidatePromptInputStringAsync to rpc target, implement prompting apis
@adamint adamint marked this pull request as ready for review June 23, 2025 03:07
@adamint adamint requested a review from mitchdenny June 23, 2025 03:07
@adamint adamint requested a review from mitchdenny June 23, 2025 06:11
@adamint adamint merged commit 6ab1e17 into dotnet:main Jun 25, 2025
496 of 498 checks passed
radical added a commit to radical/aspire that referenced this pull request Jun 25, 2025
eerhardt added a commit to eerhardt/aspire that referenced this pull request Jun 25, 2025
adamint added a commit that referenced this pull request Jun 25, 2025
* Reapply "Initial extension interaction service (#9927)" (#10030)

This reverts commit aab8668.

* Update ExtensionBackchannel to be AOT compatible

Reuse the same Json source generation context. Add ExtensionBackchannel types to it.

Need to suppress a RDC warning due to EventHandlers on the Rpc Target object needing to call MakeGenericMethod, but we aren't using EventHandlers so it can be suppressed.

* Fix new AOT warnings:

Remove Exception from the wire payload since it can't be safely STJ serialized using the source generator.

Enable Configuration Binder source generator in the Aspire.Cli.

* untrack generated files

* subclass OperationCanceledException for ExtensionInteractionService

---------

Co-authored-by: Adam Ratzman <adam@adamratzman.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants