@@ -52,8 +52,8 @@ import Data.List.Split (splitOn)
52import Util.Pretty(pretty, text)
52import Util.Pretty(pretty, text)
54-- | Elaborate a type provider
54-- | Elaborate a type provider
55−elabProvider :: ElabInfo -> SyntaxInfo -> FC -> ProvideWhat -> Name -> Idris ()
55+elabProvider :: Docstring (Either Err PTerm) -> ElabInfo -> SyntaxInfo -> FC -> ProvideWhat -> Name -> Idris ()
56−elabProvider info syn fc what n
56+elabProvider doc info syn fc what n
57 = do i <- getIState
57 = do i <- getIState
58 -- Ensure that the experimental extension is enabled
58 -- Ensure that the experimental extension is enabled
59 unless (TypeProviders `elem` idris_language_extensions i) $
59 unless (TypeProviders `elem` idris_language_extensions i) $
@@ -93,12 +93,16 @@ elabProvider info syn fc what n
93 Provide tm
93 Provide tm
94 | ProvTerm ty _ <- what ->
94 | ProvTerm ty _ <- what ->
95 do -- Finally add a top-level definition of the provided term
95 do -- Finally add a top-level definition of the provided term
96− elabType info syn emptyDocstring [] fc [] n ty
96+ elabType info syn doc [] fc [] n ty
97 elabClauses info fc [] n [PClause fc n (PApp fc (PRef fc n) []) [] (delab i tm) []]
97 elabClauses info fc [] n [PClause fc n (PApp fc (PRef fc n) []) [] (delab i tm) []]
98 logLvl 3 $ "Elaborated provider " ++ show n ++ " as: " ++ show tm
98 logLvl 3 $ "Elaborated provider " ++ show n ++ " as: " ++ show tm
99 | ProvPostulate _ <- what ->
99 | ProvPostulate _ <- what ->
100 do -- Add the postulate
100 do -- Add the postulate
103+ (fmap (const (Left $ Msg "")) .
101− elabPostulate info syn (fmap (const (Left $ Msg "")) . parseDocstring $ T.pack "Provided postulate") fc [] n (delab i tm)
104+ parseDocstring $ T.pack "Provided postulate")
105+ fc [] n (delab i tm)
102 logLvl 3 $ "Elaborated provided postulate " ++ show n
106 logLvl 3 $ "Elaborated provided postulate " ++ show n
103 | otherwise ->
107 | otherwise ->
104 ierror . Msg $ "Attempted to provide a postulate where a term was expected."
108 ierror . Msg $ "Attempted to provide a postulate where a term was expected."
@@ -120,4 +124,3 @@ elabProvider info syn fc what n
120 case converts ctxt [] (providerOf tp) prov of
124 case converts ctxt [] (providerOf tp) prov of
121 OK _ -> True
125 OK _ -> True
122 _ -> False
126 _ -> False