File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
ghcide/src/Development/IDE/Spans Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import System.FilePath
33
33
34
34
import Language.LSP.Types (filePathToUri , getUri )
35
35
import qualified Data.Map as Map
36
+ import Development.IDE.Types.Diagnostics (FileDiagnostic )
36
37
37
38
mkDocMap
38
39
:: HscEnv
@@ -68,11 +69,14 @@ getDocumentationTryGhc env mod n = head <$> getDocumentationsTryGhc env mod [n]
68
69
69
70
getDocumentationsTryGhc :: HscEnv -> Module -> [Name ] -> IO [SpanDoc ]
70
71
getDocumentationsTryGhc env mod names = do
71
- res <- catchSrcErrors (hsc_dflags env) " docs " $ ( fmap . fmap ) snd $ fmap Map. toList $ getDocsBatch env mod names
72
+ res <- fun
72
73
case res of
73
74
Left _ -> return []
74
- Right res -> zipWithM unwrap res names
75
+ Right res -> zipWithM unwrap ( fmap snd res) names
75
76
where
77
+ fun :: IO (Either [FileDiagnostic ] [(Name , Either String (Maybe HsDocString , Map. Map Int HsDocString ))])
78
+ fun = catchSrcErrors (hsc_dflags env) " docs" $ Map. toList <$> getDocsBatch env mod names
79
+
76
80
unwrap (Right (Just docs, _)) n = SpanDocString docs <$> getUris n
77
81
unwrap _ n = mkSpanDocText n
78
82
You can’t perform that action at this time.
0 commit comments