-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Sunset setting ReorderOpenDeclaration
#645
Labels
Comments
|
Ok, I would approach this somewhat gradual:
|
nojaf
added a commit
to nojaf/fantomas
that referenced
this issue
Jan 31, 2020
nojaf
added a commit
that referenced
this issue
Feb 1, 2020
This was referenced Feb 28, 2020
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The feature
ReorderOpenDeclaration
introduces a problem when two namespaces expose the same function.For example
After formatting it becomes
The problem here is that
Program.withReactBatched
was used from theElmish.HMR
namespace initially but after formatting, it usesElmish.React
.Another problem with reordering is trivia, consider the following example:
after formatting this becomes:
The comment is still linked to the first open statement after sorting, however, if the comment says something meaningful about the other statement that is now shuffled.
On top of my head, I don't see any way to resolve the first problem.
It will most likely be possible to change to solve the trivia case.
I'm in favour of dropping the functionality all together as it can lead to code not compiling anymore and might not fully be the responsibility of a code formatter.
Thoughts and opinions @jindraivanek?
Repro code
Fantomas online and second case
The text was updated successfully, but these errors were encountered: