Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you organise F# code in a similar way to C# regions? [closed]

Tags:

Is there a feature equivalent to C#'s regions for being able to group code into named blocks and collapse and expand them?

Alternatively, are there any workarounds or third party tools available to achieve the same result?

like image 419
dayanruben Avatar asked Mar 29 '12 14:03

dayanruben


2 Answers

One possible workaround might be using F# Outlining VS Extension that provides //#region outlining functionality. I use it with VS2010 for couple of months without any problems and find it very convenient:

[-]//#region Region Name    --lines of F# code--    --lines of F# code--    --lines of F# code--    //#endregion 

with one click collapses to

[+]Region Name 

and back.

like image 163
Gene Belitski Avatar answered Oct 22 '22 13:10

Gene Belitski


I found times ago (out of mine curiosity) the link the was searching on for asking this question.

If you look at Regions and navigation bar for F# in Visual Studio the guy seems implemented an experimental feature. Post of firsts of 2012, so it's pretty fresh stuff.

Should say that I didn't try it till now.

Good luck.

like image 26
Tigran Avatar answered Oct 22 '22 12:10

Tigran