F# addin for MonoDevelop: defaults

57 views
Skip to first unread message

Miguel de Icaza

unread,
Dec 10, 2012, 3:55:28 PM12/10/12
to fsharp-o...@googlegroups.com, Michael Hutchinson
Hey guys,

Is there a reason why the F# addin does not have its own configuration for "Convert Tabs to Spaces"?   

I would rather not have to set this globally, and luckily, MonoDevelop allows this to be set on a per-file type basis.

What you need to do is register a formatting setting for F# files.

To do this, you need to register a PolicySet for the F# mime type, you can see how the C# one does this for various styles here:

monodevelop/main/src/addins/CSharpBinding/CSharpBinding.addin.xml

And it looks like this:

        <Extension path = "/MonoDevelop/ProjectModel/PolicySets/VisualStudio" >
                <Policies resource="FSharpVisualStudio.xml" />
        </Extension>

And then ship a FSharpVisualStudio.xml one, you probably want to copy the style we have in:

monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/MonoCSharpPolicy.xml


Miguel.

Miguel de Icaza

unread,
Dec 10, 2012, 3:57:46 PM12/10/12
to fsharp-o...@googlegroups.com, Michael Hutchinson
Hello guys,

Small update.

Michael tells me that you do not need to define a F# policy type, all you have to do is define a text policy scoped to the  F# mime type:

<TextStylePolicy scope="text/x-fsharp">
        <FileWidth>120</FileWidth>
        <TabWidth>4</TabWidth>
        <IndentWidth>4</IndentWidth>
        <TabsToSpaces>False</TabsToSpaces>
        <NoTabsAfterNonTabs>False</NoTabsAfterNonTabs>
        <RemoveTrailingWhitespace>True</RemoveTrailingWhitespace>
        <EolMarker>Unix</EolMarker>
</TextStylePolicy>

Ben Winkel

unread,
Dec 10, 2012, 6:25:37 PM12/10/12
to fsharp-o...@googlegroups.com, Michael Hutchinson
following up with Miguel and Michael off thread - last time we tried this the policy file seemed to be ignored


--
--
You received this message because you are subscribed to the Google
Groups "FSharp Open Source Community" group.
To post to this group, send email to fsharp-o...@googlegroups.com
To unsubscribe from this group, send email to
fsharp-opensou...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fsharp-opensource?hl=en
 
 
 

Reply all
Reply to author
Forward
0 new messages