Wednesday, August 20, 2008

"Ordering experience" for F# project in Monodevelop

F# project team posted snapshots of language integration into VS. I was pleased to see that they included ability to manipulate file's order in the project. So, I decided to extend F# binding for Monodevelop.


I started to look at the way to implement this feature and was surprised by Monodevelop - files in opened project are sorted by name. Thus, no visual representation of any change in file's order inside IDE. Quick solution was to add order number near file name in project pad.


"Ordering experience" is done similar to VS by adding to popup menu "Move up" and "Move down" actions.


Aye, no more project manual editing!


For F# binding (addin) for Monodevelop look project webpage.

Monday, August 11, 2008

F# Addin for Monodevelop

I just finished draft version of F# Addin for Monodevelop. This addin provides support of F# compiler in Monodevelop IDE. You could find new version of Monodevelop in Mono 2.0 Preview. Take a look!





You can find sources and brief documentation here

Saturday, August 9, 2008

Running Monodevelop 2 Alpha on Mac OS X

First preview for Mono 2.0 is released with new Monodevelop version (in alpha state). I did not expect stable work from this release, but was very surprised.

From first look, there was only one annoying bug that could be easily fixed. So, during start up I got window with following error:

Add-in error ():
GLib.GException: Unrecognized image file format
at Gdk.PixbufLoader.Write (System.Byte[] buf, UInt64 count) [0x00000]
at Gdk.PixbufLoader.Write (System.Byte[] bytes, UInt32 count) [0x00000]
at Gdk.PixbufLoader.LoadFromStream (System.IO.Stream input) [0x00000]
at Gdk.PixbufLoader.InitFromStream (System.IO.Stream stream) [0x00000]
at Gdk.PixbufLoader..ctor (System.IO.Stream stream) [0x00000]
at Gdk.Pixbuf..ctor (System.IO.Stream stream) [0x00000]
at MonoDevelop.Core.Gui.ResourceService.OnExtensionChange (System.Object sender, Mono.Addins.ExtensionNodeEventArgs args) [0x00041]
at Mono.Addins.ExtensionNode.add_ExtensionNodeChanged (Mono.Addins.ExtensionNodeEventHandler value) [0x00000]

After a bit of tweaking I found that Gettext Translation Support addin gives this nasty error. By disabling it I resolved bug issue.

Tuesday, August 5, 2008

NAnt extension for F#

I love F#. I am trying to use this language for all my projects. However, as an proud owner of MacBook, it hard to cope with usage of F# under Mono, especially when you have tried F# integration with Visual Studio.

What could be done to ease burden of command line experience? For long time Mono have been using NAnt for automating building process. So, while team from Microsoft is trying to bring F# to production, NAnt extension that could automate building task for F# sounds as helper in command line environment.

Here you can find source code and binary for this extension.

There are several steps in installation process:
  1. Copy binary NAnt.FSharpTask.dll in nant\bin directory

  2. Insert this task description into NAnt.exe.config file under desired framework section:
    <task name="fsc">
    <attribute name="exename">
    c:\Program Files\FSharp-1.9.4.19\bin\fsc.exe
    </attribute>
    </task>
  3. Change exename property to path to your F# compiler
Next step is to configure .build file. Here is small example:

<fsc target="exe" output="HelloWorld.exe" debug="true">

<sources>

<include name="HelloWorld.fs" />

</sources>

<references>

<include name="System.dll" />

</references>

</fsc>

For more information see How to use F# extension for NAnt