Coder Social home page Coder Social logo

Comments (4)

belav avatar belav commented on June 18, 2024

I don't see a good reason to not allow it, it does keep things consistent with other places that allow new lines.

Your example was for an anonymous object, which is a different node than a regular object initializer. But I made changes to allow it in either place + other types of initializers (dictionaries, arrays, etc).

from csharpier.

belav avatar belav commented on June 18, 2024

I take that last part back. Dictionaries and arrays are a bit trickier. This will just be for objects (anonymous or not) for now.

from csharpier.

Qtax avatar Qtax commented on June 18, 2024

Great, thanks! And as you pointed out it would be nice with same behaviour in dictionaries and arrays too.
We just started using csharpier in our project, so just starting to notice some things.

A small possibly related issue with object initializers that I don't really care about that maybe you'd like you know of:

When formatting this (in 0.26.7):

		var foo = new {
			foo = 1,


			// empty lines after a comment are not removed


			bar = 2,
		};

You get this:

		var foo = new
		{
			foo = 1,
			// empty lines after a comment are not removed


			bar = 2,
		};

Would prefer/expect:

		var foo = new
		{
			foo = 1,

			// empty lines after a comment are not removed

			bar = 2,
		};

Or at least that empty lines after comments are treated the same as before.

from csharpier.

belav avatar belav commented on June 18, 2024

The empty lines sticking around after a comment is a known issue I have somewhere in the backlog. I believe it happens with comments anywhere. No one has complained so it hasn't been prioritized yet. Thanks for letting me know!

from csharpier.

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.