Comments (4)
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.
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.
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.
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)
- CSharpier Rider plugin mangles UTF-8 characters when running on save HOT 2
- csharpier does not respect editorconfig specific c# rules HOT 2
- Expose IncludeGenerated in CodeFormatterOptions HOT 1
- not support " = []" HOT 5
- Request for support of custom file extensions to scan/fix HOT 1
- [rider] warning about deprecated function HOT 2
- Extensions should show information when file can't be formatted because it doesn't compile.
- charpier do not repect `#pragma warning disable format`
- Third party .editorconfig leading to: Error Failure parsing editorconfig files HOT 1
- Smarter EditorConfig parsing
- dotnet-csharpier process never closes HOT 2
- Umlaute or Currency symbols are not preserved HOT 1
- CSharpier process failed to start (VSCode extension v1.7.0) HOT 2
- Pipe to `dotnet csharpier` fails HOT 5
- Extensions - log when there is a syntax error so csharpier can't format.
- csharpier server and ipv6 HOT 2
- Usings order HOT 3
- Inconsistent formatting HOT 2
- How can I make CSharpier work with Visual Studio? HOT 30
- Comment between attributes violates SA1515 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csharpier.