-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Reorder open statements #42
Comments
Presumably into alphabetical order. |
Removing unused ones would be a nice extra, but I'm guessing it's much harder to implement, and alphabetical sort would be already very good |
Sorting open statements is easy but removing unused ones is difficult. The latter requires a type-checking phase which hasn't been implemented in Fantomas yet. I think the feature is in the scope of fsharp-refactor. |
Removing duplicates will be useful. |
This was already done in #51 |
We can add special treatments for open declarations in |
What if there are comments between the open declarations? Before I disabled this feature, this:
Was being turned to this:
Is this acceptable or should we output this instead?
I'm gessing your proposed solution would output this:
Maybe this case is rare enough that even if we don't get it exactly right it's ok. |
Yes, we are more likely to arrive at the last example. The second one is of course ideal. I will try to improve TokenMatcher and see how far we can go. |
@dsyme What do you suggest on this? It seems we can't reorder open statements without losing some comments around them. |
@dungpa any progres on the TokenMatcher changes? |
Not yet. I will work on that tomorrow. |
It would be nice if fantomas reordered the open statements, similar to the reorder usings functionality in C#
The text was updated successfully, but these errors were encountered: