{"id":4771,"date":"2015-08-05T13:28:00","date_gmt":"2015-08-05T13:28:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2015\/08\/05\/guest-post-visual-f-power-tools-community-led-tooling-for-f-in-visual-studio\/"},"modified":"2021-09-30T15:01:34","modified_gmt":"2021-09-30T22:01:34","slug":"guest-post-visual-f-power-tools-community-led-tooling-for-f-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/guest-post-visual-f-power-tools-community-led-tooling-for-f-in-visual-studio\/","title":{"rendered":"[Guest post] Visual F# Power Tools: community-led tooling for F# in Visual Studio"},"content":{"rendered":"<p><em>This is a guest post by <a href=\"https:\/\/twitter.com\/dungpa\" target=\"_blank\" rel=\"noopener\">Anh-Dung Phan<\/a> and <a href=\"https:\/\/twitter.com\/kot_2010\" target=\"_blank\" rel=\"noopener\">Vasily Kirichenko<\/a>, F# community developers and contributors to the superb Visual F# Power Tools extension for Visual Studio.\u00a0 \u2013 Visual F# Team<\/em><\/p>\n<p>We are pleased to tell you about the <strong>Visual F# Power Tools<\/strong>, a Visual Studio extension aimed at providing extended tooling for F# in Visual Studio. You can <a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/136b942e-9f2c-4c0b-8bac-86d774189cff\" target=\"_blank\" rel=\"noopener\">download it today<\/a> from the Visual Studio gallery.<\/p>\n<p>The goal of the extension is to complement the standard Visual Studio F# tooling by adding missing features such as semantic highlighting, rename refactoring, find all references, metadata-as-source, and more.<\/p>\n<p>What\u2019s particularly special about <a href=\"https:\/\/github.com\/fsprojects\/VisualFSharpPowerTools\" target=\"_blank\" rel=\"noopener\">this project<\/a> is that it&#8217;s a collective effort of the F# open source community. We work alongside the Visual F# Team at Microsoft in order to provide a complete toolset for F# users in Visual Studio.<\/p>\n<p>This project is about 1.5 years old now, and has received <a href=\"https:\/\/twitter.com\/brodyberg\/status\/516993057770569729\" target=\"_blank\" rel=\"noopener\">overwhelming<\/a> <a href=\"https:\/\/twitter.com\/the_Crispy\/status\/499260504695930881\" target=\"_blank\" rel=\"noopener\">positive<\/a> <a href=\"https:\/\/twitter.com\/xkrt\/status\/489634545885802496\" target=\"_blank\" rel=\"noopener\">feedback<\/a> from the F# community. Today we are excited to share this effort, and the story behind it, with a broader audience.<\/p>\n<h2>How did it get started?<\/h2>\n<p>There have been some interesting conversations in the F# community, asserting that if F# had better IDE tools in Visual Studio, then it would be a lot easier to learn and adopt the language.<\/p>\n<p>In fact, F# easily has the best IDE support among statically-typed functional languages, through Visual Studio and Xamarin Studio. But the bar has been set extremely high by the C# tooling in Visual Studio (not to mention ReSharper), and as a result many developers expect this same level of support before even considering F#.<\/p>\n<p>While we believe that F# is a superb general-purpose language that can stand out on its own, there is certainly lots of room for improvement in the tooling area. After working on F# <a href=\"http:\/\/activemesa.com\/fsharper\" target=\"_blank\" rel=\"noopener\">ReSharper support<\/a> for <a href=\"https:\/\/github.com\/fsharp\" target=\"_blank\" rel=\"noopener\">a few years<\/a> without success, we finally attempted to do something about the situation.<\/p>\n<p>At the end of January 2014, the Power Tools project got started.<\/p>\n<p>The initial goal was to collect existing F# IDE extensions into a single place for curating and maintaining. At various points in time, extensions for automatic source code formatting, XML doc generation, and depth colorizing had been used in the community, but none were actively maintained.<\/p>\n<p>Around the same time, the <a href=\"http:\/\/fsharp.github.io\/FSharp.Compiler.Service\/\" target=\"_blank\" rel=\"noopener\">FSharp.Compiler.Service<\/a> (FCS) project debuted as a shiny new compiler-as-a-service library for F#.\u00a0 FCS is a Roslyn-like compiler API where all components of the compilation pipeline (e.g. lexer, parser, symbols, typed ASTs, assembly generator) are exposed for programmatic use.<\/p>\n<p>FCS gave us a wonderful opportunity to not only curate existing extensions, but also to add many advanced features.<\/p>\n<p>We took a chance on FCS, and many features were implemented quite naturally.\u00a0 <a href=\"https:\/\/twitter.com\/fspowertools\/status\/463573585911885824\" target=\"_blank\" rel=\"noopener\">This tweet<\/a> sums up our experience from the first three months:<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p dir=\"ltr\" lang=\"en\">3 months, 15 contributors, 700 commits and 5.6k downloads. It has been an amazing journey <a href=\"https:\/\/twitter.com\/hashtag\/fsharp?src=hash\">#fsharp<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/visualstudio?src=hash\">#visualstudio<\/a>.<\/p>\n<p>\u2014 Visual F# PowerTools (@FSPowerTools) <a href=\"https:\/\/twitter.com\/FSPowerTools\/status\/463573585911885824\">May 6, 2014<\/a><\/p><\/blockquote>\n<h2>Where are we?<\/h2>\n<p>Now over a year has passed, and we would like to take stock of where we are, and reflect on some of our most popular features.<\/p>\n<h4>Getting started<\/h4>\n<p>Version 2.0.0 of the extension was just released, and supports Visual Studio 2015 and 2013. In order to install the extension, search for &#8220;F# Power Tools&#8221; in &#8220;Tools -&gt; Extensions and Updates -&gt; Online&#8221;. You can also download it directly from the <a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/136b942e-9f2c-4c0b-8bac-86d774189cff\" target=\"_blank\" rel=\"noopener\">Visual Studio Gallery<\/a>.<\/p>\n<p>The Power Tools offer a variety of features, each of which may or may not suit a particular developer\u2019s preferences, so we provide a dedicated option set to tweak things for your own tastes.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/0714.generaloptions_thumb_64DD5EEC.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"generaloptions\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/0714.generaloptions_thumb_64DD5EEC.png\" alt=\"generaloptions\" width=\"758\" height=\"441\" border=\"0\" \/><\/a><\/p>\n<h4 id=\"semantic-highlighting\">Semantic highlighting<\/h4>\n<p>Similar to what the C# editor does, we colorize F# code based on its semantic structures.<\/p>\n<p>Besides highlighting F# reference types and value types, we also provide color categories for modules, functions, quotations, unused values, and more.<\/p>\n<p>A unique category that has been adopted enthusiastically is one covering all mutable values:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/2783.semantic_highlighting_thumb_24A74572.png\"><img decoding=\"async\" style=\"float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; padding-right: 0px; margin-right: auto; border-width: 0px;\" title=\"semantic_highlighting\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/2783.semantic_highlighting_thumb_24A74572.png\" alt=\"semantic_highlighting\" width=\"331\" height=\"189\" border=\"0\" \/><\/a><\/p>\n<p>Right there, the F# community shows its love for immutability, opting in to bright red alerts for any use of mutable state! We attribute the popularity of this little feature to all the pains we&#8217;ve been through trying to manage the complexity of mutable state in our pre-F# days.<\/p>\n<h4 id=\"find-all-references\">Find all references<\/h4>\n<p>This is one of those features that, once you have it, it&#8217;s really hard to live without.<\/p>\n<p>Place the cursor on any symbol defined in the current solution, hit <code>Shift-F12<\/code>, and boom &#8212; all references with detailed navigation information are displayed:<\/p>\n<blockquote><p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/1055.find_all_references_thumb_330413FB.png\"><img decoding=\"async\" style=\"float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; padding-right: 0px; margin-right: auto; border: 0px;\" title=\"find_all_references\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/1055.find_all_references_thumb_330413FB.png\" alt=\"find_all_references\" width=\"640\" height=\"389\" border=\"0\" \/><\/a><\/p><\/blockquote>\n<p>No more string search or manual browsing in order to look for certain symbols.<\/p>\n<p>Similarly, we have <code>Refactor -&gt; Rename<\/code> for all symbols defined in current solution.<\/p>\n<h4 id=\"navigateto\">NavigateTo<\/h4>\n<p>This is one of our favorite navigational features.<\/p>\n<p>In Visual Studio 2013, there was <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudio\/archive\/2013\/07\/15\/visual-studio-2013-new-editor-features.aspx\" target=\"_blank\" rel=\"noopener\">an important improvement<\/a> where NavigateTo (<code>Ctrl-,<\/code>) started delivering results via a non-modal dialog.<\/p>\n<p>With the Visual F# Power Tools, just type in any identifier you like (or a part of it) and you&#8217;ve got all relevant results from all projects in your solution, ready for quick navigation. It even works seamlessly on mixed F#\/C# solutions:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/3058.navigate_to_thumb_15258FFA.gif\"><img decoding=\"async\" style=\"float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; padding-right: 0px; margin-right: auto; border: 0px;\" title=\"navigate_to\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/3058.navigate_to_thumb_15258FFA.gif\" alt=\"navigate_to\" width=\"640\" height=\"480\" border=\"0\" \/><\/a><\/p>\n<h4>Source code formatting<\/h4>\n<p>Automatic code formatting is a feature long-enjoyed by C# developers, but not offered for F# in Visual Studio.\u00a0 The Power Tools project adds support for source code formatting, along with various options which control the details of adjusted code.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/1727.reformat_thumb_3F736B7E.gif\"><img decoding=\"async\" style=\"float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; padding-right: 0px; margin-right: auto; border-width: 0px;\" title=\"reformat\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/1727.reformat_thumb_3F736B7E.gif\" alt=\"reformat\" width=\"290\" height=\"259\" border=\"0\" \/><\/a><\/p>\n<h4>Resolve unopened namespaces and modules<\/h4>\n<p>Another favorite of C# developers is the ability for the editor to detect when you might have forgotten a \u2018using\u2019 statement.<\/p>\n<p>F# developers can now do the same \u2013 we can offer to add \u2018open\u2019 statements for missing namespaces and modules, or to fully-qualify usages for you:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/7026.addopen_thumb_142ED477.png\"><img decoding=\"async\" style=\"float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; padding-right: 0px; margin-right: auto; border-width: 0px;\" title=\"addopen\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/7026.addopen_thumb_142ED477.png\" alt=\"addopen\" width=\"319\" height=\"156\" border=\"0\" \/><\/a><\/p>\n<h4>Automatic generation of pattern match cases<\/h4>\n<p>Besides filling in IDE features that C# already has, we have additionally added some features that are specific to F#.<\/p>\n<p>One of these is the ability to automatically generate pattern match cases when matching against an F# discriminated union type.\u00a0 The F# type system knows which cases have not been handled, so we can auto-populate those for you:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/1586.patterncase3_thumb_5427C64D.gif\"><img decoding=\"async\" style=\"float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; padding-right: 0px; margin-right: auto; border-width: 0px;\" title=\"patterncase3\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/08\/1586.patterncase3_thumb_5427C64D.gif\" alt=\"patterncase3\" width=\"417\" height=\"197\" border=\"0\" \/><\/a><\/p>\n<p>There are more exciting features that we don\u2019t have time to mention here, so check out <a href=\"http:\/\/fsprojects.github.io\/VisualFSharpPowerTools\/\" target=\"_blank\" rel=\"noopener\">our homepage<\/a> for more detailed documentation.<\/p>\n<h2>What&#8217;s next?<\/h2>\n<p>Recently, a lot of new shiny tools have been created to assist with F# development, matching the growing number of F# developers who want them. There are many opportunities to provide better tooling to F# users by integrating such projects.<\/p>\n<p>For example, we have been using <a href=\"http:\/\/ctaggart.github.io\/SourceLink\/\">SourceLink<\/a>, a .NET library that automates source indexing, to support navigation to source code hosting platforms such as .NET reference sources, GitHub, etc. for external libraries.<\/p>\n<p>We are also working on integrating <a href=\"http:\/\/fsprojects.github.io\/FSharpLint\/\">FSharpLint<\/a>, a style-checking tool for F#.<\/p>\n<p>Another possibility is to improve the experience of using F# Interactive inside Visual Studio. There have been <a href=\"http:\/\/vfpt.uservoice.com\/forums\/247560-general\/suggestions\/6532884-send-code-cell-to-fsi-using-key-combination\">feature requests<\/a> to provide more fine-grained ways to send code to <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dd233175.aspx\" target=\"_blank\" rel=\"noopener\">F# Interactive<\/a>. Some features, like syntax coloring and code completion, could tremendously improve the F# Interactive user experience.<\/p>\n<p>Another area for enhancement is <a href=\"http:\/\/vfpt.uservoice.com\/forums\/247560-general\/suggestions\/5800259-make-find-all-references-rename-refactoring-a\">C# interoperability<\/a>, where our features should be aware of referenced C# projects. If you would like to give this a higher priority, let us know by comments or voting.<\/p>\n<p>There have been some requests to implement more <a href=\"http:\/\/vfpt.uservoice.com\/forums\/247560-general\/suggestions\/5737241-add-extract-method-refactoring\">refactoring features<\/a>. These features are indeed challenging and they require significant involvement of FCS. But of course, they are also fun to implement, just like the feeling we have had since day one of this project.<\/p>\n<p>We are actively seeking contributors. If you would like to join us, you can <a href=\"https:\/\/github.com\/fsprojects\/VisualFSharpPowerTools\/issues?state=open\">report bugs<\/a>, <a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/136b942e-9f2c-4c0b-8bac-86d774189cff\/\">send reviews\/suggestions<\/a>, or, better yet, fork the project and <a href=\"https:\/\/github.com\/fsprojects\/VisualFSharpPowerTools\/issues?labels=up-for-grabs&amp;page=1&amp;state=open\">send pull requests<\/a>.<\/p>\n<p>Together we make F# tooling better, day by day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a guest post by Anh-Dung Phan and Vasily Kirichenko, F# community developers and contributors to the superb Visual F# Power Tools extension for Visual Studio.\u00a0 \u2013 Visual F# Team We are pleased to tell you about the Visual F# Power Tools, a Visual Studio extension aimed at providing extended tooling for F# in [&hellip;]<\/p>\n","protected":false},"author":343,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[73,107,147],"class_list":["post-4771","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","tag-f","tag-open-source","tag-visual-studio"],"acf":[],"blog_post_summary":"<p>This is a guest post by Anh-Dung Phan and Vasily Kirichenko, F# community developers and contributors to the superb Visual F# Power Tools extension for Visual Studio.\u00a0 \u2013 Visual F# Team We are pleased to tell you about the Visual F# Power Tools, a Visual Studio extension aimed at providing extended tooling for F# in [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/4771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/343"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=4771"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/4771\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=4771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=4771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=4771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}