The Future of Visual Studio Extensibility is Here!

Leslie

Visual Studio 2022 seeks to greatly improve your overall development experience, and we’re moving forward with that journey in improving VS extension writing and usage today!  We have several exciting extensibility updates that are either available now or on the horizon, so let’s check them out!

 

Bookmark the new VSExtensibility GitHub repository

With so many extensibility developments (many of which are still in preview), we needed a hub to contain it all!  We’ve created a public VSExtensibility repo (or aka.ms/vsextensibilityupdates) as your go-to destination for upcoming extension-related announcements, code samples, and documentation on preview features. The docs and code samples will evolve and migrate to official Microsoft documentation as we iterate on our extensibility projects.  Keep an eye on the repo for regular updates!

 

Using extensions in Visual Studio 2022

For many of you, having your ideal, 64-bit Visual Studio 2022 experience is not complete without the extensions that are essential to your development environment.  If you’re an existing extension author, you’ll need to successfully migrate your extension to be VS 2022-compatible using the VS 2022 extension migration guidance.  Many popular extensions such as CodeRush, VSVim, Productivity Power Tools, and most Mads Kristensen extensions are available now, and there will be more to come as we approach VS 2022’s official release.

Image vs2022 marketplace
Visual Studio 2022 extensions on VS Marketplace

 

Expand Language Server Protocol (LSP)

We are now offering extensions to the Language Server Protocol functionalities which let you leverage capabilities specific to Visual Studio.  Servers can use these additional contracts to provide additional functionalities such as diagnostics info and project contexts when communicating with a Visual Studio instance.

To get started, check out the LSP extension documentation and download the related NuGet package.

 

Easier extension writing with the Visual Studio Community Toolkit

One of the biggest hurdles to writing a VS extension is that they can be hard to write, especially when you’re just starting out.  We’ve heard from authors and aspiring authors that this is due to numerous factors, including hard-to-discover, dated APIs, inconsistent, inaccurate documentation, and lack of best extensibility practices.

To tackle this issue, we have created the Visual Studio Community Toolkit.  This toolkit is a community-driven set of project templates, API wrappers, and productivity tools that provide a simpler, streamlined experience for writing extensions in Visual Studio.

Image toolkit templates
VS Community Toolkit Project Templates

 

Image toolkit insert guid
Extension command written with the VS Community Toolkit

 

Image toolkit icon intellisense
VS Community Toolkit Icon IntelliSense

 

Image toolkit intellisense command placement
Full, visual IntelliSense for extension command placement

 

How do I get started with the Community Toolkit?

The recommended way to get started is to head on over to the VSIX Cookbook and follow the guide. There’s lots of easy-to-follow tutorials, videos, and code samples to get you going.  The best part about the Community Toolkit is the community! If there are additional scenarios you’d like to see added to the toolkit, you can contribute to and provide feedback for the Community Toolkit and other open-source projects by checking out the VSIX Community org on GitHub.

 

Write securer, more reliable extensions with the new, Out-of-Proc Extensibility Model

Extensions crashing VS.  Lack of secure extensions.  Inconsistent documentation.  Having to restart VS when installing extensions.  These are some of the most common frustrations extension users and writers have expressed in the past few years.  Compared to the current model, the new extensibility model loads extensions out-of-process.  This allows for more reliable extensions that won’t cause Visual Studio to hang or crash.  Like the Community Toolkit, this new model will make extensions easier to write with more cohesive APIs and documentation.  Also, extensions written with the out-of-proc model let you install them without restarting VS. Last but not least, these extensions can be placed in low-trust environments, protecting your dev machine.

What can I do with the new extensibility model in Phase 1?

Phase 1 allows you to write and F5-debug out-of-proc, command-focused extensions working with open documents such as single-file linters and formatters using the new model’s editor API.  Writing linter extensions such as spell checkers provides your users with diagnostic info in the VS editor via squiggles and error list entries.  Writing a formatter extension lets your users easily “prettify” or format their code.  Publishing out-of-proc extensions to the VS Marketplace is still to come!

Image linter example
Example linter extension in Tools window using out-of-proc model

 

Is the current extensibility model being deprecated?

No!  Continue using the current model for any VS 2022 extensions that will be distributed to users and/or published in the VS Marketplace.

How do I get started with the out-of-proc model?

The new extensibility model is a long, ongoing project. As a result, it won’t be available at full feature parity and general consumption by the end of VS 2022’s release cycle. Whether you’re new to writing extensions or you’re an extension-writing pro, we encourage you to try writing an extension using the new model and share your feedback under Issues in the VSExtensibility repository!

 

There are so many updates!  Where and when should I use each one?

Overwhelmed by all the new extensibility additions and not sure which one(s) you should use?  Ask yourself the following questions:

How do I make sure my extension is compatible with Visual Studio 2022?

Follow the migration guidance to make sure your audience can use their essential extensions in VS 2022.

How can I expand LSP functionality in my projects?

Check out the new expansion options for LSP when communicating between servers and VS instances.

Extensions are difficult and tedious to write! What tools can help make the experience easier?

Install and use the Visual Studio Community Toolkit!

I’m feeling experimental and want to share my feedback on the future of extension writing.  What should I do?

Try out phase 1 of the out-of-proc extensibility model!

How do I keep track of all these ongoing extensibility developments? 

Bookmark the VSExtensibility repo (aka.ms/vsextensibilityupdates), your hub for all upcoming extensibility-related announcements.  As we embark on this journey toward an improved extensibility experience, don’t forget to share your feedback under Issues!

6 comments

Leave a comment

  • Ingram, Greg

    I wonder if it would be appropriate to state the Community Toolkit is somewhat a short/mid-term solution and not built around the new extensibility model. Not saying the toolkit shouldn’t be used (I’ve contributed and is very useful). However, I can see peeps complaining in the future on having to use/learn something new when it comes to VS extensibility and wouldn’t want to give the impression the toolkit is the long-term path.

    • Leslie RichardsonMicrosoft employee

      You’re correct Greg. The toolkit exists now to help fix a bunch of issues with the existing VSSDK. As the new extensibility model should fix most of these issues as it evolves and will eventually take over from the VSSDK/toolkit by the time it reaches GA. There is likely going to be similarities between the new model’s API and the toolkit to help make that transition to the new model easier.

  • Vincent Thorn

    How is that possible that you have “hard-to-discover, dated APIs, inconsistent, inaccurate documentation” (where I agree!!) and “current extensibility model is NOT deprecated”?! Original VS API is ugly, inconvenient, unobvious, restricted… simply made by dilettants. How long you’ll pull this rubbish over VS versions? What a stupid idea to keep “compatibility with outdated rubbish”! Just make new, clean, flexible API, what can be more obvious?? You KEEP BACK a whole industry, keeping old, outdated API.

    • Piotr Karczmarz

      It’s pretty simple. You cannot deprecated API that is more than decade old which is used by thousands of plugins (at least 11089 or more) that are deeply integrated with the old API. This transition cannot happen overnight. VS special powers are extensions. VS cannot exists without extensions.

      Transition phase is a must. Two APIs models will coexists for some time. This is why VS Team is trying their best to provide smooth transition path that will take years to fully complete. There is a high chance that those two APIs models will be still present in VS 2024. Maybe in VS 2026 the old API will be finally deprecated. This is how software is made when you have millions of active users. The luxury of starting big project from scratch is really rare environment and happens once in a decade (more or less).

      What about trying the new API and checking how it compares with the current one ? There are even a tutorial already how to write your first extension using new API.

    • Jorge Morales Vidal

      Why are you complaining about the VS API and not helping to test the new model to write extensions? Your comment looks like something a troll would write and not what a community person would say in this situation. No need to use that style and screaming with all caps here. Please stop.