Maybe I should reformulate the question. What editor or tool do you use to write F# code? And to format/indent it? Thanks [:)]

By on 7/25/2007 1:28 AM ()

Hi there,

I use Visual Studio with 2-space indent and "tab to spaces". I believe you can still get a 180-day free trial of VS from Microsoft, and also there is the SQL Developer Edition for $80 which supports adding the F# plugin. The interactive type checking is also superb. The project system is imperfect, as is being discussed elsewhere in the hub.

The key for formatting F# code in VS is to realize that you can highlight large blocks of code in Visual Studio and press "tab" or "shift-tab" to indent the entire highlighted block in/out. This makes it fairly straight-forward to indent code manually. However some kind of automatic indentation is definitely on the cards.

Kind regards

don

By on 7/25/2007 7:17 AM ()

Resurrecting an old thread. I've found that one of the more frequent bugs I make is misaligning lines when using #light syntax. It's frustrating to spend several hours to find an extra space somewhere, so I'm thinking of using the "non light" syntax.

Can Visual Studio 2008 automatically format non-light code now? For the #light syntax one thing I see that can help to this is implementing of the code folding, but this is another story.

By on 5/9/2009 11:36 AM ()

There is no auto-formatting.

I find the 'guidelines' VS feature very helpful:

[link:blogs.msdn.com]

I use 4-space indentation, and have:

Windows Registry Editor Version 5.00

1
2
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor]
"Guides"="RGB(185,175,175) 4, 8, 12, 16, 20, 24, 28, 80"
By on 5/9/2009 12:21 PM ()

This doesn't work in VS2010, but this is a plugin that works

[link:visualstudiogallery.msdn.microsoft.com]

You still need to set the columns in the registry

1
2
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor]
"Guides"="RGB(185,175,175) 4, 8, 12, 16, 20, 24, 28, 80"
By on 3/16/2011 4:15 AM ()

See also

[link:lorgonblog.wordpress.com]

as another flexible tool for inspecting F# column indents.

By on 3/16/2011 9:50 AM ()

Thanks for the tip, will try it. I really do suffer from accidentally hitting a space while browsing/massaging the code and then spend a lot of time figuring out the bug.

A nice feature, in my opinion, would be a translator between light and non-light syntax. Un-lighting the code will allow IDE to format it so that I can figure out how the compiler parses it. Also it's similar to latex vs word choice - I would prefer writing non-light so that IDE be able to format the code, but would covert it to light for reading/publishing.

Btw, is there any Tuareg/caml custom emacs modes for F# that would allow formating non-light code?

Thanks,

Vlad

By on 5/12/2009 5:58 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper