Skip to content
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

Editor.config: insert_final_newline is ignored by Fantomas #2002

Closed
auduchinok opened this issue Dec 24, 2021 · 3 comments
Closed

Editor.config: insert_final_newline is ignored by Fantomas #2002

auduchinok opened this issue Dec 24, 2021 · 3 comments

Comments

@auduchinok
Copy link
Contributor

Original issue: RIDER-72601.

What steps will reproduce the issue?

create a fsharp file in rider without a final newline;
create an .editorconfig file with insert_final_newline=false (either as a global setting or specific for *.{fs, fsi, fsx});
format the file

What is the expected result?
Rider does not insert a final newline.

What happens instead?
Rider inserts a final newline.

@nojaf
Copy link
Contributor

nojaf commented Dec 24, 2021

Hi, I'm ok with supporting this.

Perhaps it is as simple as tweaking:

let rec genParsedInput astContext ast =
match ast with
| ImplFile im -> genImpFile astContext im
| SigFile si -> genSigFile astContext si
+> ifElseCtx lastWriteEventIsNewline sepNone sepNln

@nojaf
Copy link
Contributor

nojaf commented Dec 24, 2021

Oh, and the default of this setting should be true to be non-breaking.

@nojaf
Copy link
Contributor

nojaf commented Jan 14, 2022

Available in 4.6

@nojaf nojaf closed this as completed Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants