diff --git a/plugins/hls-tactics-plugin/src/Wingman/GHC.hs b/plugins/hls-tactics-plugin/src/Wingman/GHC.hs index c79711fdb4..3f1dbdbbbc 100644 --- a/plugins/hls-tactics-plugin/src/Wingman/GHC.hs +++ b/plugins/hls-tactics-plugin/src/Wingman/GHC.hs @@ -36,6 +36,7 @@ import TysWiredIn (charTyCon, doubleTyCon, floatTyCon, intTyCon) import Unify import Unique import Var +import Wingman.StaticPlugin (pattern MetaprogramSyntax) import Wingman.Types @@ -171,6 +172,7 @@ containsHole :: Data a => a -> Bool containsHole x = not $ null $ listify ( \case ((HsVar _ (L _ name)) :: HsExpr GhcPs) -> isHole $ occName name + MetaprogramSyntax _ -> True _ -> False ) x diff --git a/plugins/hls-tactics-plugin/test/CodeAction/RunMetaprogramSpec.hs b/plugins/hls-tactics-plugin/test/CodeAction/RunMetaprogramSpec.hs index 2c0e44b5bc..94eb664ab9 100644 --- a/plugins/hls-tactics-plugin/test/CodeAction/RunMetaprogramSpec.hs +++ b/plugins/hls-tactics-plugin/test/CodeAction/RunMetaprogramSpec.hs @@ -20,6 +20,7 @@ spec = do #if __GLASGOW_HASKELL__ >= 808 describe "beginMetaprogram" $ do goldenTest BeginMetaprogram "" 1 7 "MetaBegin" + goldenTest BeginMetaprogram "" 1 9 "MetaBeginNoWildify" #endif describe "golden" $ do diff --git a/plugins/hls-tactics-plugin/test/golden/MetaBeginNoWildify.expected.hs b/plugins/hls-tactics-plugin/test/golden/MetaBeginNoWildify.expected.hs new file mode 100644 index 0000000000..c8aa76e837 --- /dev/null +++ b/plugins/hls-tactics-plugin/test/golden/MetaBeginNoWildify.expected.hs @@ -0,0 +1,2 @@ +foo v = [wingman||] + diff --git a/plugins/hls-tactics-plugin/test/golden/MetaBeginNoWildify.hs b/plugins/hls-tactics-plugin/test/golden/MetaBeginNoWildify.hs new file mode 100644 index 0000000000..2aa2d1caa3 --- /dev/null +++ b/plugins/hls-tactics-plugin/test/golden/MetaBeginNoWildify.hs @@ -0,0 +1,2 @@ +foo v = _ +