Hi,

I wanted to release the files earlier, but I forgot. Anyway, here it is. You can download the fsharp-mode on Sourceforge: [link:sourceforge.net].

Features:
- Syntax highlighter (adapted from the caml-mode)
- Interactive F# mode (adapted from the caml-mode)
- Indentation (adapted from Python mode)

It's far from perfect, but I enjoy it. Feel free to contribute, there are still many things to do (e.g. send line numbers to fsi to get relevant locations on errors).

Yes, there's no completion or real-time type checking like in Visual Studio. But you have a better indentation than in VS. :)

I think this will be useful for Emacs-fans and Unix users. Please tell me if you plan to use it, if you want to contribute or if you have problems during "installation". Please do not report bugs, except if you have patches. :)

PS: Intellisense is great in VS. There's no such feature in fsharp-mode. If you need to know which methods are available, you can use introspection in fsi. For example (you can improve it to see parameters type, return type, if the method is static, etc.):

1
2
3
4
5
6
let view_methods<'a>() =

    [for i in typeof<'a>.GetMethods() -> i.Name]


view_methods<int>()

Laurent.

By on 4/23/2008 3:10 PM ()

This also works on object instances:

1
2
 let dm (o:obj) =
    [for i in o.GetType().GetMethods() -> i.Name]

However, this requires casting to obj at the call site:

1
2
let rootDir = new System.IO.DirectoryInfo( "C:\\" );
dm( rootDir :> obj )

Not sure why the following does not work, though:

1
2
 let dm (o:#obj) =
    [for i in o.GetType().GetMethods() -> i.Name]

F:\test.fsx(4,14): error FS0072: Lookup on object of indeterminate type. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved

By on 5/15/2008 8:19 PM ()

You can use this:

1
2
let dm o =
    [for i in (o :> obj).GetType().GetMethods() -> i.Name]

Or:

1
2
let dm<'a> (o: 'a) =
    [for i in typeof<'a>.GetMethods() -> i.Name]
By on 5/16/2008 4:42 AM ()

Laurent,

Is there any way to list all symbols in a namespace? I just got lost in .NET reflection libs trying to find a way to do it. Because if so, then Emacs can perhaps run some of the above code in the background to enable completion (well not dynamic kind with type inference, but at least when you give it the types as System.Data... and then ask to complete).

Thanks,

--Anton

By on 11/14/2008 12:21 PM ()

Did this go away? I tried to check out the files from svn, but there's nothing in

1
svn co https://fsharp-mode.svn.sourceforge.net/svnroot/fsharp-mode
By on 11/2/2009 7:02 AM ()

Hi,

The files are not in svn yet. The only thing you can get is the zip file.

I can set up the svn if some people want to commit stuff. Will you be interested?

(btw, I have two patches for the F# mode, I'll try to update the source code soon)

By on 11/2/2009 1:24 PM ()

Hi,

The files are not in svn yet. The only thing you can get is the zip file.

I can set up the svn if some people want to commit stuff. Will you be interested?

(btw, I have two patches for the F# mode, I'll try to update the source code soon)

I'd be interested, but I'm not sure how much use I'd actually be. I haven't written elisp for a decade or so.

By on 11/5/2009 5:59 PM ()

I've just added the files to the Sourceforge SVN. Just send me a message on Sourceforge , so that I can give you writing accesses (there should be a "Send a request to join this project" button).

By on 11/8/2009 1:49 PM ()

There's a .Net and C# mode for emacs I recently stumbled upton: [link:www.emacswiki.org]

I dunno... maybe of help to gain some .Net completions because with Mono supporting .Net 3.5 there're many libs.

By on 11/5/2009 1:37 PM ()

Thanks, this is much appreciated!

By on 5/15/2008 5:35 PM ()

I'm using a slightly modified tuareg mode. Even though I can's speak elisp, it's not difficult to persuade tuareg to cooperate with fsharp. Sure it's far from perfect, but roughly working.

On the other hand, is there any hope to get some VS features such as code completion and type hints on emacs? Pure syntactic analysis surely won't work. How does lisp modes such as slime acheive this? external agent plus communication protocol?

By on 11/17/2007 8:35 AM ()

Hi,

The main goal is to have a clean mode for F#, with coloration, indentation and interactive mode. I don't expect to get advanced VS features. Emacs has several advantages compared to VS: it's free, it's light and fast, it's cross-platform. I guess people using Unix will be happy to have an F#-mode. Moreover, many people already use Emacs with other languages (e.g. it's one of the best editors for OCaml), so that won't need to learn/get a new editor if they try F#.

Thanks for the comments. I still haven't started, but I'll write here when I have things working.

Laurent.

By on 11/19/2007 1:12 PM ()

I think it is a great idea, especially because now F# is getting a different syntax than Caml. I think that a look to Python mode may be helpful to get the right indentation. However just syntax highlight and indentation would be very helpful. I hope to spare enough time to contribute, though it is not a promise...

Antonio

By on 11/12/2007 5:52 AM ()
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