7

The Future of Visual Studio Extensibility is Here! - Visual Studio Blog

 3 years ago
source link: https://devblogs.microsoft.com/visualstudio/the-future-of-visual-studio-extensibility-is-here/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

The Future of Visual Studio Extensibility is Here!

Leslie

September 9th, 2021

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.

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.

VS Community Toolkit Project Templates

Extension command written with the VS Community Toolkit

VS Community Toolkit Icon IntelliSense

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!

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!

Leslie Richardson

Program Manager, Visual Studio Extensibility

Follow


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK