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: This is still on our short list to add to Visual Studio. Until then, the community-built Visual F# Power Tools extension (https://visualstudiogallery.msdn.microsoft.com/136b942e-9f2c-4c0b-8bac-86d774189cff) remains a great way to get these features.
- David Stephens, Visual F# 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.