microsoft / VSExtensibility

A repo for upcoming changes to extensibility in Visual Studio, the new extensibility model, and language server protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow providing command as IntelliSense suggested action in out-of-proc extensions

PaulusParssinen opened this issue · comments

I was investigating whether an existing extension could be migrated to the new a out-of-proc model but I didn't find any API that would allow using the ISuggestedAction to provide commands to the IDE.

I'm requesting to consider adding out-of-proc equivalent APIs to allow triggering commands through the IntelliSense suggestions.

The API would be used to show following suggested action:
image

Using in-proc is out of question as it requires the same legacy .NET FX version.

@PaulusParssinen - You can do this today with an LSP based solution where you can leverage the "Code Actions" feature in the protocol. To see a sample of how to create a simple LSP server as part of your extension, you can reference a sample solution here: https://github.com/microsoft/VSExtensibility/blob/main/New_Extensibility_Model/Samples/FeatureGallery/LanguageServer/TodoLanguageServerProvider.cs

Additionally, we've filed a suggestion ticket to track the request of having individual (non-LSB based) APIs to support editor productivity scenarios: https://developercommunity.visualstudio.com/t/VisualStudioExtensibility-Individual/10707019. Feel free to upvote it.

@PaulusParssinen - You can do this today with an LSP based solution where you can leverage the "Code Actions" feature in the protocol. To see a sample of how to create a simple LSP server as part of your extension, you can reference a sample solution here: https://github.com/microsoft/VSExtensibility/blob/main/New_Extensibility_Model/Samples/FeatureGallery/LanguageServer/TodoLanguageServerProvider.cs

The LSP based on surface seems to be enough for my needs, thank you for the sample!

Additionally, we've filed a suggestion ticket to track the request of having individual (non-LSB based) APIs to support editor productivity scenarios: https://developercommunity.visualstudio.com/t/VisualStudioExtensibility-Individual/10707019. Feel free to upvote it.

I think these APIs will be the way forward. Thank you for tracking this scenario!