-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Context-aware ExactPrint grafting for HsExpr (#1489)
* Determine when to use parentheses in graft * Cleanup the ExactPrint changes * Better comment on needsParensSpace * Add lambda layout test * Import code action put the import in a stupid place :( * Make graft a method so it can delegate to graftExpr
- Loading branch information
Showing
11 changed files
with
131 additions
and
25 deletions.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test :: Bool -> IO () | ||
test b = do | ||
putStrLn "hello" | ||
_ | ||
pure () | ||
|
8 changes: 8 additions & 0 deletions
8
plugins/hls-tactics-plugin/test/golden/LayoutBind.hs.expected
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test :: Bool -> IO () | ||
test b = do | ||
putStrLn "hello" | ||
case b of | ||
False -> _ | ||
True -> _ | ||
pure () | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test :: Bool -> Bool | ||
test b = id $ _ | ||
|
5 changes: 5 additions & 0 deletions
5
plugins/hls-tactics-plugin/test/golden/LayoutDollarApp.hs.expected
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test :: Bool -> Bool | ||
test b = id $ (case b of | ||
False -> _ | ||
True -> _) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test :: Bool -> Bool | ||
test = \b -> _ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test :: Bool -> Bool | ||
test = \b -> case b of | ||
False -> _ | ||
True -> _ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test :: Bool -> Bool | ||
test b = True && _ |
4 changes: 4 additions & 0 deletions
4
plugins/hls-tactics-plugin/test/golden/LayoutOpApp.hs.expected
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
test :: Bool -> Bool | ||
test b = True && (case b of | ||
False -> _ | ||
True -> _) |