packages feed

haskell-language-server 1.9.1.0 → 1.10.0.0

raw patch · 13 files changed

+212/−61 lines, 13 filesdep −hls-brittany-plugindep −hsloggerdep ~ghcidedep ~hls-eval-plugindep ~hls-refactor-plugin

Dependencies removed: hls-brittany-plugin, hslogger

Dependency ranges changed: ghcide, hls-eval-plugin, hls-refactor-plugin, hls-splice-plugin, hls-tactics-plugin, hls-test-utils

Files

ChangeLog.md view
@@ -1,5 +1,54 @@ # Changelog for haskell-language-server +## 1.10.0.0++- Support for GHC 9.6+- Binaries for GHC 9.2.7 and GHC 9.6.1+- Eval plugin support for GHC 9.4+ (#3391)+- Don't show lenses for TH generated instances when using hls-class-plugin (#3531)++### Pull requests merged for 1.10.0.0+- Support fourmolu 0.11+([#3533](https://github.com/haskell/haskell-language-server/pull/3533)) by @brandonchinn178+- Don't show lenses for TH generated instances+([#3531](https://github.com/haskell/haskell-language-server/pull/3531)) by @July541+- Bump haskell/actions from 2.3.3 to 2.3.6+([#3529](https://github.com/haskell/haskell-language-server/pull/3529)) by @dependabot[bot]+- Use GHC 9.2.7 in flake+([#3527](https://github.com/haskell/haskell-language-server/pull/3527)) by @cydparser+- Remove HsLogger+([#3526](https://github.com/haskell/haskell-language-server/pull/3526)) by @fendor+- Use hie-bios 0.12+([#3524](https://github.com/haskell/haskell-language-server/pull/3524)) by @wz1000+- Bump haskell/actions+([#3520](https://github.com/haskell/haskell-language-server/pull/3520)) by @michaelpj+- Bump cachix/install-nix-action from 19 to 20+([#3514](https://github.com/haskell/haskell-language-server/pull/3514)) by @dependabot[bot]+- Docs: update Emacs section: add eglot with config example+([#3509](https://github.com/haskell/haskell-language-server/pull/3509)) by @m4lvin+- Eval plugin is now supported in 9.4+([#3508](https://github.com/haskell/haskell-language-server/pull/3508)) by @michaelpj+-  Update flake to GHC 9.2.6 and 9.4.4+([#3503](https://github.com/haskell/haskell-language-server/pull/3503)) by @cydparser+- Fix lower ghcide bounds of rename and fourmolu plugins+([#3501](https://github.com/haskell/haskell-language-server/pull/3501)) by @pepeiborra+- Add 9.2.6 to ghc-version-support.md+([#3494](https://github.com/haskell/haskell-language-server/pull/3494)) by @wz1000+- Bump versions and add changelogs for 1.9.1.0+([#3493](https://github.com/haskell/haskell-language-server/pull/3493)) by @hasufell+- Bump cachix/install-nix-action from 18 to 19+([#3490](https://github.com/haskell/haskell-language-server/pull/3490)) by @dependabot[bot]+- Experiment with loading matrix values from a file+([#3481](https://github.com/haskell/haskell-language-server/pull/3481)) by @michaelpj+- 9.6 support for HLS+([#3480](https://github.com/haskell/haskell-language-server/pull/3480)) by @wz1000+- Make the Ormolu plugin respect `.ormolu` fixity files when Ormolu ≥0.5.3.0+([#3449](https://github.com/haskell/haskell-language-server/pull/3449)) by @amesgen+- Migrate release CI to github+([#3406](https://github.com/haskell/haskell-language-server/pull/3406)) by @hasufell+- Eval plugin for GHC 9.4+([#3391](https://github.com/haskell/haskell-language-server/pull/3391)) by @wz1000+ ## 1.9.1.0  - Binaries for GHC 9.2.6.
exe/Main.hs view
@@ -51,7 +51,7 @@ main = do     -- plugin cli commands use stderr logger for now unless we change the args     -- parser to get logging arguments first or do more complicated things-    pluginCliRecorder <- cmapWithPrio pretty <$> makeDefaultStderrRecorder Nothing Info+    pluginCliRecorder <- cmapWithPrio pretty <$> makeDefaultStderrRecorder Nothing     args <- getArguments "haskell-language-server" (Plugins.idePlugins (cmapWithPrio LogPlugins pluginCliRecorder))      (lspLogRecorder, cb1) <- Logger.withBacklog Logger.lspClientLogRecorder@@ -71,7 +71,7 @@               in (argsTesting, minPriority, argsLogFile)             _ -> (False, Info, Nothing) -    withDefaultRecorder logFilePath Nothing minPriority $ \textWithPriorityRecorder -> do+    withDefaultRecorder logFilePath Nothing $ \textWithPriorityRecorder -> do       let         recorder = cmapWithPrio (pretty &&& id) $ mconcat             [textWithPriorityRecorder@@ -87,7 +87,7 @@                 -- ability of lsp-test to detect a stuck server in tests and benchmarks                 & if argsTesting then cfilter (not . heapStats . snd . payload) else id             ]-        plugins = (Plugins.idePlugins (cmapWithPrio LogPlugins recorder))+        plugins = Plugins.idePlugins (cmapWithPrio LogPlugins recorder)        defaultMain         (cmapWithPrio LogIdeMain recorder)
exe/Wrapper.hs view
@@ -45,13 +45,13 @@ import qualified Data.Text.IO                       as T import           Development.IDE.LSP.LanguageServer (runLanguageServer) import qualified Development.IDE.Main               as Main-import           Development.IDE.Types.Logger       (Logger (Logger),+import           Development.IDE.Types.Logger       (Doc, Logger (Logger),                                                      Pretty (pretty),-                                                     Priority (Info),                                                      Recorder (logger_),                                                      WithPriority (WithPriority),                                                      cmapWithPrio,-                                                     makeDefaultStderrRecorder)+                                                     makeDefaultStderrRecorder,+                                                     toCologActionWithPrio) import           GHC.Stack.Types                    (emptyCallStack) import           Ide.Plugin.Config                  (Config) import           Ide.Types                          (IdePlugins (IdePlugins))@@ -74,6 +74,7 @@   args <- getArguments "haskell-language-server-wrapper" mempty    hlsVer <- haskellLanguageServerVersion+  recorder <- makeDefaultStderrRecorder Nothing   case args of       ProbeToolsMode -> do           programsOfInterest <- findProgramVersions@@ -82,7 +83,7 @@           putStrLn $ showProgramVersionOfInterest programsOfInterest           putStrLn "Tool versions in your project"           cradle <- findProjectCradle' False-          ghcVersion <- runExceptT $ getRuntimeGhcVersion' cradle+          ghcVersion <- runExceptT $ getRuntimeGhcVersion' recorder cradle           putStrLn $ showProgramVersion "ghc" $ mkVersion =<< eitherToMaybe ghcVersion        VersionMode PrintVersion ->@@ -95,18 +96,18 @@           print =<< findProjectCradle       PrintLibDir -> do           cradle <- findProjectCradle' False-          (CradleSuccess libdir) <- HieBios.getRuntimeGhcLibDir cradle+          (CradleSuccess libdir) <- HieBios.getRuntimeGhcLibDir (toCologActionWithPrio (cmapWithPrio pretty recorder)) cradle           putStr libdir-      _ -> launchHaskellLanguageServer args >>= \case+      _ -> launchHaskellLanguageServer recorder args >>= \case             Right () -> pure ()             Left err -> do               T.hPutStrLn stderr (prettyError err NoShorten)               case args of-                Ghcide _ -> launchErrorLSP (prettyError err Shorten)+                Ghcide _ -> launchErrorLSP recorder (prettyError err Shorten)                 _        -> pure () -launchHaskellLanguageServer :: Arguments -> IO (Either WrapperSetupError ())-launchHaskellLanguageServer parsedArgs = do+launchHaskellLanguageServer :: Recorder (WithPriority (Doc ())) -> Arguments -> IO (Either WrapperSetupError ())+launchHaskellLanguageServer recorder parsedArgs = do   case parsedArgs of     Ghcide GhcideArguments{..} -> whenJust argsCwd setCurrentDirectory     _                          -> pure ()@@ -122,7 +123,7 @@   case parsedArgs of     Ghcide GhcideArguments{..} ->       when argsProjectGhcVersion $ do-        runExceptT (getRuntimeGhcVersion' cradle) >>= \case+        runExceptT (getRuntimeGhcVersion' recorder cradle) >>= \case           Right ghcVersion -> putStrLn ghcVersion >> exitSuccess           Left err -> T.putStrLn (prettyError err NoShorten) >> exitFailure     _ -> pure ()@@ -145,7 +146,7 @@   hPutStrLn stderr "Consulting the cradle to get project GHC version..."    runExceptT $ do-      ghcVersion <- getRuntimeGhcVersion' cradle+      ghcVersion <- getRuntimeGhcVersion' recorder cradle       liftIO $ hPutStrLn stderr $ "Project GHC version: " ++ ghcVersion        let@@ -170,10 +171,10 @@            let cradleName = actionName (cradleOptsProg cradle)           -- we need to be compatible with NoImplicitPrelude-          ghcBinary <- liftIO (fmap trim <$> runGhcCmd ["-v0", "-package-env=-", "-ignore-dot-ghci", "-e", "Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath)"])+          ghcBinary <- liftIO (fmap trim <$> runGhcCmd (toCologActionWithPrio (cmapWithPrio pretty recorder)) ["-v0", "-package-env=-", "-ignore-dot-ghci", "-e", "Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath)"])                          >>= cradleResult cradleName -          libdir <- liftIO (HieBios.getRuntimeGhcLibDir cradle)+          libdir <- liftIO (HieBios.getRuntimeGhcLibDir (toCologActionWithPrio (cmapWithPrio pretty recorder)) cradle)                       >>= cradleResult cradleName            env <- Map.fromList <$> liftIO getEnvironment@@ -190,8 +191,8 @@  -- | Version of 'getRuntimeGhcVersion' that dies if we can't get it, and also -- checks to see if the tool is missing if it is one of-getRuntimeGhcVersion' :: Cradle Void -> ExceptT WrapperSetupError IO String-getRuntimeGhcVersion' cradle = do+getRuntimeGhcVersion' :: Recorder (WithPriority (Doc ())) -> Cradle Void -> ExceptT WrapperSetupError IO String+getRuntimeGhcVersion' recorder cradle = do   let cradleName = actionName (cradleOptsProg cradle)    -- See if the tool is installed@@ -202,7 +203,7 @@     Direct  -> checkToolExists "ghc"     _       -> pure () -  ghcVersionRes <- liftIO $ HieBios.getRuntimeGhcVersion cradle+  ghcVersionRes <- liftIO $ HieBios.getRuntimeGhcVersion (toCologActionWithPrio (cmapWithPrio pretty recorder)) cradle   cradleResult cradleName ghcVersionRes    where@@ -271,10 +272,8 @@  -- | Launches a LSP that displays an error and presents the user with a request -- to shut down the LSP.-launchErrorLSP :: T.Text -> IO ()-launchErrorLSP errorMsg = do-  recorder <- makeDefaultStderrRecorder Nothing Info-+launchErrorLSP :: Recorder (WithPriority (Doc ())) -> T.Text -> IO ()+launchErrorLSP recorder errorMsg = do   let logger = Logger $ \p m -> logger_ recorder (WithPriority p emptyCallStack (pretty m))    let defaultArguments = Main.defaultArguments (cmapWithPrio pretty recorder) logger (IdePlugins [])
haskell-language-server.cabal view
@@ -1,7 +1,7 @@ cabal-version:      3.0 category:           Development name:               haskell-language-server-version:            1.9.1.0+version:            1.10.0.0 synopsis:           LSP server for GHC description:   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -196,11 +196,6 @@   default:     True   manual:      True -flag brittany-  description: Enable brittany plugin-  default:     True-  manual:      True- flag refactor   description: Enable refactor plugin   default:     True@@ -233,7 +228,7 @@  common callHierarchy   if flag(callHierarchy)-    build-depends: hls-call-hierarchy-plugin ^>= 1.1+    build-depends: hls-call-hierarchy-plugin ^>= 1.2     cpp-options: -Dhls_callHierarchy  common haddockComments@@ -242,8 +237,8 @@     cpp-options: -Dhls_haddockComments  common eval-  if flag(eval) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))-    build-depends: hls-eval-plugin ^>= 1.4+  if flag(eval)+    build-depends: hls-eval-plugin ^>= 1.5     cpp-options: -Dhls_eval  common importLens@@ -257,7 +252,7 @@     cpp-options: -Dhls_refineImports  common rename-  if flag(rename) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))+  if flag(rename)     build-depends: hls-rename-plugin ^>= 1.0     cpp-options: -Dhls_rename @@ -272,7 +267,7 @@     cpp-options: -Dhls_tactic  common hlint-  if flag(hlint)+  if flag(hlint) && impl(ghc < 9.5)     build-depends: hls-hlint-plugin ^>= 1.1     cpp-options: -Dhls_hlint @@ -293,7 +288,7 @@  common splice   if flag(splice)-    build-depends: hls-splice-plugin ^>=1.0.0.1+    build-depends: hls-splice-plugin ^>=1.1     cpp-options: -Dhls_splice  common alternateNumberFormat@@ -334,33 +329,28 @@ -- formatters  common floskell-  if flag(floskell) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))+  if flag(floskell) && impl(ghc < 9.5)      build-depends: hls-floskell-plugin ^>= 1.0     cpp-options: -Dhls_floskell  common fourmolu-  if flag(fourmolu)+  if flag(fourmolu) && impl(ghc < 9.5)     build-depends: hls-fourmolu-plugin ^>= 1.1     cpp-options: -Dhls_fourmolu  common ormolu-  if flag(ormolu) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))+  if flag(ormolu) && impl(ghc < 9.5)     build-depends: hls-ormolu-plugin ^>= 1.0     cpp-options: -Dhls_ormolu  common stylishHaskell-  if flag(stylishHaskell) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))+  if flag(stylishHaskell) && impl(ghc < 9.5)     build-depends: hls-stylish-haskell-plugin ^>= 1.0     cpp-options: -Dhls_stylishHaskell -common brittany-  if flag(brittany) && (impl(ghc < 9.0.2) || flag(ignore-plugins-ghc-bounds))-    build-depends: hls-brittany-plugin ^>= 1.1-    cpp-options: -Dhls_brittany- common refactor   if flag(refactor)-    build-depends: hls-refactor-plugin ^>= 1.1+    build-depends: hls-refactor-plugin ^>= 1.2     cpp-options: -Dhls_refactor  library@@ -396,7 +386,6 @@                   , fourmolu                   , ormolu                   , stylishHaskell-                  , brittany                   , refactor    exposed-modules:@@ -416,7 +405,7 @@     , cryptohash-sha1     , data-default     , ghc-    , ghcide                ==1.9.1.0+    , ghcide                ==1.10.0.0     , githash               >=0.1.6.1     , lsp     , hie-bios@@ -521,7 +510,6 @@     , ghcide     , gitrev     , haskell-language-server-    , hslogger     , hie-bios     , hls-plugin-api     , lsp
src/HlsPlugins.hs view
@@ -122,10 +122,6 @@ import qualified Ide.Plugin.StylishHaskell         as StylishHaskell #endif -#if hls_brittany-import qualified Ide.Plugin.Brittany               as Brittany-#endif- #if hls_refactor import qualified Development.IDE.Plugin.CodeAction as Refactor #endif@@ -177,9 +173,6 @@ #endif #if hls_retrie       Retrie.descriptor "retrie" :-#endif-#if hls_brittany-      Brittany.descriptor "brittany" : #endif #if hls_callHierarchy       CallHierarchy.descriptor "callHierarchy" :
src/Ide/Main.hs view
@@ -28,6 +28,7 @@ import qualified Development.IDE.Types.Options as Ghcide import           GHC.Stack                     (emptyCallStack) import qualified HIE.Bios.Environment          as HieBios+import qualified HIE.Bios.Types                as HieBios import           HIE.Bios.Types                hiding (Log) import           Ide.Arguments import           Ide.Plugin.ConfigUtils        (pluginsToDefaultConfig,@@ -44,6 +45,7 @@   | LogDirectory !FilePath   | LogLspStart !GhcideArguments ![PluginId]   | LogIDEMain IDEMain.Log+  | LogHieBios HieBios.Log   | LogOther T.Text   deriving Show @@ -58,6 +60,7 @@           , viaShow ghcideArgs           , "PluginIds:" <+> pretty (coerce @_ @[Text] pluginIds) ]     LogIDEMain iDEMainLog -> pretty iDEMainLog+    LogHieBios hieBiosLog -> pretty hieBiosLog     LogOther t -> pretty t  defaultMain :: Recorder (WithPriority Log) -> Arguments -> IdePlugins IdeState -> IO ()@@ -105,7 +108,7 @@           let initialFp = d </> "a"           hieYaml <- Session.findCradle def initialFp           cradle <- Session.loadCradle def hieYaml d-          (CradleSuccess libdir) <- HieBios.getRuntimeGhcLibDir cradle+          (CradleSuccess libdir) <- HieBios.getRuntimeGhcLibDir (toCologActionWithPrio (cmapWithPrio LogHieBios recorder)) cradle           putStr libdir   where     encodePrettySorted = A.encodePretty' A.defConfig@@ -137,3 +140,4 @@         let defOptions = IDEMain.argsIdeOptions args config sessionLoader         in defOptions { Ghcide.optShakeProfiling = argsShakeProfiling }       }+
src/Ide/Version.hs view
@@ -7,6 +7,7 @@ -- and the current project's version module Ide.Version where + import           Data.Maybe                    (listToMaybe) import           Data.Version import           GitHash                       (giCommitCount, tGitInfoCwdTry)
test/functional/Config.hs view
@@ -96,11 +96,12 @@         testPluginDiagnostics = [("Foo.hs", [(DsError, (0,0), "testplugin")])]          runConfigSession subdir =-            failIfSessionTimeout . runSessionWithServer @() (const plugin) ("test/testdata" </> subdir)+            failIfSessionTimeout . runSessionWithServer @() plugin ("test/testdata" </> subdir)          testPluginId = "testplugin"         -- A disabled-by-default plugin that creates diagnostics-        plugin = (defaultPluginDescriptor testPluginId)+        plugin = mkPluginTestDescriptor' pd testPluginId+        pd plId = (defaultPluginDescriptor plId)           {             pluginConfigDescriptor = configDisabled           , pluginRules = do
test/functional/FunctionalCodeAction.hs view
@@ -27,6 +27,8 @@ tests = testGroup "code actions" [ #if hls_refactor       importTests+    , ignoreInEnv [HostOS Windows, GhcVer GHC94] "Diagnostic failure for Windows-ghc9.4.2" importQualifiedTests+    , ignoreInEnv [HostOS Windows, GhcVer GHC94] "Diagnostic failure for Windows-ghc9.4.2" importQualifiedPostTests     , packageTests     , redundantImportTests     , renameTests@@ -80,7 +82,7 @@  importTests :: TestTree importTests = testGroup "import suggestions" [-    testCase "works with 3.8 code action kinds" $ runSession hlsCommand fullCaps "test/testdata" $ do+    testCase "import works with 3.8 code action kinds" $ runSession hlsCommand fullCaps "test/testdata" $ do         doc <- openDoc "CodeActionImport.hs" "haskell"         -- No Formatting:         let config = def { formattingProvider = "none" }@@ -103,6 +105,64 @@         liftIO $ contents @?= "import Control.Monad\nmain :: IO ()\nmain = when True $ putStrLn \"hello\""     ] +importQualifiedTests :: TestTree+importQualifiedTests = testGroup "import qualified prefix suggestions" [+    testCase "qualified import works with 3.8 code action kinds" $ runSession hlsCommand fullCaps "test/testdata" $ do+        doc <- openDoc "CodeActionImportQualified.hs" "haskell"+        -- No Formatting:+        let config = def { formattingProvider = "none" }+        sendConfigurationChanged (toJSON config)++        (diag:_) <- waitForDiagnosticsFrom doc+        liftIO $ diag ^. L.message @?=+           if ghcVersion >= GHC96+           then "Variable not in scope: Control.when :: Bool -> IO () -> IO ()\nNB: no module named ‘Control’ is imported."+           else "Not in scope: ‘Control.when’\nNo module named ‘Control’ is imported."++        actionsOrCommands <- getAllCodeActions doc+        let actns = map fromAction actionsOrCommands++        let importQualifiedSuggestion = "import qualified Control.Monad as Control"+        importControlMonadQualified <- liftIO $ inspectCodeAction actionsOrCommands [importQualifiedSuggestion]+        liftIO $ do+            dontExpectCodeAction actionsOrCommands ["import Control.Monad (when)"]+            length actns >= 5 @? "There are some actions"++        executeCodeAction importControlMonadQualified++        contents <- documentContents doc+        liftIO $ contents @?= "import qualified Control.Monad as Control\nmain :: IO ()\nmain = Control.when True $ putStrLn \"hello\"\n"+    ]++importQualifiedPostTests :: TestTree+importQualifiedPostTests = testGroup "import qualified postfix suggestions" [+    testCase "qualified import in postfix position works with 3.8 code action kinds" $ runSession hlsCommand fullCaps "test/testdata" $ do+        doc <- openDoc "CodeActionImportPostQualified.hs" "haskell"+        -- No Formatting:+        let config = def { formattingProvider = "none" }+        sendConfigurationChanged (toJSON config)++        (diag:_) <- waitForDiagnosticsFrom doc+        liftIO $ diag ^. L.message @?=+           if ghcVersion >= GHC96+           then "Variable not in scope: Control.when :: Bool -> IO () -> IO ()\nNB: no module named ‘Control’ is imported."+           else "Not in scope: ‘Control.when’\nNo module named ‘Control’ is imported."++        actionsOrCommands <- getAllCodeActions doc+        let actns = map fromAction actionsOrCommands++        let importQualifiedPostSuggestion = "import Control.Monad qualified as Control"+        importControlMonadQualified <- liftIO $ inspectCodeAction actionsOrCommands [importQualifiedPostSuggestion]+        liftIO $ do+            dontExpectCodeAction actionsOrCommands ["import qualified Control.Monad as Control", "import Control.Monad (when)"]+            length actns >= 5 @? "There are some actions"++        executeCodeAction importControlMonadQualified++        contents <- documentContents doc+        liftIO $ T.lines contents !! 2 @?= "import Control.Monad qualified as Control"+    ]+ packageTests :: TestTree packageTests = testGroup "add package suggestions" [     ignoreTestBecause "no support for adding dependent packages via code action" $ testCase "adds to .cabal files" $ do@@ -260,7 +320,7 @@                     , "foo x = maxBound"                     ] -      , knownBrokenForGhcVersions [GHC92, GHC94] "The wingman plugin doesn't yet compile in GHC92/GHC94" $+      , knownBrokenForGhcVersions [GHC92, GHC94, GHC96] "The wingman plugin doesn't yet compile in GHC92/GHC94" $           testCase "doesn't work when wingman is active" $           runSession hlsCommand fullCaps "test/testdata" $ do               doc <- openDoc "TypedHoles.hs" "haskell"@@ -295,7 +355,7 @@                         , "    stuff (A a) = A (a + 1)"                         ] -      , knownBrokenForGhcVersions [GHC92, GHC94] "The wingman plugin doesn't yet compile in GHC92/GHC94" $+      , knownBrokenForGhcVersions [GHC92, GHC94, GHC96] "The wingman plugin doesn't yet compile in GHC92/GHC94" $           testCase "doesnt show more suggestions when wingman is active" $             runSession hlsCommand fullCaps "test/testdata" $ do                 doc <- openDoc "TypedHoles2.hs" "haskell"
+ test/testdata/CodeActionImportPostQualified.hs view
@@ -0,0 +1,4 @@+{-# LANGUAGE ImportQualifiedPost #-}+{-# OPTIONS_GHC -Wprepositive-qualified-module #-}+main :: IO ()+main = Control.when True $ putStrLn "hello"
+ test/testdata/CodeActionImportQualified.hs view
@@ -0,0 +1,2 @@+main :: IO ()+main = Control.when True $ putStrLn "hello"
+ test/testdata/hieBiosError/hie.yaml view
+ test/testdata/wErrorTest/dist-newstyle/build/x86_64-linux/ghc-8.10.3/test-0.1.0.0/build/autogen/Paths_test.hs view
@@ -0,0 +1,50 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE NoRebindableSyntax #-}+{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}+module Paths_test (+    version,+    getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,+    getDataFileName, getSysconfDir+  ) where++import qualified Control.Exception as Exception+import Data.Version (Version(..))+import System.Environment (getEnv)+import Prelude++#if defined(VERSION_base)++#if MIN_VERSION_base(4,0,0)+catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a+#else+catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a+#endif++#else+catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a+#endif+catchIO = Exception.catch++version :: Version+version = Version [0,1,0,0] []+bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath++bindir     = "/home/zubin/.cabal/bin"+libdir     = "/home/zubin/.cabal/lib/x86_64-linux-ghc-8.10.3/test-0.1.0.0-inplace"+dynlibdir  = "/home/zubin/.cabal/lib/x86_64-linux-ghc-8.10.3"+datadir    = "/home/zubin/.cabal/share/x86_64-linux-ghc-8.10.3/test-0.1.0.0"+libexecdir = "/home/zubin/.cabal/libexec/x86_64-linux-ghc-8.10.3/test-0.1.0.0"+sysconfdir = "/home/zubin/.cabal/etc"++getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath+getBinDir = catchIO (getEnv "test_bindir") (\_ -> return bindir)+getLibDir = catchIO (getEnv "test_libdir") (\_ -> return libdir)+getDynLibDir = catchIO (getEnv "test_dynlibdir") (\_ -> return dynlibdir)+getDataDir = catchIO (getEnv "test_datadir") (\_ -> return datadir)+getLibexecDir = catchIO (getEnv "test_libexecdir") (\_ -> return libexecdir)+getSysconfDir = catchIO (getEnv "test_sysconfdir") (\_ -> return sysconfdir)++getDataFileName :: FilePath -> IO FilePath+getDataFileName name = do+  dir <- getDataDir+  return (dir ++ "/" ++ name)