File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
ghcide/src/Development/IDE Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -965,11 +965,11 @@ getDocsBatch
965
965
:: HscEnv
966
966
-> Module -- ^ a moudle where the names are in scope
967
967
-> [Name ]
968
- -> IO [( Name , Either String (Maybe HsDocString , Map. Map Int HsDocString ))]
968
+ -> IO ( Map. Map Name ( Either String (Maybe HsDocString , Map. Map Int HsDocString )))
969
969
getDocsBatch hsc_env _mod _names = do
970
970
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ traverse findNameInfo _names
971
971
case res of
972
- Just x -> return $ fun x
972
+ Just x -> return $ Map. fromList $ fun x
973
973
Nothing -> throwErrors errs
974
974
where
975
975
fun :: [(Name , Either GetDocsFailure c )] -> [(Name , Either String c )]
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import System.Directory
32
32
import System.FilePath
33
33
34
34
import Language.LSP.Types (filePathToUri , getUri )
35
+ import qualified Data.Map as Map
35
36
36
37
mkDocMap
37
38
:: HscEnv
@@ -67,7 +68,7 @@ getDocumentationTryGhc env mod n = head <$> getDocumentationsTryGhc env mod [n]
67
68
68
69
getDocumentationsTryGhc :: HscEnv -> Module -> [Name ] -> IO [SpanDoc ]
69
70
getDocumentationsTryGhc env mod names = do
70
- res <- catchSrcErrors (hsc_dflags env) " docs" $ (fmap . fmap ) snd $ getDocsBatch env mod names
71
+ res <- catchSrcErrors (hsc_dflags env) " docs" $ (fmap . fmap ) snd $ fmap Map. toList $ getDocsBatch env mod names
71
72
case res of
72
73
Left _ -> return []
73
74
Right res -> zipWithM unwrap res names
You can’t perform that action at this time.
0 commit comments