I find that I tend to write long source files in F#. Some open source projects in F# also have long source files, e.g. FPersec and F# for excel.
So it would be very helpful if code folding (even very limited support) is available in VS for F#. E.g. in a module, we can fold out functions that are stable, only leave functions that are subject to change unfold.
Is this feature easy to be supported, e.g. by a third party vendor?
Unfortunately, this feature is not available in F# (neither
#region
, nor folding of, for example,let
bindings ortype
declarations as in C#).I would also love to see this in future versions of F# - in fact, I tried writing a prototype of this feature during my internship at MSR, but it was (sadly) more difficult than it looked at first, so the code never reached the production quality and there were many far more important things that the F# team needed to focus on before the VS 2010 release...
Regarding third party support - If it is possible to implement code folding as an addition to the existing F# language service, then it should be possible (simply by looking for some special comments such as
(* #region Some name*)
), but I'm not 100% sure if that can be added by some plugin or macro.Folding of F# code is possible with F# Outlinig Visual Studo extension. I can also recommend to look at F# Depth Colorizer.