File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
ghcide/src/Development/IDE/Plugin Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -484,18 +484,20 @@ findBindingsQ = something (mkQ Nothing findBindings)
484484 (col (getLoc fun_id) - col (getLoc bind))
485485 in Just $ pure localBinding
486486 PatBind {.. } ->
487- Just $ (everything (<>) $ mkQ [] (fmap (uncurry wb) . maybeToList . findIdFromPat)) pat_lhs
488- where
489- wb id srcSpan = LocalBinding id srcSpan (col srcSpan - col (getLoc pat_lhs))
487+ let wb id srcSpan = LocalBinding id srcSpan (col srcSpan - col (getLoc pat_lhs))
488+
489+ -- | Example: Find `a` and `b` from @(a,b) = (1,True)@
490+ findIdFromPat :: Pat GhcTc -> Maybe (Id , SrcSpan )
491+ findIdFromPat (VarPat _ located) = Just (unLoc located, getLoc located)
492+ findIdFromPat _ = Nothing
493+
494+ findIdsFromPat :: LocatedA (Pat GhcTc ) -> [LocalBinding ]
495+ findIdsFromPat = everything (<>) $ mkQ [] (fmap (uncurry wb) . maybeToList . findIdFromPat)
496+ in Just $ findIdsFromPat pat_lhs
490497 _ -> Nothing
491498 where
492499 col = srcSpanStartCol . realSrcSpan
493500
494- -- | Example: Find `a` and `b` from @(a,b) = (1,True)@
495- findIdFromPat :: Pat GhcTc -> Maybe (Id , SrcSpan )
496- findIdFromPat (VarPat _ located) = Just (unLoc located, getLoc located)
497- findIdFromPat _ = Nothing
498-
499501 findSigIds :: GenLocated l (Sig GhcRn ) -> [IdP GhcRn ]
500502 findSigIds (L _ (TypeSig _ names _)) = map unLoc names
501503 findSigIds _ = []
You can’t perform that action at this time.
0 commit comments