Skip to content

Commit dee0216

Browse files
isovectormergify[bot]jneira
authored
Don't wildify vars when running beginMetaprogram (#1963)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
1 parent 2915ae9 commit dee0216

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

plugins/hls-tactics-plugin/src/Wingman/GHC.hs

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import TysWiredIn (charTyCon, doubleTyCon, floatTyCon, intTyCon)
3636
import Unify
3737
import Unique
3838
import Var
39+
import Wingman.StaticPlugin (pattern MetaprogramSyntax)
3940
import Wingman.Types
4041

4142

@@ -171,6 +172,7 @@ containsHole :: Data a => a -> Bool
171172
containsHole x = not $ null $ listify (
172173
\case
173174
((HsVar _ (L _ name)) :: HsExpr GhcPs) -> isHole $ occName name
175+
MetaprogramSyntax _ -> True
174176
_ -> False
175177
) x
176178

plugins/hls-tactics-plugin/test/CodeAction/RunMetaprogramSpec.hs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ spec = do
2020
#if __GLASGOW_HASKELL__ >= 808
2121
describe "beginMetaprogram" $ do
2222
goldenTest BeginMetaprogram "" 1 7 "MetaBegin"
23+
goldenTest BeginMetaprogram "" 1 9 "MetaBeginNoWildify"
2324
#endif
2425

2526
describe "golden" $ do
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo v = [wingman||]
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo v = _
2+

0 commit comments

Comments
 (0)