Provide refactoring support for F# code.
Currently F# IDE integration into visual studio does not have any refactoring support. It would be nice to at the very least be able to handle renaming.
Update: The Visual F# Power Tools project (http://fsprojects.github.io/FSharpVSPowerTools) is a community-driven project based on the FSharp.Compiler.Service and Fantomas tools. It is available as a Visual Studio gallery entry inn Visual Studio 2012 and 2013.
While it is at an early stage, it contains useful refactoring functionality including some rename refactoring, as well as other functionality, and is seeing significant contribution levels. We encourage community contributions to this project.
This item is being left as “under review”. Possible future paths which could eventually be considered may include migrating functionality from the Visual F# Power Tools to the Visual F# Tools proper, depending on quality levels and other factors.
Don Syme, answering on behalf of the Visual F# Tools Team
Gregory Chernis commented
Updated link for F# Power Tools download: http://visualstudiogallery.msdn.microsoft.com/136b942e-9f2c-4c0b-8bac-86d774189cff
Daniel Fabian commented
Nothing too fancy, but at least renaming is available now through the F# power tools. http://fsprojects.github.io/FSharpVSPowerTools/
Edward Brey commented
Donna, would constrained rename refactoring bring the effort down the manageable? C# refactoring is very forgiving: even if the product doesn't build, you can still use rename and be confident it will do a good job.
But what if you only supported rename refactoring, and only on a solution that builds cleanly? Then the type inference and higher order function complications should go away. The compiler already knows how to identify the statically-typed meaning of each symbol; so as long as enough of Roslyn spills over to F# to bring what the compiler knows into the IDE, replacing the text on the list of symbol locations should be straightforward.
Even if that's all we got - rename for clean solutions - that would be a game changer for using F# on larger projects.
Find usages (references ) in F# does not work. How to manage a large solution? Just search for text?
Tuomas Hietanen commented
Mark Seemann commented
Dear F# product team. This suggestion was reported more than two years ago, and has seen no activity since then.
Currently, it's taking up people's votes. Could you please either accept or decline it, so that we can all move along?
FANG Colin commented
Need "rename" feature
Mauricio Scheffer commented
"Automatic XML comments" are available through this plugin: http://lorgonblog.wordpress.com/2010/12/04/source-code-for-f-xmldoc-extension/
Visual F# should at the very least support basic editor features found in Visual C# such as Semantic Color Highlighting and Automatic XML Comments (type "///" in front of a function and all the appropriate XML tags appear). The absence of these helpers is a tremendous obstacle for its adoption.
Vote on ReSharper too :-)
Rename, introduce variable, extract function -- if I had just these three I'd be happy. In my experience, I do these a lot.
Mikael Kjellqvist commented
Wohoo, i hope the review goes well and the timeframe will be a short one :)
Donna Malayeri (MSFT) commented
This would indeed be a nice feature, and we are considering it for a future release.
However, please note that refactoring in F# (and similar languages) is a much harder problem than in OO languages, since it involves type inference and accounting for heavy use of higher order functions. Refactoring in Scala is also hard to implement (e.g., see http://devnet.jetbrains.net/message/5304630#5304630), and even "rename" in Java has problems! (http://dl.acm.org/citation.cfm?doid=1449955.1449787).
This is not to say it cannot be done for F#, but it is definitely a tricky problem.
Donna Malayeri - MSFT
Visual Studio F# Program Manager
Whether FP or OOP, it's really important to keep readable code.
Refactorings are not that common in FP practice, mostly because functional composition depends more on type signature than name. So I don't think refactoring features are of top priority.
mattias waldau commented
If you compare F# with Scala inside Intellij, there is a huge difference, Scala handles this much better.