Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refine should either do intros or split, not both #1842

Merged
merged 3 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions plugins/hls-tactics-plugin/src/Wingman/Tactics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,7 @@ localTactic t f = do


refine :: TacticsM ()
refine = do
try' intros
try' splitSingle
try' intros
refine = intros <%> splitSingle


auto' :: Int -> TacticsM ()
Expand Down
10 changes: 5 additions & 5 deletions plugins/hls-tactics-plugin/test/CodeAction/RefineSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ spec = do
let refineTest = goldenTest Refine ""

describe "golden" $ do
refineTest 2 8 "RefineIntro"
refineTest 2 8 "RefineCon"
refineTest 4 8 "RefineReader"
refineTest 8 8 "RefineGADT"
refineTest 2 8 "RefineIntro"
refineTest 2 8 "RefineCon"
refineTest 4 10 "RefineReader"
refineTest 8 10 "RefineGADT"

describe "messages" $ do
mkShowMessageTest allFeatures Refine "" 2 8 "MessageForallA" NothingToDo
mkShowMessageTest allFeatures Refine "" 2 8 "MessageForallA" TacticErrors

Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ data GADT a where
Two :: GADT Bool

test :: z -> GADT Int
test z = One (\ b -> _)
test z = One _

2 changes: 1 addition & 1 deletion plugins/hls-tactics-plugin/test/golden/RefineGADT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ data GADT a where
Two :: GADT Bool

test :: z -> GADT Int
test = _
test z = _

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
newtype Reader r a = Reader (r -> a)

test :: b -> Reader r a
test b = Reader (\ r -> _)
test b = Reader _

2 changes: 1 addition & 1 deletion plugins/hls-tactics-plugin/test/golden/RefineReader.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
newtype Reader r a = Reader (r -> a)

test :: b -> Reader r a
test = _
test b = _