{"id":251397,"date":"2024-11-19T07:28:38","date_gmt":"2024-11-19T15:28:38","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=251397"},"modified":"2024-11-19T07:28:38","modified_gmt":"2024-11-19T15:28:38","slug":"visualstudio-extensibility-17-12-codelens-support-is-here","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/visualstudio-extensibility-17-12-codelens-support-is-here\/","title":{"rendered":"VisualStudio.Extensibility 17.12: CodeLens support is here!"},"content":{"rendered":"<p>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.<\/p>\n<p>This 17.12 release builds on our\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/visualstudio-extensibility-17-11-settings-and-more-remote-ui-support\/\">previous<\/a>\u00a0releases and brings support for CodeLens in the editor. We&#8217;ve also addressed feedback from early users and revamped the output window API to make it easier to use.<\/p>\n<p><div  class=\"d-flex justify-content-left\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/learn.microsoft.com\/visualstudio\/extensibility\/visualstudio.extensibility\/visualstudio-extensibility?view=vs-2022\" target=\"_blank\">Get Started with VisualStudio.Extensibility<\/a><\/div><\/p>\n<p>For the latest up-to-date docs and installation instructions, visit <a href=\"https:\/\/aka.ms\/VisualStudio.Extensibility\" target=\"_blank\" rel=\"noopener\">https:\/\/aka.ms\/VisualStudio.Extensibility<\/a>. We encourage you to report bugs and suggest features via the <a href=\"https:\/\/aka.ms\/VisualStudio.Extensibility\/Issues\" target=\"_blank\" rel=\"noopener\">issue tracker<\/a> on our <a href=\"https:\/\/aka.ms\/VisualStudio.Extensibility\/Repo\" target=\"_blank\" rel=\"noopener\">GitHub repo<\/a>, where you can also find extension <a href=\"https:\/\/aka.ms\/VisualStudio.Extensibility\/Samples\" target=\"_blank\" rel=\"noopener\">samples<\/a> to help you get started.<\/p>\n<h2>What\u2019s new for VisualStudio.Extensibility?<\/h2>\n<p>Our 17.12 release of VisualStudio.Extensibility includes the following features:<\/p>\n<ul>\n<li>Customized CodeLens experience in the Visual Studio editor by adding your own CodeLens provider (currently released as experimental API)<\/li>\n<li>Revamped output window API for better discoverability and ease of use<\/li>\n<li>Additional diagnostics information for debugging VisualStudio.Extensibility extensions<\/li>\n<\/ul>\n<p>As with previous releases, we continuously update our <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/extensibility\/visualstudio.extensibility\/visualstudio-extensibility?view=vs-2022\">documentation<\/a> 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 <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/extensibility\/visualstudio.extensibility\/extensibility-models?view=vs-2022\">guide<\/a> explains why VisualStudio.Extensibility is the ideal choice for those new to writing extensions.<\/p>\n<h2>Provide your own CodeLens experience<\/h2>\n<p>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.<\/p>\n<p>Check out this <a href=\"https:\/\/github.com\/microsoft\/VSExtensibility\/tree\/main\/New_Extensibility_Model\/Samples\/CodeLensSample\">sample<\/a> 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!<\/p>\n<p><img decoding=\"async\" width=\"1345\" height=\"285\" class=\"wp-image-251399\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica.png 1345w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-300x64.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-1024x217.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-768x163.png 768w\" sizes=\"(max-width: 1345px) 100vw, 1345px\" \/><\/p>\n<p>To get started on creating your own CodeLens provider, please review our documentation <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/extensibility\/visualstudio.extensibility\/editor\/editor?view=vs-2022#extending-visual-studio-editor-with-a-new-code-lens\">here<\/a>. 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.<\/p>\n<h2>Access the output window with ease<\/h2>\n<p>During 17.12, we revamped the APIs for writing to Visual Studio\u2019s 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\u2019ve been working on the new model, we\u2019ve 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, <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.io.textwriter?view=net-8.0\">TextWriter<\/a>, or <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.io.pipelines.pipewriter?view=net-8.0\">PipeWriter<\/a>. Check out the updated <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/extensibility\/visualstudio.extensibility\/output-window\/output-window?view=vs-2022\">docs<\/a> and <a href=\"https:\/\/github.com\/microsoft\/VSExtensibility\/tree\/main\/New_Extensibility_Model\/Samples\/OutputWindowSample\">sample<\/a> to see how you can utilize the new and improved APIs!<\/p>\n<p>Given that these original APIs were marked as preview, we changed them in accordance with our <a href=\"https:\/\/github.com\/microsoft\/VSExtensibility\/blob\/main\/docs\/experimental_apis.md\">preview API<\/a> guidance. For more information about breaking changes, refer to the <a href=\"https:\/\/github.com\/microsoft\/VSExtensibility\/blob\/main\/docs\/breaking_changes.md#Guidance-and-Expectations-Around-Breaking-Changes\">Breaking Changes article<\/a>.<\/p>\n<h2>Debug your extensions more easily<\/h2>\n<p>With this release, we\u2019ve also updated the diagnostics explorer to better assist you in debugging VisualStudio.Extensibility extensions. We separated the diagnostics pages into 2 groups \u2013 extension centric and platform centric. This separation makes it simpler to find information specific to your extension versus information that\u2019s about the underlying Visual Studio platform to get more contextual data.<\/p>\n<p><img decoding=\"async\" width=\"1027\" height=\"825\" class=\"wp-image-251400\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-1.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-1.png 1027w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-1-300x241.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-1-1024x823.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-a-computer-description-automatica-1-768x617.png 768w\" sizes=\"(max-width: 1027px) 100vw, 1027px\" \/><\/p>\n<p><img decoding=\"async\" width=\"813\" height=\"819\" class=\"wp-image-251401\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag.png\" alt=\"A screenshot of extension specific diagnostics pages\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag.png 813w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag-298x300.png 298w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag-150x150.png 150w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag-768x774.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag-24x24.png 24w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag-48x48.png 48w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/11\/a-screenshot-of-extension-specific-diagnostics-pag-96x96.png 96w\" sizes=\"(max-width: 813px) 100vw, 813px\" \/><\/p>\n<p>Our <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/extensibility\/visualstudio.extensibility\/diagnostics\/visualstudio-extensibility-diagnostics-extension?view=vs-2022\">documentation<\/a> goes into detail on what each of these pages provide. You can download the latest version of the diagnostics explorer from the Marketplace <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vsext.VisualStudio-Extensibility-Diagnostics-Explorer\">here<\/a>.<\/p>\n<h2>We want to hear from you!<\/h2>\n<p>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 <a href=\"http:\/\/aka.ms\/VisualStudio.Extensibility\">documentation<\/a> on how to use the APIs, as well as <a href=\"https:\/\/www.youtube.com\/playlist?list=PLReL099Y5nRc6m-CLanAhWGO3_7DD_1Nu\">media content<\/a> 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:<\/p>\n<ul>\n<li>GitHub: Our GitHub <a href=\"https:\/\/github.com\/microsoft\/VSExtensibility\">page<\/a> 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\u2019t 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\u2019s questions. That can only happen if more extenders adopt VisualStudio.Extensibility to build their extensions.<\/li>\n<li>Developer Community: We primarily use <a href=\"https:\/\/developercommunity.visualstudio.com\/home\">Developer Community<\/a> to track feature requests. Occasionally, we\u2019ll 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 <a href=\"https:\/\/developercommunity.visualstudio.com\/VisualStudio?q=%5BVisualStudio.Extensibility%5D&amp;ftype=idea\">current list of feature requests<\/a> for VisualStudio.Extensibility and upvote any most relevant to your scenarios.<\/li>\n<\/ul>\n<p>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\u2019s always top of mind for us.<\/p>\n<p>Stay connected with the Visual Studio team by following us on <a href=\"https:\/\/www.youtube.com\/@visualstudio\" target=\"_blank\" rel=\"noopener\">YouTube<\/a>, <a href=\"https:\/\/twitter.com\/VisualStudio\" target=\"_blank\" rel=\"noopener\">Twitter<\/a>, <a href=\"https:\/\/www.linkedin.com\/showcase\/microsoft-visual-studio\/\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a>, <a href=\"https:\/\/www.twitch.tv\/visualstudio\" target=\"_blank\" rel=\"noopener\">Twitch<\/a> and on <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/?view=vs-2022\" target=\"_blank\" rel=\"noopener\">Microsoft Learn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":8002,"featured_media":251402,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1388,155],"tags":[1382,294,6815],"class_list":["post-251397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-extensibility","category-visual-studio","tag-codelens","tag-extensions","tag-visual-studio-2022"],"acf":[],"blog_post_summary":"<p>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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/251397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/8002"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=251397"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/251397\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/251402"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=251397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=251397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=251397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}