-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create EndOfLine option #295
base: master
Are you sure you want to change the base?
Conversation
What's keeping this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
src/XamlStyler/DocumentProcessors/SignificantWhitespaceDocumentProcessor.cs
Show resolved
Hide resolved
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? 🙂 |
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: