leksah-server 0.15.0.1 → 0.15.0.2
raw patch · 2 files changed
+10/−18 lines, 2 filesdep ~leksah-serverPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: leksah-server
API changes (from Hackage documentation)
- IDE.Utils.FileUtils: getSourcePackageIds :: IO [PackageIdentifier]
+ IDE.Utils.FileUtils: getInstalledPackageIds' :: IO (Either Text [PackageIdentifier])
Files
- leksah-server.cabal +2/−2
- src/IDE/Utils/FileUtils.hs +8/−16
leksah-server.cabal view
@@ -1,5 +1,5 @@ name: leksah-server-version: 0.15.0.1+version: 0.15.0.2 cabal-version: >= 1.10.2 build-type: Simple license: GPL@@ -195,7 +195,7 @@ hs-source-dirs: tests main-is: TestTool.hs build-depends: base >= 4.0.0.0 && <4.9, hslogger >= 1.0.7 && <1.3,- leksah-server == 0.15.0.1,+ leksah-server == 0.15.0.2, HUnit >=1.2 && <1.3, transformers >=0.2.2.0 && <0.5, conduit >= 1.0.8 && <1.3, conduit-extra >=1.0.0.1 && <1.2, resourcet
src/IDE/Utils/FileUtils.hs view
@@ -40,7 +40,7 @@ , autoExtractCabalTarFiles , autoExtractTarFiles , getInstalledPackageIds-, getSourcePackageIds+, getInstalledPackageIds' , figureOutGhcOpts , figureOutHaddockOpts , allFilesWithExtensions@@ -88,7 +88,7 @@ import Control.Exception as E (SomeException, catch) import System.IO.Strict (readFile) import qualified Data.Text as T- (pack, map, stripPrefix, isSuffixOf, take, length, unpack, init,+ (pack, stripPrefix, isSuffixOf, take, length, unpack, init, last, words) import Data.Monoid ((<>)) import Data.Text (Text)@@ -413,24 +413,16 @@ ) $ \ (e :: SomeException) -> error ("FileUtils>>getSysLibDir failed with " ++ show e) getInstalledPackageIds :: IO [PackageIdentifier]-getInstalledPackageIds = E.catch (do+getInstalledPackageIds = either (const []) id <$> getInstalledPackageIds'++getInstalledPackageIds' :: IO (Either Text [PackageIdentifier])+getInstalledPackageIds' = E.catch (do (!output, _) <- runTool' "ghc-pkg" ["list", "--simple-output"] Nothing- output `deepseq` return $ concatMap names output- ) $ \ (e :: SomeException) -> error ("FileUtils>>getInstalledPackageIds failed with " ++ show e)+ output `deepseq` return $ Right $ concatMap names output+ ) $ \ (e :: SomeException) -> return . Left . T.pack $ show e where names (ToolOutput n) = catMaybes (map (T.simpleParse . T.unpack) (T.words n)) names _ = []--getSourcePackageIds :: IO [PackageIdentifier]-getSourcePackageIds = E.catch (do- (!output, _) <- runTool' "ghc-pkg" ["list", "--simple-output"] Nothing- output `deepseq` return $ catMaybes $ map names output- ) $ \ (e :: SomeException) -> error ("FileUtils>>getInstalledPackageIds failed with " ++ show e)- where- names (ToolOutput n) = T.simpleParse . T.unpack $ T.map replaceSpace n- names _ = Nothing- replaceSpace ' ' = '-'- replaceSpace c = c figureOutHaddockOpts :: IO [Text] figureOutHaddockOpts = do