Skip to content

Commit 662da22

Browse files
committed
Development.IDE.Core.Compile: getDocsBatch: ([(,)]->Map)
1 parent a06846b commit 662da22

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,11 +965,11 @@ getDocsBatch
965965
:: HscEnv
966966
-> Module -- ^ a moudle where the names are in scope
967967
-> [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)))
969969
getDocsBatch hsc_env _mod _names = do
970970
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ traverse findNameInfo _names
971971
case res of
972-
Just x -> return $ fun x
972+
Just x -> return $ Map.fromList $ fun x
973973
Nothing -> throwErrors errs
974974
where
975975
fun :: [(Name, Either GetDocsFailure c)] -> [(Name, Either String c)]

ghcide/src/Development/IDE/Spans/Documentation.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import System.Directory
3232
import System.FilePath
3333

3434
import Language.LSP.Types (filePathToUri, getUri)
35+
import qualified Data.Map as Map
3536

3637
mkDocMap
3738
:: HscEnv
@@ -67,7 +68,7 @@ getDocumentationTryGhc env mod n = head <$> getDocumentationsTryGhc env mod [n]
6768

6869
getDocumentationsTryGhc :: HscEnv -> Module -> [Name] -> IO [SpanDoc]
6970
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
7172
case res of
7273
Left _ -> return []
7374
Right res -> zipWithM unwrap res names

0 commit comments

Comments
 (0)