-
Notifications
You must be signed in to change notification settings - Fork 152
Merge in ghc-lib-parser patches #307
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
Merged in 250e709, thanks again to everyone involved! |
This was referenced Oct 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an integration PR to merge #293 and the GSOC work. There are still
a number of backwards-incompatible changes that need to be sorted out
before we can fully release this, and I'll keep notes of any significant changes
here.
Changes
I changed the sorting order of imported things back to the following order:
constructors/data types/classes, followed by functions, followed by operators.
I changed the grouping of imports to check for consecutive lines of imports
rather than using comments as separators (but comments should still be
preserved, of course).
The
Imports
step is not taking theglobal
alignment option into account.The printer code seems unequipped to do proper wrapping: it decides
whether or not to print a newline by looking at the current line length, rather
than the hypothetical line length if a comma, space and the next item are
added.
Looking at the printer code, it should be possible to add a combinator along
the lines of:
I think there is still an off-by-one error in the import wrapping code: it
doesn't take the final
,
into account.The style of consecutive lines for a single import has changed from
to:
I'd like to revert the default back to the original but we'll want to retain the
new style as an option. Proposal is to add the new style as
list_align: repeat
.Note that this also involves adding all the other options here that
list_align
supports.
There are many more issues with various combinations of
long_list_align
,list_align
,space_surround
andalign
.The
Align
step is having trouble with many files, for example:The
ModuleHeader
step should allow configuring indentationThe
ModuleHeader
step should allow turning off sortingThe
ModuleHeader
step should use the same sorting order asImports
The
LanguagePragmas
step is still using haskell-src-extsThe
UnicodeSyntax
step is still using haskell-src-extsOpen issues