Skip to content

Commit 2bdd7fd

Browse files
committed
ghcide: Core.Compile: getDocsBatch: use T.Text
1 parent 16dbc37 commit 2bdd7fd

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
@@ -965,19 +965,19 @@ getDocsBatch
965965
:: HscEnv
966966
-> Module -- ^ a moudle where the names are in scope
967967
-> [Name]
968-
-> IO (Map.Map Name (Either String (Maybe HsDocString, Map.Map Int HsDocString)))
968+
-> IO (Map.Map Name (Either T.Text (Maybe HsDocString, Map.Map Int HsDocString)))
969969
getDocsBatch hsc_env _mod _names = do
970970
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ Map.fromList <$> traverse findNameInfo _names
971971
case res of
972972
Just x -> return $ fun x
973973
Nothing -> throwErrors errs
974974
where
975-
fun :: Map.Map Name (Either GetDocsFailure c) -> Map.Map Name (Either String c)
975+
fun :: Map.Map Name (Either GetDocsFailure c) -> Map.Map Name (Either T.Text c)
976976
fun =
977977
Map.map fun1
978978
where
979-
fun1 :: Either GetDocsFailure c -> Either String c
980-
fun1 = first $ T.unpack . showGhc
979+
fun1 :: Either GetDocsFailure c -> Either T.Text c
980+
fun1 = first showGhc
981981

982982
throwErrors = liftIO . throwIO . mkSrcErr
983983

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)