Skip to content

Commit c853b0b

Browse files
committed
ghcide: Core.Compile: getDocsBatch: use T.Text
1 parent 165ffa4 commit c853b0b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -994,19 +994,19 @@ getDocsBatch
994994
:: HscEnv
995995
-> Module -- ^ a moudle where the names are in scope
996996
-> [Name]
997-
-> IO (Map.Map Name (Either String (Maybe HsDocString, Map.Map Int HsDocString)))
997+
-> IO (Map.Map Name (Either T.Text (Maybe HsDocString, Map.Map Int HsDocString)))
998998
getDocsBatch hsc_env _mod _names = do
999999
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ Map.fromList <$> traverse findNameInfo _names
10001000
case res of
10011001
Just x -> return $ fun x
10021002
Nothing -> throwErrors errs
10031003
where
1004-
fun :: Map.Map Name (Either GetDocsFailure c) -> Map.Map Name (Either String c)
1004+
fun :: Map.Map Name (Either GetDocsFailure c) -> Map.Map Name (Either T.Text c)
10051005
fun =
10061006
Map.map fun1
10071007
where
1008-
fun1 :: Either GetDocsFailure c -> Either String c
1009-
fun1 = first $ T.unpack . showGhc
1008+
fun1 :: Either GetDocsFailure c -> Either T.Text c
1009+
fun1 = first showGhc
10101010

10111011
throwErrors = liftIO . throwIO . mkSrcErr
10121012

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ getDocumentationsTryGhc env mod names = do
7575
Left _ -> return mempty
7676
Right res -> fmap Map.fromList $ sequenceA $ uncurry unwrap <$> Map.toList res
7777
where
78-
fun :: IO (Either [FileDiagnostic] (Map.Map Name (Either String (Maybe HsDocString, Map.Map Int HsDocString))))
78+
fun :: IO (Either [FileDiagnostic] (Map.Map Name (Either T.Text (Maybe HsDocString, Map.Map Int HsDocString))))
7979
fun = catchSrcErrors (hsc_dflags env) "docs" $ getDocsBatch env mod names
8080

8181
unwrap :: Name -> Either a (Maybe HsDocString, b) -> IO (Name, SpanDoc)

0 commit comments

Comments
 (0)