Skip to content

Support end_of_line and insert_final_newline settings in dotnet-format #33468

@warrenseine

Description

@warrenseine

Version Used: Git master (c4bd5b2)

Steps to Reproduce:

  1. Create a project with a simple class
  2. Indent with 4 spaces, set line endings to LF, and remove last newline.
  3. Add an .editorconfig file with the following configuration:
[*.{cs,csx,vb,vbx}]
indent_size = 2
end_of_line = crlf
insert_final_newline = true

Expected Behavior:
2-space indent, new line at the end of the class and CRLF line endings.

Actual Behavior:
Just 2-space indent.

While dotnet-format output changes depending on EditorConfig settings like indent_size, it doesn't seem to respect end_of_line or insert_final_newline. I don't really understand why because Roslyn apparently reads these settings.

Where should I start looking if I wanted to contribute support for these?

I've seen feature requests like #20356 and #18934, but both target Roslyn (not dotnet-format itself), and were closed.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEFeature RequestIDE-FormatterCode formatter and/or smart indenthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    No type

    Projects

    Status

    Complete

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions