VisualStudio.Extensibility: A New Way to Write Extensions
Last year, we announced the first phase of a new extensibility model for Visual Studio. This new model will make extensions easier to write and more reliable along with additional benefits such as being able to install these extensions without restarting the IDE. Now, we’re excited to announce the second phase of the new extensibility model, now titled VisualStudio.Extensibility!
What’s new for phase 2 of VisualStudio.Extensibility?
Phase 1 enabled editor APIs that let you create linter and formatter extensions. The following VisualStudio.Extensibility APIs allow you to write richer, non-language-based productivity extensions.
Remote UI Framework
Adding UI can be an important part of creating an extension. Now you can create UI-based extensions with the addition of the WPF-based Remote UI framework. Unlike the in-proc UI framework in the previous model, Remote UI is out-of-proc and fully asynchronous, relying on a Model-View-ViewModel design pattern, XAML, data binding, and commands.
Using the new Remote UI framework, extensions can now provide custom tool windows. Tool windows can be registered with a default placement (such as floating in the document well, relative to other VS tool windows) and auto-creation (allowing the window layout to recreate and show the tool window when needed). Additional support is included for using context rules to dynamically show and hide a tool window. also new extensibility APIs for finding, showing, and hiding these tool windows. All the new tool window behaviors are set up to be asynchronous including getting the tool window’s properties and content.
New Editor API Additions
The VisualStudio.Extensibility editor scenarios are expanding! Now you can do the following:
You can now write commands that do the following:
- Display Tooltips – You can write an extension that displays additional information in the form of a tooltip when hovering over a feature or control in Visual Studio.
- Show custom images – Further personalize your extensions by referencing your own custom images (i.e. images outside the list of known VS monikers) in your extension commands.
Task Progress Notifications
If your extension needs to run tasks in the background, you can let your extension users know the tasks’ execution progress with user prompt notifications. You can also give users the option to cancel these tasks.
Additionally, you can prompt users with additional prompts when they select one of your extension commands.
Smoother migration with in-proc support
In addition to out-of-proc support for writing more reliable extensions, phase 2 of VisualStudio.Extensibility now includes in-proc support. Enabling in-proc APIs will allow you to migrate your existing extensions in manageable chunks. Even if you don’t have an existing extension, this support will let you fill in API gaps that the VisualStudio.Extensibility model does not yet support but are essential to your extension scenarios.
What’s next for VisualStudio.Extensibility?
There’s still a long, exciting road ahead for VisualStudio.Extensibility. Stay tuned for phase 3 where we’ll introduce even more useful scenarios!
Get Started with VisualStudio.Extensibility!
The VSExtensibility repo is your hub for getting started with VisualStudio.Extensibility, where you’ll find documentation, code samples and setup instructions.
Don’t forget to share your feedback! We’d love to hear about your experience using these new APIs so we can make them more consistent and easier to use as we continue expanding VisualStudio.Extensibility. Also, take this survey to share your feedback on how we can improve diagnosing extension issues with VisualStudio.Extensibility.