This repository has been archived by the owner on Oct 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 210
Ormolu range format support #1602
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
172e8cf
Ormolu range format
Avi-D-coder 4bb37bf
Fix Ormolu range format edge cases
Avi-D-coder 6153a5a
Move BlockArguments pragma
Avi-D-coder 16a807c
Fix pre 8.6 build
Avi-D-coder 4084859
Get file pragmas from DynFlags
Avi-D-coder 4a13f87
Remove block arguments
Avi-D-coder 02cef7f
Fix Ormolu removing preceding empty line
Avi-D-coder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What user experience does this result in? A pop-up window? This is likely to be a fairly common experience, so should be non-threatening, just a notice.
Another possible approach is to find the enclosing block that can be formatted, and process that. What does the brittany plugin do in this case? I wonder if that logic should be captured in a library, for use in all RangeFormatting requests, so we have a standard behaviour across hie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use nvim and coc so I don't know how it looks to most users. Brittany will often produce an error, in similar situations. The point of this line is just to provide a more helpful error than what we would usually get
unable to parse
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with the message, and its contents. I just want to make sure the end user experience makes sense. But it can be tweaked easily enough, so its not a blocker.