packages feed

ghcid 0.7.5 → 0.7.6

raw patch · 8 files changed

+25/−11 lines, 8 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGES.txt view
@@ -1,5 +1,9 @@ Changelog for ghcid (* = breaking change) +0.7.6, released 2019-10-13+    #283, support Clashi+    #278, allow --lint to take a shell command rather than just an executable+    #275, fix error reporting with non .hs/.lhs filenames in LINE pragmas 0.7.5, released 2019-07-04     #263, fix not resizing on terminal resize     #262, add --test-message flag
README.md view
@@ -71,7 +71,7 @@ #### I get "During interactive linking, GHCi couldn't find the following symbol" This problem is a manifestation of [GHC bug 8025](https://ghc.haskell.org/trac/ghc/ticket/8025), which is fixed in GHC 8.4 and above. Ghcid automatically appends `-fno-code` to the command line, but for older GHC's you can supress that with `--test "return ()"` (to add a fake test) or `-c "ghci ..."` to manually specify the command to run. -#### I only see source-spans or error messages on errors/warnings after the first load.+#### I only see source-spans or colors on errors/warnings after the first load. Due to limitations in `ghci`, these flags are only set _after_ the first load. If you want them to apply from the start, pass them on the command line to `ghci` with something like `-c "ghci -ferror-spans -fdiagnostics-color=always"`.  #### I want to match on the file/line/column to get jump-to-error functionality in my editor.
ghcid.cabal view
@@ -1,7 +1,7 @@ cabal-version:      >= 1.18 build-type:         Simple name:               ghcid-version:            0.7.5+version:            0.7.6 license:            BSD3 license-file:       LICENSE category:           Development@@ -13,7 +13,7 @@     Either \"GHCi as a daemon\" or \"GHC + a bit of an IDE\". A very simple Haskell development tool which shows you the errors in your project and updates them whenever you save. Run @ghcid --topmost --command=ghci@, where @--topmost@ makes the window on top of all others (Windows only) and @--command@ is the command to start GHCi on your project (defaults to @ghci@ if you have a @.ghci@ file, or else to @cabal repl@). homepage:           https://github.com/ndmitchell/ghcid#readme bug-reports:        https://github.com/ndmitchell/ghcid/issues-tested-with:        GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3+tested-with:        GHC==8.8.1, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3 extra-doc-files:     CHANGES.txt     README.md
src/Ghcid.hs view
@@ -161,9 +161,9 @@     where         f c r = o{command = unwords $ c ++ map escape arguments, arguments = [], restart = restart ++ r, run = [], test = run ++ test} -        -- in practice we're not expecting many arguments to have anything funky in them-        escape x | ' ' `elem` x = "\"" ++ x ++ "\""-                 | otherwise = x+-- | Simple escaping for command line arguments. Wraps a string in double quotes if it contains a space.+escape x | ' ' `elem` x = "\"" ++ x ++ "\""+         | otherwise = x  -- | Use arguments from .ghcid if present withGhcidArgs :: IO a -> IO a@@ -366,7 +366,7 @@                         whenNormal $ outStrLn "\n...done"             whenJust lint $ \lintcmd ->                 unless hasErrors $ do-                    (exitcode, stdout, stderr) <- readProcessWithExitCode lintcmd loaded ""+                    (exitcode, stdout, stderr) <- readCreateProcessWithExitCode (shell . unwords $ lintcmd : map escape loaded) ""                     unless (exitcode == ExitSuccess) $ outStrLn (stdout ++ stderr)              reason <- nextWait $ restart ++ reload ++ loaded
src/Language/Haskell/Ghcid.hs view
@@ -170,7 +170,9 @@                 s <- return $ maybe s (removePrefix . snd) $ stripInfix ghcid_prefix s                 whenLoud $ outStrLn $ "%STDOUT2: " ++ s                 modifyIORef (if strm == Stdout then stdout else stderr) (s:)-                when (any (`isPrefixOf` s) ["GHCi, version ","GHCJSi, version "]) $ do+                when (any (`isPrefixOf` s) [ "GHCi, version "+                                           , "GHCJSi, version "+                                           , "Clashi, version " ]) $ do                     -- the thing before me may have done its own Haskell compiling                     writeIORef stdout []                     writeIORef stderr []
src/Language/Haskell/Ghcid/Parser.hs view
@@ -50,7 +50,6 @@         f (x:xs)             | not $ " " `isPrefixOfE` x             , Just (file,rest) <- breakFileColon x-            , takeExtension file `elem` [".hs",".lhs",".hs-boot",".lhs-boot"]              -- take position, including span if present             , Just ((pos1, pos2), rest) <- parsePosition rest             , (msg,las) <- span isMessageBody xs
src/Session.hs view
@@ -127,10 +127,14 @@      -- handle what the process returned     messages <- return $ mapMaybe tidyMessage messages-    writeIORef warnings [m | m@Message{..} <- messages, loadSeverity == Warning]+    writeIORef warnings $ getWarnings messages     return (messages ++ evals, loaded)  +getWarnings :: [Load] -> [Load]+getWarnings messages = [m | m@Message{..} <- messages, loadSeverity == Warning]++ -- | Call 'sessionStart' at the previous command. sessionRestart :: Session -> IO ([Load], [FilePath]) sessionRestart session@Session{..} = do@@ -198,7 +202,7 @@         -- newest warnings always go first, so the file you hit save on most recently has warnings first         messages <- return $ messages ++ filter validWarn warn -        writeIORef warnings [m | m@Message{..} <- messages, loadSeverity == Warning]+        writeIORef warnings $ getWarnings messages         return (messages ++ evals, nubOrd $ loaded ++ reloaded)  
src/Test/Ghcid.hs view
@@ -122,6 +122,11 @@         require [allGoodMessage]         write "Main.hs" "x"         require ["Main.hs:1:1"," Parse error:"]++        -- Github issue 275+        write "Main.hs" "{-# LINE 42 \"foo.bar\" #-}\nx"+        require ["foo.bar:42:1", "Parse error:"]+         write "Util.hs" "module Util where"         write "Main.hs" "import Util\nmain = print 1"         require [allGoodMessage]