Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to collapse value/function definitions (F#) in Visual Studio 2008?

Is there a way to "collapse" functions and values in VS2008, like one would do for objects in languages like C#? It's incredibly time-consuming and frustrating to wade through hundreds of lines of nested function definitions.

like image 233
Alexander Avatar asked Dec 29 '22 08:12

Alexander


1 Answers

So, the official answer is that this is not supported. However, when I was doing an internship with the F# team, I wrote a prototype implementation of this feature. Because the F# team had other more important things to do, this was never properly tested and it was not included in the final version.

The code for the feature is actually still present in F# and the feature can be turned on by adding the following to the devenv.exe.config file:

<appSettings>
    <add key="fsharp-regions-enabled" value="true" />
</appSettings>

Apparently, it's not exactly what you wanted, because you can only collapse modules and type definitions, but it could still be useful - it is difficult to decide what to make collapsible in F#, because F# has so many nested declarations...

BTW: Did I mention that this is not tested and it can crash Visual Studio or even collapse the universe?

like image 62
Tomas Petricek Avatar answered Jan 13 '23 11:01

Tomas Petricek