@@ -39,7 +39,7 @@ import Language.PureScript.Ide.Filter
3939import Language.PureScript.Ide.State
4040import Language.PureScript.Ide.Types
4141import Language.PureScript.Ide.Util
42−import System.IO.UTF8 (readUTF8FileT, writeUTF8FileT)
42+import System.IO.UTF8 (writeUTF8FileT)
4343
4444data Import = Import P.ModuleName P.ImportDeclarationType (Maybe P.ModuleName)
4545 deriving (Eq, Show)
@@ -67,10 +67,10 @@ compImport (Import n i q) (Import n' i' q')
6767
6868-- | Reads a file and returns the (lines before the imports, the imports, the
6969-- lines after the imports)
70−parseImportsFromFile :: (MonadIO m, MonadError PscIdeError m) =>
70+parseImportsFromFile :: (MonadIO m, MonadError IdeError m) =>
7171 FilePath -> m (P.ModuleName, [Text], [Import], [Text])
7272parseImportsFromFile fp = do
73− file <- liftIO (readUTF8FileT fp)
73+ file <- ideReadFile fp
7474 case sliceImportSection (T.lines file) of
7575 Right res -> pure res
7676 Left err -> throwError (GeneralError err)
@@ -147,7 +147,7 @@ moduleParse t = first show $ do
147147 P.runTokenParser "<psc-ide>" P.parseModule tokens
148148
149149-- | Adds an implicit import like @import Prelude@ to a Sourcefile.
150−addImplicitImport :: (MonadIO m, MonadError PscIdeError m)
150+addImplicitImport :: (MonadIO m, MonadError IdeError m)
151151 => FilePath -- ^ The Sourcefile read from
152152 -> P.ModuleName -- ^ The module to import
153153 -> m [Text]
@@ -170,7 +170,7 @@ addImplicitImport' imports mn =
170170-- So @addExplicitImport "/File.purs" "bind" "Prelude"@ with an already existing
171171-- @import Prelude (bind)@ in the file File.purs returns @["import Prelude
172172-- (bind, unit)"]@
173−addExplicitImport :: (MonadIO m, MonadError PscIdeError m) =>
173+addExplicitImport :: (MonadIO m, MonadError IdeError m) =>
174174 FilePath -> IdeDeclaration -> P.ModuleName -> m [Text]
175175addExplicitImport fp decl moduleName = do
176176 (mn, pre, imports, post) <- parseImportsFromFile fp
@@ -249,7 +249,7 @@ updateAtFirstOrPrepend p t d l =
249249--
250250-- * If more than one possible imports are found, reports the possibilities as a
251251-- list of completions.
252−addImportForIdentifier :: (Ide m, MonadError PscIdeError m)
252+addImportForIdentifier :: (Ide m, MonadError IdeError m)
253253 => FilePath -- ^ The Sourcefile to read from
254254 -> Text -- ^ The identifier to import
255255 -> [Filter] -- ^ Filters to apply before searching for