Create EndOfLine option#295
Conversation
|
What's keeping this? |
grochocki
left a comment
There was a problem hiding this comment.
Thank you for your contribution! I am suggesting a slightly different approach that follows a pattern more similar to how we handle IndentSize that I would be interested in your feedback on.
| [Category("Misc")] | ||
| [RefreshProperties(RefreshProperties.All)] | ||
| [Description("Defines end of line character. Specify 'lf' or 'crlf'; otherwise, default character of the host will be used.")] | ||
| [JsonProperty("EndOfLine", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] |
There was a problem hiding this comment.
For consistency with Visual Studio, can we call this "LineEndings"?
| [Description("Defines end of line character. Specify 'lf' or 'crlf'; otherwise, default character of the host will be used.")] | ||
| [JsonProperty("EndOfLine", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] | ||
| [DefaultValue("")] | ||
| public string EndOfLine |
There was a problem hiding this comment.
Instead of exposing this setting in the UI at all, I am wondering if this setting should follow the pattern of UseVisualStudioIndentSize/IndentSize (i.e., do not expose in settings UI, but still allow IDE to be overwritten in config file)?
Though, in this case, we wouldn't need UseVisualStudioLineEndings because we don't need to look it up from the XAML editor properties. Instead, if LineEndings is unset in a configuration file, NewLine is set to Environment.NewLine (current behavior), but then it could be overwritten. Instead of accepting a string, follow pattern of options like AttributeIndentationStyle and create an enum with: CRLF, LF, CR.
|
@grochocki, all issues are resolved apart from end-of-line vs line-ending. I'm cool with whatever you decide. Do you have a suggestion on automated testing for this PR? |
|
@grochocki would it be possible to merge this soon? |
|
I'm also very interested in this. Is any help needed? @grochocki are there any blockers? 🙂 |
|
@grochocki , it's almost been 5 years. We can't make use of your tool without being forced into crlf for Windows. Could you please merge this? |
|
Very useful option. May I ask what is preventing this PR from being merged? |
|
Man, just merge it :) |

Description:
Add styler option end-of-line ( lf | crlf ) to force specific line endings
xstyler -p -r -d WPF -l Minimal --end-of-line lf
Partially fixes #285
Checklist: