1

in c# you have a method dropdown in the top right of the editor window in VS 2012 to show all the methods in a class. Is it possible to have the same in f#? Its hard to follow with lots of methods without one.

Nikos
  • 7,295
  • 7
  • 52
  • 88

1 Answers1

7

I implemented a prototype of this for Visual Studio 2010 during an internship at MSR back in 2009 (or so). It was never properly tested and so it is not enabled by default, but somehow the code stayed there and it can be enabled (in both VS2010 and VS2012) by adding some hidden keys to appSettings in devenv.exe.config. You can also enable collapsing of some definitions:

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

It might work or it might not, but you can give it a try :-). This blog post has some more details.

PS: It was really just an experiment in a week or so (that's why it is so unreliable) as I was mainly working on other things, but I think it might be possible to reimplement this properly as a plugin based on the open-source release of the compiler, in case anyone is interested...

Tomas Petricek
  • 240,744
  • 19
  • 378
  • 553
  • wow, thx ,impressive. Its funny how even typescript has support for this. How can MS expect devs to take f# seriously by omiting this? – Nikos Jan 17 '13 at 01:16
  • 5
    @Nikos - not all devs use that bar, even in C#. Some of us would rather turn it off across the board and have a couple extra lines of code visible on the low-resolution laptop screens our company provides. – Joel Mueller Jan 17 '13 at 02:28
  • 1
    @Nikos Another problem is that the drop downs were designed for C# (and other languages that are essentially the same as C#), but F# has a different programming model - you can use nested modules or even nested functions and these do not really fit into the two-level structure of the drop downs. – Tomas Petricek Jan 17 '13 at 09:31
  • The F# team is listening, though, so if you think this is an important feature, you can vote for it here: http://visualstudio.uservoice.com/forums/121579-visual-studio/category/30935-languages-f- – Tomas Petricek Jan 17 '13 at 09:32
  • @TomasPetricek after your answer I decided that I can live without it 4 now :) – Nikos Jan 17 '13 at 13:11