Giter Site home page Giter Site logo

Comments (4)

funnelweb avatar funnelweb commented on July 20, 2024

Would be good to have this

from zarchive-fsharpbinding.

funnelweb avatar funnelweb commented on July 20, 2024

From @migueldeicaza

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>
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.

from zarchive-fsharpbinding.

7sharp9 avatar 7sharp9 commented on July 20, 2024

I did try implementing this some time ago exactly as detailed by @migueldeicaza but found there was no global options and the fsharp formatting was always overridden by default by the text format.

This is low priority in the scheme of things so anyone else please feel free to pick this up.

from zarchive-fsharpbinding.

 avatar commented on July 20, 2024

Closing this since it was opened 3 years ago. It likely still needs to be done but lets open a new issue with up-to-date information

from zarchive-fsharpbinding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.