Skip to content

Commit bf0b4d5

Browse files
committed
Replace maybe with case for better readability
1 parent a6635ca commit bf0b4d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/hls-signature-help-plugin/src/Ide/Plugin/SignatureHelp.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ extractInfoFromSmallestContainingFunctionApplicationAst position hieAsts extract
148148
type Annotation = (FastStringCompat, FastStringCompat)
149149

150150
nodeHasAnnotation :: Annotation -> HieAST a -> Bool
151-
nodeHasAnnotation annotation = sourceNodeInfo >>> maybe False (isAnnotationInNodeInfo annotation)
151+
nodeHasAnnotation annotation hieAst = case sourceNodeInfo hieAst of
152+
Nothing -> False
153+
Just nodeInfo -> isAnnotationInNodeInfo annotation nodeInfo
152154

153155
-- TODO(@linj): the left most node may not be the function node. example: (if True then f else g) x
154156
getLeftMostNode :: HieAST a -> HieAST a

0 commit comments

Comments
 (0)