File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
ghcide/src/Development/IDE/Spans Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -72,16 +72,14 @@ getDocumentationsTryGhc env mod names = do
72
72
res <- fun
73
73
case res of
74
74
Left _ -> return []
75
- Right res -> zipWithM unwrap ( fmap snd $ Map. toList res) names
75
+ Right res -> sequenceA $ unwrap <$> Map. toList res
76
76
where
77
77
fun :: IO (Either [FileDiagnostic ] (Map. Map Name (Either String (Maybe HsDocString , Map. Map Int HsDocString ))))
78
78
fun = catchSrcErrors (hsc_dflags env) " docs" $ getDocsBatch env mod names
79
79
80
- unwrap (Right (Just docs, _)) n = SpanDocString docs <$> getUris n
81
- unwrap _ n = mkSpanDocText n
82
-
83
- mkSpanDocText name =
84
- SpanDocText [] <$> getUris name
80
+ unwrap :: (Name , Either a (Maybe HsDocString , b )) -> IO SpanDoc
81
+ unwrap (name, Right (Just docs, _)) = SpanDocString docs <$> getUris name
82
+ unwrap (name, _) = SpanDocText [] <$> getUris name
85
83
86
84
-- Get the uris to the documentation and source html pages if they exist
87
85
getUris name = do
You can’t perform that action at this time.
0 commit comments