November 19th, 2024

VisualStudio.Extensibility 17.12: CodeLens support is here!

We continue to invest in the VisualStudio.Extensibility SDK to allow users like you to create extensions that run faster and smoother than ever before! VisualStudio.Extensibility helps you build extensions that run outside the main Visual Studio IDE process for improved performance and reliability, and can be installed without the need to restart Visual Studio. Additional benefits include a sleek and intuitive .NET 8-based API and comprehensive, well-maintained documentation to help you develop amazing extensions faster than ever before.

This 17.12 release builds on our previous releases and brings support for CodeLens in the editor. We’ve also addressed feedback from early users and revamped the output window API to make it easier to use.

For the latest up-to-date docs and installation instructions, visit https://aka.ms/VisualStudio.Extensibility. We encourage you to report bugs and suggest features via the issue tracker on our GitHub repo, where you can also find extension samples to help you get started.

What’s new for VisualStudio.Extensibility?

Our 17.12 release of VisualStudio.Extensibility includes the following features:

  • Customized CodeLens experience in the Visual Studio editor by adding your own CodeLens provider (currently released as experimental API)
  • Revamped output window API for better discoverability and ease of use
  • Additional diagnostics information for debugging VisualStudio.Extensibility extensions

As with previous releases, we continuously update our documentation to reflect the latest features in version 17.12. We have also prepared a comprehensive guide that outlines the three different extensibility models for Visual Studio. This guide explains why VisualStudio.Extensibility is the ideal choice for those new to writing extensions.

Provide your own CodeLens experience

CodeLens is an experience in the Visual Studio editor that allows developers like you to stay focused on your work and get contextual information about your code without ever leaving the editor. Using CodeLens, you can quickly find all references of code or see the pass rate of unit tests. With the release of 17.12, extenders can now create a custom CodeLens on supported languages provided by Visual Studio! CodeLens support in VisualStudio.Extensibility goes beyond what the Visual Studio SDK (VSSDK) offers in that it not only allows for custom UI to be displayed for your CodeLens; it also offers a way for users to interact with your custom CodeLens through invokable CodeLens.

Check out this sample to learn how you can create a custom interactive word counter CodeLens using this new API. The sample extension allows you to define what to search for and count its occurrences in a C# method block, all from the context of CodeLens!

A screenshot of a computer Description automatically generated

To get started on creating your own CodeLens provider, please review our documentation here. CodeLens support is currently released as an experimental API. We welcome questions and suggestions on the API as we work to stabilize it. Note that we currently only allow CodeLenses to be added to existing languages supported by Visual Studio. Stay tuned for when we enable CodeLens support for arbitrary files.

Access the output window with ease

During 17.12, we revamped the APIs for writing to Visual Studio’s output window. The original APIs were one of the first APIs we migrated from VSSDK to VisualStudio.Extensibility and had started to show their age. In the time we’ve been working on the new model, we’ve iterated on the principles of API design and refined them. Looking back at the original output window APIs, we realized that they did not meet our standards for simplicity and ease of use. In the revamp, we abstracted away concepts like resource IDs and channels to provide a simpler interface, and we gave users multiple ways to write to the output window, including writing using string, TextWriter, or PipeWriter. Check out the updated docs and sample to see how you can utilize the new and improved APIs!

Given that these original APIs were marked as preview, we changed them in accordance with our preview API guidance. For more information about breaking changes, refer to the Breaking Changes article.

Debug your extensions more easily

With this release, we’ve also updated the diagnostics explorer to better assist you in debugging VisualStudio.Extensibility extensions. We separated the diagnostics pages into 2 groups – extension centric and platform centric. This separation makes it simpler to find information specific to your extension versus information that’s about the underlying Visual Studio platform to get more contextual data.

A screenshot of a computer Description automatically generated

A screenshot of extension specific diagnostics pages

Our documentation goes into detail on what each of these pages provide. You can download the latest version of the diagnostics explorer from the Marketplace here.

We want to hear from you!

Since embarking on this journey to provide a new extensibility model for Visual Studio, our goal has always been to keep our ecosystem partners engaged. Besides regular blog posts like this one to update our customers of the latest additions to VisualStudio.Extensibility, we also have extensive and up-to-date documentation on how to use the APIs, as well as media content that gives a quick overview of VisualStudio.Extensibility. We also have 2 different channels for customers to interact with us to either report issues or suggest new features:

  • GitHub: Our GitHub page is the primary destination for extenders to ask questions or report issues with respect to creating extensions for Visual Studio. While we try our best to answer questions, we can’t always get to them in real time. Our goal is to eventually have the GitHub page be something that the community can help answer each other’s questions. That can only happen if more extenders adopt VisualStudio.Extensibility to build their extensions.
  • Developer Community: We primarily use Developer Community to track feature requests. Occasionally, we’ll get issues created in our GitHub page that are related to a feature not yet implemented in VisualStudio.Extensibility. Our practice is to then turn that issue into a suggestion ticket and use that ticket to track upvotes and post updates. In our most recent releases, we closed 2 of these suggestion tickets with the implementation of settings last release, and the support for code lens this release. We encourage you to review the current list of feature requests for VisualStudio.Extensibility and upvote any most relevant to your scenarios.

Keep those questions and suggestions coming! There are many things we take into consideration when planning our roadmap, but rest assured that customer feedback is something that’s always top of mind for us.

Stay connected with the Visual Studio team by following us on YouTube, Twitter, LinkedIn, Twitch and on Microsoft Learn.