Giter Club home page Giter Club logo

Comments (11)

dungpa avatar dungpa commented on July 19, 2024

The rationale behind this is:

  • You can merge two lines of record files into one without inserting ;
  • It's safer. The code can still be parsed if indentation is slightly off or there are some comments being inserted.
  • I did this due to my subjective view

@dsyme What do you think about this?

from fantomas.

ovatsus avatar ovatsus commented on July 19, 2024

In C# I always leave trailing commas in enums and object initializers because of the first reason you gave, but in F# for some reason I don't like trailing semi colons. I usually split list expressions into multiple lines (unless it's a very small list) just to not have to put them. Maybe it's just a semicolon trauma :)

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

I'm convinced. Will update accordingly.

from fantomas.

 avatar commented on July 19, 2024

I sent @dungpa an email about the formatting defaults. I recommended
* 4 space indent by default, and make this an adjustable option
* Space Before Colon false
* Semicolon at End of Line false

from fantomas.

ovatsus avatar ovatsus commented on July 19, 2024

It would also be nice if fantomas could detect the number of space indents being used in each file, similar to what sublime test does. I usually use 4 spaces, but Tomas likes to use 2 in FSharp.Data, so I'll probably be doing a lot of switching

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

About indent size, it is adjustable but in another dialog http://msdn.microsoft.com/en-us/library/ms165330(v=vs.80).aspx

It's the way Ivan implemented in the initial version. I think it is reasonable and consistent with VS editors.

from fantomas.

 avatar commented on July 19, 2024

Oh I see. Hmmm... I personally use "2 space" for the TAB [ actually I mean Indent ] setting in Visual Studio, but actually indent F# code by 4 spaces. This means I use TAB twice to indent the 4 spaces. But that's not what most people will be doing, so what you have makes sense.

I'll try switching to 4 space TAB [ actually I mean Indent ] settings when using Fantomas.

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

No. You just need to change "Indent size" option to 4 and keep Tab size to be 2. I don't know how Indent size and Tab size interplay in VS editors.

from fantomas.

 avatar commented on July 19, 2024

Right, where I said "TAB" I meant to say "Indent". The TAB size setting in Visual Studio is essentially irrelevant for F# code.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

In MonoDevelop Im in the middle I always use three spaces :)

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

Steps to fix if anyone would like to handle this issue:

from fantomas.

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.