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)
484
484
(col (getLoc fun_id) - col (getLoc bind))
485
485
in Just $ pure localBinding
486
486
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
490
497
_ -> Nothing
491
498
where
492
499
col = srcSpanStartCol . realSrcSpan
493
500
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
-
499
501
findSigIds :: GenLocated l (Sig GhcRn ) -> [IdP GhcRn ]
500
502
findSigIds (L _ (TypeSig _ names _)) = map unLoc names
501
503
findSigIds _ = []
You can’t perform that action at this time.
0 commit comments