From c78274f7f69876a948293e35599a0b896d850c1f Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Date: Sun, 24 Aug 2014 13:29:12 +0200 Subject: [PATCH 01/51] Try to fix each error only once --- elisp/ghc-check.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp/ghc-check.el b/elisp/ghc-check.el index 0998014..eafadfa 100644 --- a/elisp/ghc-check.el +++ b/elisp/ghc-check.el @@ -367,7 +367,7 @@ nil does not display errors/warnings. (defun ghc-check-insert-from-warning () (interactive) (let ((ret t)) - (dolist (data (mapcar (lambda (ovl) (overlay-get ovl 'ghc-msg)) (ghc-check-overlay-at (point))) ret) + (dolist (data (delete-dups (mapcar (lambda (ovl) (overlay-get ovl 'ghc-msg)) (ghc-check-overlay-at (point)))) ret) (save-excursion (cond ((string-match "Inferred type: \\|no type signature:" data) From 6cad2b5e908060ac6e3ecc729fc9e3c7d96b6867 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 23 Aug 2014 20:47:15 -0500 Subject: [PATCH 02/51] Use advice to check syntax on save-buffer --- elisp/ghc.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/elisp/ghc.el b/elisp/ghc.el index c541301..9700204 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -64,7 +64,6 @@ (defvar ghc-sort-key "\es") (defvar ghc-type-key "\C-c\C-t") (defvar ghc-info-key "\C-c\C-i") -(defvar ghc-check-key "\C-x\C-s") (defvar ghc-toggle-key "\C-c\C-c") (defvar ghc-jump-key "\C-c\C-j") (defvar ghc-module-key "\C-c\C-m") @@ -103,7 +102,6 @@ (define-key haskell-mode-map ghc-help-key 'ghc-display-errors) (define-key haskell-mode-map ghc-insert-key 'ghc-insert-template) (define-key haskell-mode-map ghc-sort-key 'ghc-sort-lines) - (define-key haskell-mode-map ghc-check-key 'ghc-save-buffer) (define-key haskell-mode-map ghc-toggle-key 'ghc-toggle-check-command) (define-key haskell-mode-map ghc-jump-key 'ghc-jump-file) (define-key haskell-mode-map ghc-module-key 'ghc-insert-module) @@ -118,7 +116,10 @@ (define-key haskell-mode-map ghc-prev-hole-key 'ghc-goto-prev-hole) (define-key haskell-mode-map ghc-next-hole-key 'ghc-goto-next-hole) (ghc-comp-init) - (setq ghc-initialized t)) + (setq ghc-initialized t) + (defadvice save-buffer (after ghc-check-syntax-on-save activate) + "Check syntax with GHC when a haskell-mode buffer is saved." + (when (eq 'haskell-mode major-mode) (ghc-check-syntax)))) (ghc-import-module) (ghc-check-syntax)) From f194b528c82cbbc458761c9fe850ad401888bfd7 Mon Sep 17 00:00:00 2001 From: Ruben Astudillo Date: Sat, 23 Aug 2014 04:00:40 -0400 Subject: [PATCH 03/51] browseIt with modified environment to solve #265 --- src/GHCModi.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GHCModi.hs b/src/GHCModi.hs index 36d2696..d14de7f 100644 --- a/src/GHCModi.hs +++ b/src/GHCModi.hs @@ -316,5 +316,11 @@ browseIt :: IOish m -> ModuleString -> GhcModT m (String, Bool, Set FilePath) browseIt set mdl = do - ret <- browse mdl + let (det,rest') = break (== ' ') mdl + rest = dropWhile (== ' ') rest' + ret <- if det == "-d" + then withOptions setDetailed (browse rest) + else browse mdl return (ret, True, set) + where + setDetailed opt = opt { detailed = True } From 510ca3d3b65fe980078b9943f3f8183887766dec Mon Sep 17 00:00:00 2001 From: randen Date: Mon, 25 Aug 2014 17:19:17 -0700 Subject: [PATCH 04/51] Don't turn C-u into a prefix command * elisp/ghc.el * There are many ways to fix issue #351 so this is just one example and may not fit the style you prefer, so please feel free to use or not. It is easy to work-around the issue by setting ghc-initial-sig-key to another key combination before ghc-init, but it would be nice to have a fix. The use of C-u for this binding seems to be just as a flag, thus this change takes the simplest fix to achieve that purpose. --- elisp/ghc.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/elisp/ghc.el b/elisp/ghc.el index 9700204..a54d586 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -73,7 +73,6 @@ (defvar ghc-shallower-key "\C-c<") (defvar ghc-deeper-key "\C-c>") ;(defvar ghc-case-split-key "\C-c\C-s") -(defvar ghc-initial-sig-key "\C-u\et") (defvar ghc-refine-key "\C-c\C-f") (defvar ghc-auto-key "\C-c\C-a") (defvar ghc-prev-hole-key "\C-c\ep") @@ -100,7 +99,7 @@ (define-key haskell-mode-map ghc-previous-key 'ghc-goto-prev-error) (define-key haskell-mode-map ghc-next-key 'ghc-goto-next-error) (define-key haskell-mode-map ghc-help-key 'ghc-display-errors) - (define-key haskell-mode-map ghc-insert-key 'ghc-insert-template) + (define-key haskell-mode-map ghc-insert-key 'ghc-insert-template-or-signature) (define-key haskell-mode-map ghc-sort-key 'ghc-sort-lines) (define-key haskell-mode-map ghc-toggle-key 'ghc-toggle-check-command) (define-key haskell-mode-map ghc-jump-key 'ghc-jump-file) @@ -110,7 +109,6 @@ (define-key haskell-mode-map ghc-shallower-key 'ghc-make-indent-shallower) (define-key haskell-mode-map ghc-deeper-key 'ghc-make-indent-deeper) ;(define-key haskell-mode-map ghc-case-split-key 'ghc-case-split) - (define-key haskell-mode-map ghc-initial-sig-key 'ghc-initial-code-from-signature) (define-key haskell-mode-map ghc-refine-key 'ghc-refine) (define-key haskell-mode-map ghc-auto-key 'ghc-auto) (define-key haskell-mode-map ghc-prev-hole-key 'ghc-goto-prev-hole) @@ -153,4 +151,10 @@ (insert "\nEnvironment variables:\n") (insert (format "\tPATH=%s\n" path)))) +(defun ghc-insert-template-or-signature (&optional flag) + (interactive "P") + (if flag + (ghc-initial-code-from-signature) + (ghc-insert-template))) + (provide 'ghc) From b728294d3d2eb2836594ea0442b4c39410c6aed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 29 Aug 2014 19:27:22 +0200 Subject: [PATCH 05/51] Bump version to 5.0.1.2 --- ChangeLog | 7 +++++++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e372862..2cd4c93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-08-29 v5.0.1.2 + * Merge #345, Try fixing duplicate errors + * Merge #344, elisp: Use advice to check syntax on save-buffer + * Merge #341, support `browse -d` in ghc-modi + * Merge #352, elisp: Fix C-u accidentally getting turned into a + prefix command + 2014-08-24 v5.0.1.1 * Fix CaseSplitting faliure when using "fancy types" (see #336) * Print error information in "spec" test suite when using `extract` diff --git a/elisp/ghc.el b/elisp/ghc.el index a54d586..17ee84a 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.0.0") +(defconst ghc-version "5.0.1.2") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 70b374e..31ac7b2 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.0.1.1 +Version: 5.0.1.2 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From 615c6c4543ea5bb884c5a7b003b76f9ecd3d0f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 12 Sep 2014 03:48:22 +0200 Subject: [PATCH 06/51] Workaround for #340 --- Language/Haskell/GhcMod/Target.hs | 14 +++++++++----- test/CheckSpec.hs | 5 +++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Language/Haskell/GhcMod/Target.hs b/Language/Haskell/GhcMod/Target.hs index 1744a72..51d64e4 100644 --- a/Language/Haskell/GhcMod/Target.hs +++ b/Language/Haskell/GhcMod/Target.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} module Language.Haskell.GhcMod.Target ( setTargetFiles ) where @@ -5,7 +6,7 @@ module Language.Haskell.GhcMod.Target ( import Control.Applicative ((<$>)) import Control.Monad (forM, void, (>=>)) import DynFlags (ExtensionFlag(..), xopt) -import GHC (DynFlags(..), LoadHowMuch(..)) +import GHC (LoadHowMuch(..)) import qualified GHC as G import Language.Haskell.GhcMod.DynFlags import Language.Haskell.GhcMod.Monad @@ -50,7 +51,10 @@ setTargetFiles files = do setCompilerMode Intelligent needsFallback :: G.ModuleGraph -> Bool -needsFallback = any (hasTHorQQ . G.ms_hspp_opts) - where - hasTHorQQ :: DynFlags -> Bool - hasTHorQQ dflags = any (`xopt` dflags) [Opt_TemplateHaskell, Opt_QuasiQuotes] +needsFallback = any $ \ms -> + let df = G.ms_hspp_opts ms in + Opt_TemplateHaskell `xopt` df + || Opt_QuasiQuotes `xopt` df +#if __GLASGOW_HASKELL__ >= 708 + || (Opt_PatternSynonyms `xopt` df) +#endif diff --git a/test/CheckSpec.hs b/test/CheckSpec.hs index c492701..7c704a4 100644 --- a/test/CheckSpec.hs +++ b/test/CheckSpec.hs @@ -31,6 +31,11 @@ spec = do res <- runID $ checkSyntax ["Baz.hs"] res `shouldSatisfy` ("Baz.hs:5:1:Warning:" `isPrefixOf`) + it "works with modules using PatternSynonyms" $ do + withDirectory_ "test/data/pattern-synonyms" $ do + res <- runID $ checkSyntax ["B.hs"] + res `shouldSatisfy` ("B.hs:6:9:Warning:" `isPrefixOf`) + it "works with foreign exports" $ do withDirectory_ "test/data" $ do res <- runID $ checkSyntax ["ForeignExport.hs"] From c532fc7eb560b702671093f927c282b7bc15ed6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 12 Sep 2014 21:19:08 +0200 Subject: [PATCH 07/51] Bump version to 5.1.0.0 --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9eb340a..54e242f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -UNRELEASED v5.1.0.0 +2014-09-12 v5.1.0.0 * GhcModError is now a recursive data type (`GMECabalConfigure`'s type changed) * GhcModT's MonadIO instance now converts IOError's to failures in From d079bf9bef5402a89b5607e36e07e4e085f1b584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 16 Sep 2014 06:20:40 +0200 Subject: [PATCH 08/51] monad-journal-0.4 fixes mtl dependency trouble --- ghc-mod.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index f4c6901..77401af 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -104,7 +104,7 @@ Library , ghc-syb-utils , hlint >= 1.8.61 , io-choice - , monad-journal >= 0.2.2.0 && < 0.2.3.2 + , monad-journal >= 0.4 , old-time , process , syb @@ -197,7 +197,7 @@ Test-Suite spec , ghc-syb-utils , hlint >= 1.7.1 , io-choice - , monad-journal >= 0.2.2.0 && < 0.2.3.2 + , monad-journal >= 0.4 , old-time , process , syb From 7c7da2d176a7f8462f448f044f171a5811192e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 16 Sep 2014 06:14:52 +0200 Subject: [PATCH 09/51] Bump version to 5.0.0.1 --- ChangeLog | 4 ++++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54e242f..a2a68d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-09-16 v5.1.0.1 + * Fix building with haskell-src-exts-1.16.0 + * Loosen monad-journal dependency + 2014-09-12 v5.1.0.0 * GhcModError is now a recursive data type (`GMECabalConfigure`'s type changed) diff --git a/elisp/ghc.el b/elisp/ghc.el index 42cdf77..c9f9167 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.1.0.0") +(defconst ghc-version "5.1.0.1") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 77401af..b394af7 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.1.0.0 +Version: 5.1.0.1 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From dfb34b719671177821bb76fddda978fc0d75a933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Wed, 17 Sep 2014 23:40:51 +0200 Subject: [PATCH 10/51] Bump version to 5.1.0.2 --- ChangeLog | 3 +++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2a68d6..6d5178b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2014-09-17 v5.1.0.2 + * Fix building with haskell-src-exts < 1.16.0 + 2014-09-16 v5.1.0.1 * Fix building with haskell-src-exts-1.16.0 * Loosen monad-journal dependency diff --git a/elisp/ghc.el b/elisp/ghc.el index c9f9167..4e7d59f 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.1.0.1") +(defconst ghc-version "5.1.0.2") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index b394af7..5abc49b 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.1.0.1 +Version: 5.1.0.2 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From 921f68eb6866f9673ae9588b755433305a0e2b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Thu, 18 Sep 2014 00:04:11 +0200 Subject: [PATCH 11/51] Add script to bump versions everywhere --- scripts/bump.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/bump.sh diff --git a/scripts/bump.sh b/scripts/bump.sh new file mode 100755 index 0000000..5c28821 --- /dev/null +++ b/scripts/bump.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Usage: $0 VERSION" >&2 + exit 1 +fi + +VERSION=$1 + +cd $(dirname $0)/.. + +sed -i 's/(defconst ghc-version ".*")/(defconst ghc-version "'"$VERSION"'")/' \ + elisp/ghc.el + +sed -r -i 's/^(Version:[[:space:]]*)[0-9.]+/\1'"$VERSION"'/' ghc-mod.cabal + +( tac ChangeLog; echo "\n$(date '+%Y-%m-%d') $VERSION" ) | tac \ + > ChangeLog.tmp + +mv ChangeLog.tmp ChangeLog + +emacs -q -nw ChangeLog + +git add ChangeLog elisp/ghc.el ghc-mod.cabal +git commit -m "Bump version to $VERSION" From 19951ecc716995546f4b2474fd1f2f93083f88d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 3 Oct 2014 21:33:01 +0200 Subject: [PATCH 12/51] bump.sh: warn on when VERSION doesn't have a 'v' prefix --- scripts/bump.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/bump.sh b/scripts/bump.sh index 5c28821..a489cea 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -7,6 +7,11 @@ fi VERSION=$1 +if ! echo $VERSION | grep "^v"; then + echo "invalid version"; + exit 1 +fi + cd $(dirname $0)/.. sed -i 's/(defconst ghc-version ".*")/(defconst ghc-version "'"$VERSION"'")/' \ From de4fc7642d05750458723dfb3a26838db45a4fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sat, 4 Oct 2014 00:02:21 +0200 Subject: [PATCH 13/51] Bump version to v5.1.1.0 --- ChangeLog | 4 ++++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d5178b..8e725b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-10-04 v5.1.1.0 + * Handle various consistency related issues: #222, #224, #326, #332 + * Add `isOutdated` to Language.Haskell.GhcMod + 2014-09-17 v5.1.0.2 * Fix building with haskell-src-exts < 1.16.0 diff --git a/elisp/ghc.el b/elisp/ghc.el index 4e7d59f..4455bac 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.1.0.2") +(defconst ghc-version "v5.1.1.0") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 5d6a156..4f35713 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.1.0.2 +Version: 5.1.1.0 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From 31058cd3f401d4553dd6b6d8bad5cb0a1bc646d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sat, 4 Oct 2014 14:03:01 +0200 Subject: [PATCH 14/51] bump.sh: Fix version formatting --- scripts/bump.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/bump.sh b/scripts/bump.sh index a489cea..d0e0765 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -7,7 +7,7 @@ fi VERSION=$1 -if ! echo $VERSION | grep "^v"; then +if echo $VERSION | grep "^[0-9.]"; then echo "invalid version"; exit 1 fi @@ -19,7 +19,7 @@ sed -i 's/(defconst ghc-version ".*")/(defconst ghc-version "'"$VERSION"'")/' \ sed -r -i 's/^(Version:[[:space:]]*)[0-9.]+/\1'"$VERSION"'/' ghc-mod.cabal -( tac ChangeLog; echo "\n$(date '+%Y-%m-%d') $VERSION" ) | tac \ +( tac ChangeLog; echo "\n$(date '+%Y-%m-%d') v$VERSION" ) | tac \ > ChangeLog.tmp mv ChangeLog.tmp ChangeLog @@ -28,3 +28,4 @@ emacs -q -nw ChangeLog git add ChangeLog elisp/ghc.el ghc-mod.cabal git commit -m "Bump version to $VERSION" +git tag "v$VERSION" From 2dcf07072bf7f53394ba2c12b3f0a81797ca5496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sat, 18 Oct 2014 19:49:59 +0200 Subject: [PATCH 15/51] Really fix bump.sh --- scripts/bump.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bump.sh b/scripts/bump.sh index d0e0765..445622e 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -7,7 +7,7 @@ fi VERSION=$1 -if echo $VERSION | grep "^[0-9.]"; then +if ! echo $VERSION | grep "^[0-9.]"; then echo "invalid version"; exit 1 fi From bbd53b9fb92a7a39fa87c0e59a352e204b801077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Thu, 30 Oct 2014 01:13:51 +0100 Subject: [PATCH 16/51] Bump version to 5.2.0.0 --- ChangeLog | 10 ++++++++++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e725b8..9b6f19c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-10-30 v5.2.0.0 + * Return type of `loadSymbolDb` is now in GhcModT + * Function `dumpSymbol` now takes the path of the target directory + * Fix #387, Pattern match failure in GhcPkg + * Fix #386, `ghc-mod version` should not check `cabal configure` + * Fix #391, Error on command `-g` when used before command despite + --help output saying this is valid + * Fix formatting of `ghc-version` constant in the elisp code. in + version 5.1.1.0 the string was "v5.1.1.0" instead of "5.1.1.0". + 2014-10-04 v5.1.1.0 * Handle various consistency related issues: #222, #224, #326, #332 * Add `isOutdated` to Language.Haskell.GhcMod diff --git a/elisp/ghc.el b/elisp/ghc.el index 4455bac..6c9b8e6 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "v5.1.1.0") +(defconst ghc-version "5.2.0.0") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 91b95e1..8a2f4a3 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.1.1.0 +Version: 5.2.0.0 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From bb17acc9a4b08affc9842dcf801882fbb437df0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 2 Nov 2014 19:27:40 +0100 Subject: [PATCH 17/51] Fix warning --- Language/Haskell/GhcMod/Utils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Language/Haskell/GhcMod/Utils.hs b/Language/Haskell/GhcMod/Utils.hs index d088992..ed48368 100644 --- a/Language/Haskell/GhcMod/Utils.hs +++ b/Language/Haskell/GhcMod/Utils.hs @@ -9,7 +9,7 @@ import System.Directory (getCurrentDirectory, setCurrentDirectory, doesFileExist import System.Exit (ExitCode(..)) import System.Process (readProcessWithExitCode) import System.Directory (getTemporaryDirectory) -import System.FilePath (splitDrive, joinDrive, pathSeparators) +import System.FilePath (splitDrive, pathSeparators) import System.IO.Temp (createTempDirectory) #ifndef SPEC import Control.Applicative ((<$>)) From 915598d8209f65349248d5aaf5aae1ec22fdcd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 2 Nov 2014 19:08:23 +0100 Subject: [PATCH 18/51] Bump version to 5.2.1.0 --- ChangeLog | 5 +++++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b6f19c..1b9659b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-02 v5.2.1.0 + * Fix `newTempDir` on Windows + * GhcModT's liftIO instance now converts GhcMOdError exceptions + into monadic failures + 2014-10-30 v5.2.0.0 * Return type of `loadSymbolDb` is now in GhcModT * Function `dumpSymbol` now takes the path of the target directory diff --git a/elisp/ghc.el b/elisp/ghc.el index 6c9b8e6..5d5f06c 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.2.0.0") +(defconst ghc-version "5.2.1.0") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 64a05fb..1ca6050 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.2.0.0 +Version: 5.2.1.0 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From 18138a7866638c840ee9e04d4a2136cf2ef2cf00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 3 Nov 2014 01:21:13 +0100 Subject: [PATCH 19/51] Bump version to 5.2.1.1 --- ChangeLog | 3 +++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b9659b..d81b5dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2014-11-03 v5.2.1.1 + * Fix `findCabalFiles` thinking `$HOME/.cabal` is a cabal file. + 2014-11-02 v5.2.1.0 * Fix `newTempDir` on Windows * GhcModT's liftIO instance now converts GhcMOdError exceptions diff --git a/elisp/ghc.el b/elisp/ghc.el index 5d5f06c..fdfb1aa 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.2.1.0") +(defconst ghc-version "5.2.1.1") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 5593d8f..3f20b13 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.2.1.0 +Version: 5.2.1.1 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From f038df4d6eeb6d0af5cc35a6d80d46393989e6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 3 Nov 2014 23:14:06 +0100 Subject: [PATCH 20/51] changelog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index d81b5dd..21f26ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-11-03 v5.2.1.1 * Fix `findCabalFiles` thinking `$HOME/.cabal` is a cabal file. + * Support `where` clauses, `let` bindings and `case` expressions + in case splitting, #400 2014-11-02 v5.2.1.0 * Fix `newTempDir` on Windows From f0fdc48c47a520ae86c8d17cd4b8bf29d25fcae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Wed, 31 Dec 2014 22:59:59 +0100 Subject: [PATCH 21/51] Bump version to 5.2.1.2 --- ChangeLog | 8 ++++++++ elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21f26ed..464c71b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-12-31 v5.2.1.2 + * Merge #377, Fix `browse` erroneously thinking haskell2010 identifiers + are operators + * Fix incompatibility with monad-control >= 1.0.0 + * Fix temporary directories not being removed properly + * Merge #405, #408, a race condition in the Emacs frontend + * Merge #403, Support unicode quotes in module regexp + 2014-11-03 v5.2.1.1 * Fix `findCabalFiles` thinking `$HOME/.cabal` is a cabal file. * Support `where` clauses, `let` bindings and `case` expressions diff --git a/elisp/ghc.el b/elisp/ghc.el index fdfb1aa..6da90b9 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.2.1.1") +(defconst ghc-version "5.2.1.2") ;; (eval-when-compile ;; (require 'haskell-mode)) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 3f20b13..3697e97 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.2.1.1 +Version: 5.2.1.2 Author: Kazu Yamamoto Daniel Gröber Alejandro Serrano From acbb7211ac3c191a7da66348e9196829051960af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 14 Aug 2015 10:46:42 +0200 Subject: [PATCH 22/51] ChangeLog --- ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 464c71b..cc05cff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-08-14 v5.3.0.0 + * Re-license majority of code under the AGPL-3 + * Add support for GHC 7.10 and Cabal 1.22 + * Remove `cabalDependPackages', `cabalAllTargets' + * Merge #434, Fix finding sandbox config file and directory. + * Merge #431, Re-add output line separator global option for expand command. + * Merge #470, Support for overriding the package-db stack + * Merge #486, Fix ineffective cache invalidation for `find` + 2014-12-31 v5.2.1.2 * Merge #377, Fix `browse` erroneously thinking haskell2010 identifiers are operators From edfce196107dbd43958d72c174ad66e4a7d30643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Wed, 16 Sep 2015 05:57:44 +0200 Subject: [PATCH 23/51] ChangeLog --- ChangeLog | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cc05cff..d889ba6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,27 @@ +2015-09-16 v5.4.0.0 + * Add support for the Stack build tool + * Fix #554, `module not interpreted` errors when using the `type` + command + * Merge #484, support for file redirection + * Add support for file redirection to Emacs frontend so + all commands should work even with unsaved files now! + * Support inserting holes in type signatures + * Merge #543, Fix URL anchors being dropped in OS X + * Fix GHC session always being dropped in interactive mode (caused + super slowness) + * Expose all internal modules because API will get a major + redesign soon anyways + * ghc-mod(i) executable must now be run in project directory for + commands other than `root` + * Add --line-prefix option for multiplexing stdout/err onto one stream + 2015-08-14 v5.3.0.0 * Re-license majority of code under the AGPL-3 * Add support for GHC 7.10 and Cabal 1.22 * Remove `cabalDependPackages', `cabalAllTargets' * Merge #434, Fix finding sandbox config file and directory. - * Merge #431, Re-add output line separator global option for expand command. + * Merge #431, Re-add output line separator global option for expand + command. * Merge #470, Support for overriding the package-db stack * Merge #486, Fix ineffective cache invalidation for `find` From dcc1620412098b7cc6b26f262494b1b29b0ad6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 4 Jan 2016 20:37:43 +0100 Subject: [PATCH 24/51] ChangeLog --- ChangeLog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index d889ba6..4aa6f0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2016-01-04 v5.5.0.0 + * Fix #665, Reinstate internally managed CWD (no more `ghc-mod root` + requirement for frontends) + * Merge #707, Support for spaces in file names when using + legacy-interactive + * Merge #694, #706, #703, Rewrite command line parser using + optparse-applicative. Thanks @lierdakil! + * Merge #693, Fix slowdown and bugs caused by excessive use of + `map-file` + * Fix #678, "No instance nor default method for class operation put" + * Fix #683, #684, a variety of caching related issues + * Fix #666, The issue of the beast >:3 + * Merge #649, elisp: Add ghc-report-errors to inhibit *GHC Error* + logging + * Fix #621, Preserve Cabal flag selection across automatic + reconfiguration + 2015-09-16 v5.4.0.0 * Add support for the Stack build tool * Fix #554, `module not interpreted` errors when using the `type` From ef8786dde28423dac3cb84b4ab01f0b4424d6686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 17 Jan 2016 20:16:33 +0100 Subject: [PATCH 25/51] ChangeLog --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4aa6f0a..3f185cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ -2016-01-04 v5.5.0.0 +2016-01-17 v5.5.0.0 + * Fix #660, cabal-helper errors when no global GHC is installed (Stack) * Fix #665, Reinstate internally managed CWD (no more `ghc-mod root` requirement for frontends) * Merge #707, Support for spaces in file names when using From c0e563fbff68ab50a6fb27ac7c9a0dd8e4ce0359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 19 Jan 2016 19:10:43 +0100 Subject: [PATCH 26/51] ChangeLog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3f185cc..b9cd935 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2016-01-17 v5.5.0.0 +2016-01-19 v5.5.0.0 * Fix #660, cabal-helper errors when no global GHC is installed (Stack) * Fix #665, Reinstate internally managed CWD (no more `ghc-mod root` requirement for frontends) From bb5ac3899a5a3830e886915ff63efa9302b91cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 19 Jan 2016 20:51:11 +0100 Subject: [PATCH 27/51] Make runGhcModT thread lock test more reliable it was failing reproducibly with `cabal test --show-details=streaming` --- test/MonadSpec.hs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/test/MonadSpec.hs b/test/MonadSpec.hs index 171dd7d..5562e70 100644 --- a/test/MonadSpec.hs +++ b/test/MonadSpec.hs @@ -20,17 +20,26 @@ spec = do describe "runGhcModT" $ it "throws an exception when run in multiple threads" $ do - mv1 :: MVar (Either SomeException ()) - <- newEmptyMVar - mv2 :: MVar (Either SomeException ()) - <- newEmptyMVar - _ <- forkOS $ putMVar mv1 =<< (try $ evaluate =<< (runD $ liftIO $ readMVar mv2 >> return ())) - _ <- forkOS $ putMVar mv2 =<< (try $ evaluate =<< (runD $ return ())) - e1 <- takeMVar mv1 - e2 <- takeMVar mv2 + mv_ex :: MVar (Either SomeException ()) + <- newEmptyMVar + mv_startup_barrier :: MVar () <- newEmptyMVar - (isLeft e1 || isLeft e2) `shouldBe` True + _t1 <- forkOS $ do + putMVar mv_startup_barrier () + -- wait (inside GhcModT) for t2 to receive the exception + _ <- runD $ liftIO $ readMVar mv_ex + return () + + _t2 <- forkOS $ do + readMVar mv_startup_barrier -- wait for t1 to start up + res <- try $ runD $ return () + res' <- evaluate res + putMVar mv_ex res' + + ex <- takeMVar mv_ex + + isLeft ex `shouldBe` True isLeft :: Either a b -> Bool isLeft (Right _) = False From bd021e42b36e6cf3bc2ca3ef908299ba97ceeee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 19 Jan 2016 20:57:05 +0100 Subject: [PATCH 28/51] Remove dependency on Safe from Setup.hs --- Setup.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Setup.hs b/Setup.hs index 00db893..2e76de4 100755 --- a/Setup.hs +++ b/Setup.hs @@ -8,7 +8,6 @@ import Distribution.Simple.InstallDirs as ID import Distribution.Simple.LocalBuildInfo import Distribution.PackageDescription -import Safe import Control.Arrow import Control.Applicative import Control.Monad @@ -142,6 +141,10 @@ parseVer str = [(ver, _)] -> ver _ -> error $ "No parse (Ver) :(\n" ++ str ++ "\n" +fromJustNote :: String -> Maybe a -> a +fromJustNote _ (Just x) = x +fromJustNote note Nothing = error $ "fromJustNote ("++note++"): " + -- sanityCheckCabalVersions args cf desc lbi = do -- (cabalInstallVer, cabalVer) <- getCabalExecVer From 737b1fe5a34ee8307345c8313d3e010b2dab6684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 10 Jul 2016 23:42:59 +0200 Subject: [PATCH 29/51] ChangeLog --- ChangeLog | 96 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9cd935..09a9f45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2016-07-10 v5.6.0.0 + * Bump cabal-helper to 0.7, adds support for Cabal-1.24 + * Merge #737, `map-file` caching issues + * Merge #767, Add `browse` option to show symbol "parents" + * Merge #731, Type constraints + * Fix #69 (via #731), Missing type constraints + * Fix #438, Case splitting not working + * Fix #790, Don't try to use 'cabal' or 'stack' when it's not installed + * Add support for GHC 8.0 + 2016-01-19 v5.5.0.0 * Fix #660, cabal-helper errors when no global GHC is installed (Stack) * Fix #665, Reinstate internally managed CWD (no more `ghc-mod root` @@ -29,9 +39,9 @@ super slowness) * Expose all internal modules because API will get a major redesign soon anyways - * ghc-mod(i) executable must now be run in project directory for - commands other than `root` - * Add --line-prefix option for multiplexing stdout/err onto one stream + * ghc-mod(i) executable must now be run in project directory for + commands other than `root` + * Add --line-prefix option for multiplexing stdout/err onto one stream 2015-08-14 v5.3.0.0 * Re-license majority of code under the AGPL-3 @@ -39,72 +49,72 @@ * Remove `cabalDependPackages', `cabalAllTargets' * Merge #434, Fix finding sandbox config file and directory. * Merge #431, Re-add output line separator global option for expand - command. + command. * Merge #470, Support for overriding the package-db stack * Merge #486, Fix ineffective cache invalidation for `find` 2014-12-31 v5.2.1.2 * Merge #377, Fix `browse` erroneously thinking haskell2010 identifiers are operators - * Fix incompatibility with monad-control >= 1.0.0 - * Fix temporary directories not being removed properly - * Merge #405, #408, a race condition in the Emacs frontend - * Merge #403, Support unicode quotes in module regexp + * Fix incompatibility with monad-control >= 1.0.0 + * Fix temporary directories not being removed properly + * Merge #405, #408, a race condition in the Emacs frontend + * Merge #403, Support unicode quotes in module regexp 2014-11-03 v5.2.1.1 - * Fix `findCabalFiles` thinking `$HOME/.cabal` is a cabal file. - * Support `where` clauses, `let` bindings and `case` expressions - in case splitting, #400 + * Fix `findCabalFiles` thinking `$HOME/.cabal` is a cabal file. + * Support `where` clauses, `let` bindings and `case` expressions + in case splitting, #400 2014-11-02 v5.2.1.0 - * Fix `newTempDir` on Windows - * GhcModT's liftIO instance now converts GhcMOdError exceptions - into monadic failures + * Fix `newTempDir` on Windows + * GhcModT's liftIO instance now converts GhcMOdError exceptions + into monadic failures 2014-10-30 v5.2.0.0 - * Return type of `loadSymbolDb` is now in GhcModT - * Function `dumpSymbol` now takes the path of the target directory - * Fix #387, Pattern match failure in GhcPkg - * Fix #386, `ghc-mod version` should not check `cabal configure` - * Fix #391, Error on command `-g` when used before command despite - --help output saying this is valid - * Fix formatting of `ghc-version` constant in the elisp code. in - version 5.1.1.0 the string was "v5.1.1.0" instead of "5.1.1.0". + * Return type of `loadSymbolDb` is now in GhcModT + * Function `dumpSymbol` now takes the path of the target directory + * Fix #387, Pattern match failure in GhcPkg + * Fix #386, `ghc-mod version` should not check `cabal configure` + * Fix #391, Error on command `-g` when used before command despite + --help output saying this is valid + * Fix formatting of `ghc-version` constant in the elisp code. in + version 5.1.1.0 the string was "v5.1.1.0" instead of "5.1.1.0". 2014-10-04 v5.1.1.0 - * Handle various consistency related issues: #222, #224, #326, #332 - * Add `isOutdated` to Language.Haskell.GhcMod + * Handle various consistency related issues: #222, #224, #326, #332 + * Add `isOutdated` to Language.Haskell.GhcMod 2014-09-17 v5.1.0.2 - * Fix building with haskell-src-exts < 1.16.0 + * Fix building with haskell-src-exts < 1.16.0 2014-09-16 v5.1.0.1 - * Fix building with haskell-src-exts-1.16.0 - * Loosen monad-journal dependency + * Fix building with haskell-src-exts-1.16.0 + * Loosen monad-journal dependency 2014-09-12 v5.1.0.0 - * GhcModError is now a recursive data type (`GMECabalConfigure`'s - type changed) - * GhcModT's MonadIO instance now converts IOError's to failures in - the ErrorT part of GhcModT on `liftIO`. - * Make `loadSymbolDb` polimorphic in the return types's monad. - * Add `hoistGhcModT` to Language.Haskell.GhcMod.Internal - * Fix `check` command for modules using `-XPatternSynonyms` - * Merge #364, Support cabal configuration flags + * GhcModError is now a recursive data type (`GMECabalConfigure`'s + type changed) + * GhcModT's MonadIO instance now converts IOError's to failures in + the ErrorT part of GhcModT on `liftIO`. + * Make `loadSymbolDb` polimorphic in the return types's monad. + * Add `hoistGhcModT` to Language.Haskell.GhcMod.Internal + * Fix `check` command for modules using `-XPatternSynonyms` + * Merge #364, Support cabal configuration flags 2014-08-29 v5.0.1.2 - * Merge #345, Try fixing duplicate errors - * Merge #344, elisp: Use advice to check syntax on save-buffer - * Merge #341, support `browse -d` in ghc-modi - * Merge #352, elisp: Fix C-u accidentally getting turned into a - prefix command + * Merge #345, Try fixing duplicate errors + * Merge #344, elisp: Use advice to check syntax on save-buffer + * Merge #341, support `browse -d` in ghc-modi + * Merge #352, elisp: Fix C-u accidentally getting turned into a + prefix command 2014-08-24 v5.0.1.1 - * Fix CaseSplitting faliure when using "fancy types" (see #336) - * Print error information in "spec" test suite when using `extract` + * Fix CaseSplitting faliure when using "fancy types" (see #336) + * Print error information in "spec" test suite when using `extract` 2014-08-20 v5.0.1 - * Fix missing file in "Data-Files" + * Fix missing file in "Data-Files" 2014-08-20 v5.0.0 * ghc-mod consumes much less memory than ghc-mod-4.1. From 2932e446e2a09afd6de31b9745cfce9d56c6c7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 11 Jul 2016 05:43:21 +0200 Subject: [PATCH 30/51] Refine project finding for stack using STACK_ENV --- Language/Haskell/GhcMod/Cradle.hs | 54 +++++++++++++++++++------------ 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/Language/Haskell/GhcMod/Cradle.hs b/Language/Haskell/GhcMod/Cradle.hs index 05f6b31..730c76b 100644 --- a/Language/Haskell/GhcMod/Cradle.hs +++ b/Language/Haskell/GhcMod/Cradle.hs @@ -25,6 +25,7 @@ import Control.Monad.Trans.Maybe import Data.Maybe import System.Directory import System.FilePath +import System.Environment import Prelude import Control.Monad.Trans.Journal (runJournalT) @@ -77,15 +78,17 @@ fillTempDir crdl = do cabalCradle :: (IOish m, GmLog m, GmOut m) => FilePath -> FilePath -> MaybeT m Cradle cabalCradle cabalProg wdir = do - -- If cabal doesn't exist the user probably wants to use something else - whenM ((==Nothing) <$> liftIO (findExecutable cabalProg)) $ do - gmLog GmInfo "" $ text "'dist/setup-config' exists but 'cabal' executable wasn't found" - mzero - cabalFile <- MaybeT $ liftIO $ findCabalFile wdir let cabalDir = takeDirectory cabalFile - gmLog GmInfo "" $ text "found Cabal project at" <+>: text cabalDir + gmLog GmInfo "" $ text "Found Cabal project at" <+>: text cabalDir + + -- If cabal doesn't exist the user probably wants to use something else + whenM ((==Nothing) <$> liftIO (findExecutable cabalProg)) $ do + gmLog GmInfo "" $ text "'cabal' executable wasn't found, trying next project type" + mzero + + gmLog GmInfo "" $ text "Using Cabal project at" <+>: text cabalDir return Cradle { cradleProject = CabalProject , cradleCurrentDir = wdir @@ -103,26 +106,37 @@ stackCradle stackProg wdir = do mzero #endif - -- If cabal doesn't exist the user probably wants to use something else - whenM ((==Nothing) <$> liftIO (findExecutable stackProg)) $ do - gmLog GmInfo "" $ text "'dist/setup-config' exists but 'cabal' executable wasn't found" - mzero - cabalFile <- MaybeT $ liftIO $ findCabalFile wdir - let cabalDir = takeDirectory cabalFile - _stackConfigFile <- MaybeT $ liftIO $ findStackConfigFile cabalDir - -- If dist/setup-config already exists the user probably wants to use cabal - -- rather than stack, or maybe that's just me ;) - whenM (liftIO $ doesFileExist $ cabalDir setupConfigPath "dist") $ do - gmLog GmWarning "" $ text "'dist/setup-config' exists, ignoring Stack and using cabal-install instead" - mzero + gmLog GmInfo "" $ text "Found Stack project at" <+>: text cabalDir + + stackExeSet <- liftIO $ isJust <$> lookupEnv "STACK_EXE" + stackExeExists <- liftIO $ isJust <$> findExecutable stackProg + setupCfgExists <- liftIO $ doesFileExist $ cabalDir setupConfigPath "dist" + + case (stackExeExists, stackExeSet) of + (False, True) -> do + gmLog GmWarning "" $ text "'stack' executable wasn't found but STACK_EXE is set, trying next project type" + mzero + + (False, False) -> do + gmLog GmInfo "" $ text "'stack' executable wasn't found, trying next project type" + mzero + + (True, True) -> do + gmLog GmWarning "" $ text "STACK_EXE set, preferring Stack project" + + (True, False) | setupCfgExists -> do + gmLog GmWarning "" $ text "'dist/setup-config' exists, ignoring Stack project" + mzero + + (True, False) -> return () senv <- MaybeT $ getStackEnv cabalDir - gmLog GmInfo "" $ text "found Stack project at" <+>: text cabalDir + gmLog GmInfo "" $ text "Using Stack project at" <+>: text cabalDir return Cradle { cradleProject = StackProject senv , cradleCurrentDir = wdir @@ -149,7 +163,7 @@ stackCradleSpec stackProg wdir = do sandboxCradle :: (IOish m, GmLog m, GmOut m) => FilePath -> MaybeT m Cradle sandboxCradle wdir = do sbDir <- MaybeT $ liftIO $ findCabalSandboxDir wdir - gmLog GmInfo "" $ text "Found sandbox project at" <+>: text sbDir + gmLog GmInfo "" $ text "Using sandbox project at" <+>: text sbDir return Cradle { cradleProject = SandboxProject , cradleCurrentDir = wdir From 44efb6e8952997705e5721f1ba92ac644bad3ab9 Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Mon, 11 Jul 2016 17:49:18 +0300 Subject: [PATCH 31/51] Fix HLint ignore Closes #800 --- Language/Haskell/GhcMod/Lint.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Language/Haskell/GhcMod/Lint.hs b/Language/Haskell/GhcMod/Lint.hs index a506565..0ffe713 100644 --- a/Language/Haskell/GhcMod/Lint.hs +++ b/Language/Haskell/GhcMod/Lint.hs @@ -25,7 +25,7 @@ lint opt file = ghandle handler $ liftIO $ hSetEncoding hSrc (encoding flags) res <- liftIO $ parseModuleEx flags file =<< Just `fmap` hGetContents hSrc case res of - Right m -> pack . map show $ applyHints classify hint [m] + Right m -> pack . map show $ filter ((/=Ignore) . ideaSeverity) $ applyHints classify hint [m] Left ParseError{parseErrorLocation=loc, parseErrorMessage=err} -> return $ showSrcLoc loc ++ ":Error:" ++ err ++ "\n" where From deef7036d06072fbccb6c17369ac7e28ad341482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 29 Jul 2016 15:18:08 +0200 Subject: [PATCH 32/51] ChangeLog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 09a9f45..04577ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2016-07-10 v5.6.0.0 +2016-07-29 v5.6.0.0 * Bump cabal-helper to 0.7, adds support for Cabal-1.24 * Merge #737, `map-file` caching issues * Merge #767, Add `browse` option to show symbol "parents" From cbe07e8c85b6ec08718e8e162eb246492fd9f7cb Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Mon, 11 Jul 2016 20:13:39 +0200 Subject: [PATCH 33/51] Add cabal.project to allow "cabal new-build" Note: this is needed if any other project (such as HaRe) wants to use "cabal new-build" having ghc-mod as a dependency. Otherwise it is innocuous --- .gitignore | 1 + cabal.project | 3 +++ ghc-mod.cabal | 1 + 3 files changed, 5 insertions(+) create mode 100644 cabal.project diff --git a/.gitignore b/.gitignore index 05fd776..a774166 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ cabal.sandbox.config cabal-dev /TAGS /tags +/cabal.project.local diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..4c4949f --- /dev/null +++ b/cabal.project @@ -0,0 +1,3 @@ +-- do not build sub-packages when using features from +-- http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/ +packages: . diff --git a/ghc-mod.cabal b/ghc-mod.cabal index d2d8e9d..2964579 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -31,6 +31,7 @@ Data-Files: elisp/Makefile elisp/*.el Data-Files: LICENSE COPYING.BSD3 COPYING.AGPL3 Extra-Source-Files: ChangeLog + cabal.project SetupCompat.hs NotCPP/*.hs NotCPP/COPYING From 93138a50bb4726ee89cc4801e46f328bb2d748cd Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Thu, 12 Jan 2017 20:31:07 +0200 Subject: [PATCH 34/51] Update 5.6.0.0 to work with latest optparse-applicative And ghc-8.0.2 --- ghc-mod.cabal | 13 +++++++------ src/GHCMod/Options/Commands.hs | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 2964579..b909a42 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.6.0.0 +Version: 5.7.0.0 Author: Kazu Yamamoto , Daniel Gröber , Alejandro Serrano , @@ -177,7 +177,7 @@ Library , containers < 0.6 , cabal-helper < 0.8 && >= 0.7.1.0 , deepseq < 1.5 - , directory < 1.3 + , directory < 1.4 , filepath < 1.5 , ghc < 8.2 && >= 7.6 , ghc-paths < 0.2 @@ -202,7 +202,7 @@ Library , extra == 1.4.* , pipes == 4.1.* , safe < 0.4 && >= 0.3.9 - , optparse-applicative >=0.11.0 && <0.13.0 + , optparse-applicative >=0.13.0 && <0.14.0 , template-haskell , syb if impl(ghc < 7.8) @@ -222,7 +222,7 @@ Executable ghc-mod Default-Extensions: ConstraintKinds, FlexibleContexts HS-Source-Dirs: src Build-Depends: base < 5 && >= 4.0 - , directory < 1.3 + , directory < 1.4 , filepath < 1.5 , pretty < 1.2 , process < 1.5 @@ -231,7 +231,8 @@ Executable ghc-mod , ghc < 8.1 , monad-control ==1.0.* , fclabels ==2.0.* - , optparse-applicative >=0.11.0 && <0.13.0 + , optparse-applicative >=0.13.0 && <0.14.0 + , semigroups < 0.19 && >= 0.10.0 , ghc-mod Executable ghc-modi @@ -247,7 +248,7 @@ Executable ghc-modi Build-Depends: base < 5 && >= 4.0 , binary < 0.9 && >= 0.5.1.0 , deepseq < 1.5 - , directory < 1.3 + , directory < 1.4 , filepath < 1.5 , process < 1.5 , old-time < 1.2 diff --git a/src/GHCMod/Options/Commands.hs b/src/GHCMod/Options/Commands.hs index 688905f..9a486ac 100644 --- a/src/GHCMod/Options/Commands.hs +++ b/src/GHCMod/Options/Commands.hs @@ -18,6 +18,7 @@ module GHCMod.Options.Commands where +import Data.Semigroup import Options.Applicative import Options.Applicative.Types import Options.Applicative.Builder.Internal @@ -289,8 +290,8 @@ hsubparser' :: Mod CommandFields a -> Parser a hsubparser' m = mkParser d g rdr where Mod _ d g = m `mappend` metavar "" - (cmds, subs) = mkCommand m - rdr = CmdReader cmds (fmap add_helper . subs) + (ms,cmds, subs) = mkCommand m + rdr = CmdReader ms cmds (fmap add_helper . subs) add_helper pinfo = pinfo { infoParser = infoParser pinfo <**> helper } From 358465511840bae3ff771572586d65dd12fec3bd Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Fri, 13 Jan 2017 13:01:39 +0200 Subject: [PATCH 35/51] Update haskell-src-exts, extra, pipes to current As per stackage nightly-2017-01-13 --- Language/Haskell/GhcMod/FillSig.hs | 4 ++-- Language/Haskell/GhcMod/SrcUtils.hs | 4 ++-- ghc-mod.cabal | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Language/Haskell/GhcMod/FillSig.hs b/Language/Haskell/GhcMod/FillSig.hs index 3f7ae4c..3e03ec0 100644 --- a/Language/Haskell/GhcMod/FillSig.hs +++ b/Language/Haskell/GhcMod/FillSig.hs @@ -27,7 +27,7 @@ import qualified HsBinds as Ty import qualified Class as Ty import qualified Var as Ty import qualified HsPat as Ty -import qualified Language.Haskell.Exts.Annotated as HE +import qualified Language.Haskell.Exts as HE import Djinn.GHC import qualified Language.Haskell.GhcMod.Gap as Gap @@ -191,7 +191,7 @@ getSignatureFromHE file lineNo colNo = do HE.TypeSig (HE.SrcSpanInfo s _) names ty -> return $ HESignature s names ty - HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ -> + HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ _ -> let (name, tys) = dHeadTyVars declHead in return $ HEFamSignature s Open name (map cleanTyVarBind tys) diff --git a/Language/Haskell/GhcMod/SrcUtils.hs b/Language/Haskell/GhcMod/SrcUtils.hs index fb36289..5829fde 100644 --- a/Language/Haskell/GhcMod/SrcUtils.hs +++ b/Language/Haskell/GhcMod/SrcUtils.hs @@ -16,7 +16,7 @@ import qualified Var as G import qualified Type as G import GHC.SYB.Utils import GhcMonad -import qualified Language.Haskell.Exts.Annotated as HE +import qualified Language.Haskell.Exts as HE import Language.Haskell.GhcMod.Doc import Language.Haskell.GhcMod.Gap import qualified Language.Haskell.GhcMod.Gap as Gap @@ -175,7 +175,7 @@ fourIntsHE loc = ( HE.srcSpanStartLine loc, HE.srcSpanStartColumn loc typeSigInRangeHE :: Int -> Int -> HE.Decl HE.SrcSpanInfo -> Bool typeSigInRangeHE lineNo colNo (HE.TypeSig (HE.SrcSpanInfo s _) _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) -typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _) = +typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) typeSigInRangeHE lineNo colNo (HE.DataFamDecl (HE.SrcSpanInfo s _) _ _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index b909a42..950ac53 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -195,12 +195,12 @@ Library , mtl < 2.3 && >= 2.0 , monad-control < 1.1 && >= 1 , split < 0.3 - , haskell-src-exts < 1.18 + , haskell-src-exts < 1.19 && >= 1.18 , text < 1.3 , djinn-ghc < 0.1 && >= 0.0.2.2 , fclabels == 2.0.* - , extra == 1.4.* - , pipes == 4.1.* + , extra == 1.5.* + , pipes == 4.3.* , safe < 0.4 && >= 0.3.9 , optparse-applicative >=0.13.0 && <0.14.0 , template-haskell From 14972cacd6f4c7bd15616586b93a4aaa4cac5570 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Mon, 16 Jan 2017 17:40:46 +0200 Subject: [PATCH 36/51] Exclude GHC 7.8 as a valid compiler Because it has transformers-0.3 baked in, and that is too old --- ghc-mod.cabal | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 950ac53..92f2b9b 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -27,6 +27,11 @@ Description: Category: GHC, Development Cabal-Version: >= 1.14 Build-Type: Custom +Tested-With: GHC == 7.6.3 + -- Note: GHC 7.8.4 not supported due to very old bundled transformers + , GHC == 7.10.3 + , GHC == 8.0.1 + , GHC == 8.0.2 Data-Files: elisp/Makefile elisp/*.el Data-Files: LICENSE COPYING.BSD3 COPYING.AGPL3 @@ -245,7 +250,7 @@ Executable ghc-modi Cpp-Options: -DWINDOWS Default-Extensions: ConstraintKinds, FlexibleContexts HS-Source-Dirs: src, . - Build-Depends: base < 5 && >= 4.0 + Build-Depends: base (< 5 && > 4.7) || (>= 4.0 && < 4.7) , binary < 0.9 && >= 0.5.1.0 , deepseq < 1.5 , directory < 1.4 From 5df1480309a3e30690d625602376f0671481f388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 15 Jan 2017 22:45:49 +0100 Subject: [PATCH 37/51] Add .gitlab-ci.yml --- .gitlab-ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5c690f7 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,46 @@ +stages: + - build + +before_script: + - cabal update + - mkdir -p ../ghc-mod.sdist + - ls -l .. + - touch ChangeLog + - cabal sdist --output-directory=../ghc-mod.sdist + - rm -f cabal.sandbox.config && cabal sandbox init + - cp cabal.sandbox.config ../ghc-mod.sdist + - cd ../ghc-mod.sdist + +after_script: + - rm -rf "$CI_PROJECT_DIR"/../ghc-mod.sdist + +.job_template: &common_script + script: + - echo $PWD + - ghc-pkg list + - cabal install --user --only-dependencies -j2 --force-reinstalls --upgrade-dependencies --enable-tests --enable-documentation + - which cabal + - cabal --version + - cabal configure --enable-tests + - cabal build -j2 + - ghc-pkg list + - which cabal + - cabal --version + - ./dist/build/spec/spec + - ./dist/build/doctest/doctest + - cabal haddock + +job-ghc801: + image: haskell:8.0.1 + stage: build + <<: *common_script + +job-ghc710: + image: haskell:7.10.3 + stage: build + <<: *common_script + +job-ghc708: + image: haskell:7.8.4 + stage: build + <<: *common_script From 9bd39a855acea2640828a8771f1d27bbf9d319eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 16 Jan 2017 20:56:57 +0100 Subject: [PATCH 38/51] CPP around optparse-applicative and hse conflicts --- Language/Haskell/GhcMod/FillSig.hs | 8 ++++++++ Language/Haskell/GhcMod/SrcUtils.hs | 8 ++++++++ ghc-mod.cabal | 8 ++++---- src/GHCMod/Options/Commands.hs | 9 ++++++++- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Language/Haskell/GhcMod/FillSig.hs b/Language/Haskell/GhcMod/FillSig.hs index 3e03ec0..7b4f3ba 100644 --- a/Language/Haskell/GhcMod/FillSig.hs +++ b/Language/Haskell/GhcMod/FillSig.hs @@ -27,7 +27,11 @@ import qualified HsBinds as Ty import qualified Class as Ty import qualified Var as Ty import qualified HsPat as Ty +#if MIN_VERSION_haskell_src_exts(1,18,0) import qualified Language.Haskell.Exts as HE +#else +import qualified Language.Haskell.Exts.Annotated as HE +#endif import Djinn.GHC import qualified Language.Haskell.GhcMod.Gap as Gap @@ -191,7 +195,11 @@ getSignatureFromHE file lineNo colNo = do HE.TypeSig (HE.SrcSpanInfo s _) names ty -> return $ HESignature s names ty +#if MIN_VERSION_haskell_src_exts(1,18,0) HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ _ -> +#else + HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ -> +#endif let (name, tys) = dHeadTyVars declHead in return $ HEFamSignature s Open name (map cleanTyVarBind tys) diff --git a/Language/Haskell/GhcMod/SrcUtils.hs b/Language/Haskell/GhcMod/SrcUtils.hs index 5829fde..912de92 100644 --- a/Language/Haskell/GhcMod/SrcUtils.hs +++ b/Language/Haskell/GhcMod/SrcUtils.hs @@ -16,7 +16,11 @@ import qualified Var as G import qualified Type as G import GHC.SYB.Utils import GhcMonad +#if MIN_VERSION_haskell_src_exts(1,18,0) import qualified Language.Haskell.Exts as HE +#else +import qualified Language.Haskell.Exts.Annotated as HE +#endif import Language.Haskell.GhcMod.Doc import Language.Haskell.GhcMod.Gap import qualified Language.Haskell.GhcMod.Gap as Gap @@ -175,7 +179,11 @@ fourIntsHE loc = ( HE.srcSpanStartLine loc, HE.srcSpanStartColumn loc typeSigInRangeHE :: Int -> Int -> HE.Decl HE.SrcSpanInfo -> Bool typeSigInRangeHE lineNo colNo (HE.TypeSig (HE.SrcSpanInfo s _) _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) +#if MIN_VERSION_haskell_src_exts(1,18,0) typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _ _) = +#else +typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _) = +#endif HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) typeSigInRangeHE lineNo colNo (HE.DataFamDecl (HE.SrcSpanInfo s _) _ _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 92f2b9b..20af5b7 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -200,14 +200,14 @@ Library , mtl < 2.3 && >= 2.0 , monad-control < 1.1 && >= 1 , split < 0.3 - , haskell-src-exts < 1.19 && >= 1.18 + , haskell-src-exts < 1.19 && >= 1.16.0.1 , text < 1.3 , djinn-ghc < 0.1 && >= 0.0.2.2 , fclabels == 2.0.* , extra == 1.5.* , pipes == 4.3.* , safe < 0.4 && >= 0.3.9 - , optparse-applicative >=0.13.0 && <0.14.0 + , optparse-applicative >=0.11.0 && <0.14.0 , template-haskell , syb if impl(ghc < 7.8) @@ -236,7 +236,7 @@ Executable ghc-mod , ghc < 8.1 , monad-control ==1.0.* , fclabels ==2.0.* - , optparse-applicative >=0.13.0 && <0.14.0 + , optparse-applicative >=0.11.0 && <0.14.0 , semigroups < 0.19 && >= 0.10.0 , ghc-mod @@ -250,7 +250,7 @@ Executable ghc-modi Cpp-Options: -DWINDOWS Default-Extensions: ConstraintKinds, FlexibleContexts HS-Source-Dirs: src, . - Build-Depends: base (< 5 && > 4.7) || (>= 4.0 && < 4.7) + Build-Depends: base < 5 && >= 4.0 , binary < 0.9 && >= 0.5.1.0 , deepseq < 1.5 , directory < 1.4 diff --git a/src/GHCMod/Options/Commands.hs b/src/GHCMod/Options/Commands.hs index 9a486ac..38c6c25 100644 --- a/src/GHCMod/Options/Commands.hs +++ b/src/GHCMod/Options/Commands.hs @@ -13,12 +13,14 @@ -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE CPP, OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module GHCMod.Options.Commands where +#if MIN_VERSION_optparse_applicative(0,13,0) import Data.Semigroup +#endif import Options.Applicative import Options.Applicative.Types import Options.Applicative.Builder.Internal @@ -290,8 +292,13 @@ hsubparser' :: Mod CommandFields a -> Parser a hsubparser' m = mkParser d g rdr where Mod _ d g = m `mappend` metavar "" +#if MIN_VERSION_optparse_applicative(0,13,0) (ms,cmds, subs) = mkCommand m rdr = CmdReader ms cmds (fmap add_helper . subs) +#else + (cmds, subs) = mkCommand m + rdr = CmdReader cmds (fmap add_helper . subs) +#endif add_helper pinfo = pinfo { infoParser = infoParser pinfo <**> helper } From cb9ddf86e3bbdaee79c6ee443969c0691016a4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 16 Jan 2017 20:56:57 +0100 Subject: [PATCH 39/51] CPP around optparse-applicative and hse conflicts --- Language/Haskell/GhcMod/FillSig.hs | 8 ++++++++ Language/Haskell/GhcMod/SrcUtils.hs | 8 ++++++++ ghc-mod.cabal | 12 ++++++------ src/GHCMod/Options/Commands.hs | 9 ++++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Language/Haskell/GhcMod/FillSig.hs b/Language/Haskell/GhcMod/FillSig.hs index 3e03ec0..7b4f3ba 100644 --- a/Language/Haskell/GhcMod/FillSig.hs +++ b/Language/Haskell/GhcMod/FillSig.hs @@ -27,7 +27,11 @@ import qualified HsBinds as Ty import qualified Class as Ty import qualified Var as Ty import qualified HsPat as Ty +#if MIN_VERSION_haskell_src_exts(1,18,0) import qualified Language.Haskell.Exts as HE +#else +import qualified Language.Haskell.Exts.Annotated as HE +#endif import Djinn.GHC import qualified Language.Haskell.GhcMod.Gap as Gap @@ -191,7 +195,11 @@ getSignatureFromHE file lineNo colNo = do HE.TypeSig (HE.SrcSpanInfo s _) names ty -> return $ HESignature s names ty +#if MIN_VERSION_haskell_src_exts(1,18,0) HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ _ -> +#else + HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ -> +#endif let (name, tys) = dHeadTyVars declHead in return $ HEFamSignature s Open name (map cleanTyVarBind tys) diff --git a/Language/Haskell/GhcMod/SrcUtils.hs b/Language/Haskell/GhcMod/SrcUtils.hs index 5829fde..912de92 100644 --- a/Language/Haskell/GhcMod/SrcUtils.hs +++ b/Language/Haskell/GhcMod/SrcUtils.hs @@ -16,7 +16,11 @@ import qualified Var as G import qualified Type as G import GHC.SYB.Utils import GhcMonad +#if MIN_VERSION_haskell_src_exts(1,18,0) import qualified Language.Haskell.Exts as HE +#else +import qualified Language.Haskell.Exts.Annotated as HE +#endif import Language.Haskell.GhcMod.Doc import Language.Haskell.GhcMod.Gap import qualified Language.Haskell.GhcMod.Gap as Gap @@ -175,7 +179,11 @@ fourIntsHE loc = ( HE.srcSpanStartLine loc, HE.srcSpanStartColumn loc typeSigInRangeHE :: Int -> Int -> HE.Decl HE.SrcSpanInfo -> Bool typeSigInRangeHE lineNo colNo (HE.TypeSig (HE.SrcSpanInfo s _) _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) +#if MIN_VERSION_haskell_src_exts(1,18,0) typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _ _) = +#else +typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _) = +#endif HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) typeSigInRangeHE lineNo colNo (HE.DataFamDecl (HE.SrcSpanInfo s _) _ _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 92f2b9b..3ed6b47 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -200,14 +200,14 @@ Library , mtl < 2.3 && >= 2.0 , monad-control < 1.1 && >= 1 , split < 0.3 - , haskell-src-exts < 1.19 && >= 1.18 + , haskell-src-exts < 1.19 && >= 1.16.0.1 , text < 1.3 , djinn-ghc < 0.1 && >= 0.0.2.2 , fclabels == 2.0.* - , extra == 1.5.* - , pipes == 4.3.* + , extra < 1.6 && >= 1.4 + , pipes < 4.4 && >= 4.1 , safe < 0.4 && >= 0.3.9 - , optparse-applicative >=0.13.0 && <0.14.0 + , optparse-applicative >=0.11.0 && <0.14.0 , template-haskell , syb if impl(ghc < 7.8) @@ -236,7 +236,7 @@ Executable ghc-mod , ghc < 8.1 , monad-control ==1.0.* , fclabels ==2.0.* - , optparse-applicative >=0.13.0 && <0.14.0 + , optparse-applicative >=0.11.0 && <0.14.0 , semigroups < 0.19 && >= 0.10.0 , ghc-mod @@ -250,7 +250,7 @@ Executable ghc-modi Cpp-Options: -DWINDOWS Default-Extensions: ConstraintKinds, FlexibleContexts HS-Source-Dirs: src, . - Build-Depends: base (< 5 && > 4.7) || (>= 4.0 && < 4.7) + Build-Depends: base < 5 && >= 4.0 , binary < 0.9 && >= 0.5.1.0 , deepseq < 1.5 , directory < 1.4 diff --git a/src/GHCMod/Options/Commands.hs b/src/GHCMod/Options/Commands.hs index 9a486ac..38c6c25 100644 --- a/src/GHCMod/Options/Commands.hs +++ b/src/GHCMod/Options/Commands.hs @@ -13,12 +13,14 @@ -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE CPP, OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module GHCMod.Options.Commands where +#if MIN_VERSION_optparse_applicative(0,13,0) import Data.Semigroup +#endif import Options.Applicative import Options.Applicative.Types import Options.Applicative.Builder.Internal @@ -290,8 +292,13 @@ hsubparser' :: Mod CommandFields a -> Parser a hsubparser' m = mkParser d g rdr where Mod _ d g = m `mappend` metavar "" +#if MIN_VERSION_optparse_applicative(0,13,0) (ms,cmds, subs) = mkCommand m rdr = CmdReader ms cmds (fmap add_helper . subs) +#else + (cmds, subs) = mkCommand m + rdr = CmdReader cmds (fmap add_helper . subs) +#endif add_helper pinfo = pinfo { infoParser = infoParser pinfo <**> helper } From 649a39fed68908af47bfacf943652955daa4987c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 16 Jan 2017 21:58:00 +0100 Subject: [PATCH 40/51] Add tested-with: ghc-7.8 [skip ci] --- ghc-mod.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 3ed6b47..bdfeda2 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -28,7 +28,7 @@ Category: GHC, Development Cabal-Version: >= 1.14 Build-Type: Custom Tested-With: GHC == 7.6.3 - -- Note: GHC 7.8.4 not supported due to very old bundled transformers + GHC == 7.8.4 , GHC == 7.10.3 , GHC == 8.0.1 , GHC == 8.0.2 From 6ee5d04bbf8d562117041db46f55847c15b6ea33 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Mon, 16 Jan 2017 23:17:33 +0200 Subject: [PATCH 41/51] Update bounds --- ghc-mod.cabal | 45 +++++++++++++++++++++++---------------------- stack-8.yaml | 5 +++-- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 20af5b7..e9dcd58 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -180,38 +180,39 @@ Library , bytestring < 0.11 , binary < 0.9 && >= 0.5.1.0 , containers < 0.6 - , cabal-helper < 0.8 && >= 0.7.1.0 + , cabal-helper < 0.8 && >= 0.7.2.0 , deepseq < 1.5 - , directory < 1.4 + , directory < 1.5 , filepath < 1.5 , ghc < 8.2 && >= 7.6 - , ghc-paths < 0.2 - , ghc-syb-utils < 0.3 + , ghc-paths < 0.2 && >= 0.1.0.9 + , ghc-syb-utils < 0.3 && >= 0.2.3 , hlint < 1.10 && >= 1.9.27 , monad-journal < 0.8 && >= 0.4 , old-time < 1.2 , pretty < 1.2 , process < 1.5 - , syb < 0.7 - , temporary < 1.3 + , syb < 0.7 && >= 0.5.1 + , temporary < 1.3 && >= 1.2.0.3 + , transformers < 0.6 , time < 1.7 , transformers < 0.6 - , transformers-base < 0.5 - , mtl < 2.3 && >= 2.0 - , monad-control < 1.1 && >= 1 - , split < 0.3 + , transformers-base < 0.5 && >= 0.4.4 + , mtl < 2.3 && >= 2.0 + , monad-control < 1.1 && >= 1 + , split < 0.3 && >= 0.2.2 , haskell-src-exts < 1.19 && >= 1.16.0.1 - , text < 1.3 - , djinn-ghc < 0.1 && >= 0.0.2.2 + , text < 1.3 && >= 1.2.1.3 + , djinn-ghc < 0.1 && >= 0.0.2.2 , fclabels == 2.0.* - , extra == 1.5.* - , pipes == 4.3.* + , extra < 1.6 && >= 1.4.0 + , pipes < 4.4 && >= 4.1.0 , safe < 0.4 && >= 0.3.9 , optparse-applicative >=0.11.0 && <0.14.0 , template-haskell , syb if impl(ghc < 7.8) - Build-Depends: convertible + Build-Depends: convertible < 1.2 && >= 1.1.0.0 if impl(ghc >= 8.0) Build-Depends: ghc-boot @@ -227,14 +228,14 @@ Executable ghc-mod Default-Extensions: ConstraintKinds, FlexibleContexts HS-Source-Dirs: src Build-Depends: base < 5 && >= 4.0 - , directory < 1.4 + , directory < 1.5 , filepath < 1.5 , pretty < 1.2 , process < 1.5 - , split < 0.3 + , split < 0.3 && >= 0.2.2 , mtl < 2.3 && >= 2.0 - , ghc < 8.1 - , monad-control ==1.0.* + , ghc < 8.2 && >= 7.6 + , monad-control < 1.1 && >= 1 , fclabels ==2.0.* , optparse-applicative >=0.11.0 && <0.14.0 , semigroups < 0.19 && >= 0.10.0 @@ -253,7 +254,7 @@ Executable ghc-modi Build-Depends: base < 5 && >= 4.0 , binary < 0.9 && >= 0.5.1.0 , deepseq < 1.5 - , directory < 1.4 + , directory < 1.5 , filepath < 1.5 , process < 1.5 , old-time < 1.2 @@ -268,7 +269,7 @@ Test-Suite doctest Default-Extensions: ConstraintKinds, FlexibleContexts Main-Is: doctests.hs Build-Depends: base - , doctest >= 0.9.3 + , doctest < 0.12 && >= 0.9.3 Test-Suite spec Default-Language: Haskell2010 @@ -298,7 +299,7 @@ Test-Suite spec FileMappingSpec ShellParseSpec - Build-Depends: hspec >= 2.0.0 + Build-Depends: hspec < 2.4 && >= 2.0.0 X-Build-Depends-Like: CLibName Source-Repository head diff --git a/stack-8.yaml b/stack-8.yaml index 2d4ead8..fbff698 100644 --- a/stack-8.yaml +++ b/stack-8.yaml @@ -1,5 +1,6 @@ +resolver: nightly-2017-01-16 flags: {} packages: - '.' -extra-deps: [] -resolver: nightly-2016-06-04 +extra-deps: +- cabal-helper-0.7.2.0 From 7399619e052485e3ee511cef40976683612a3b26 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Mon, 16 Jan 2017 23:37:35 +0200 Subject: [PATCH 42/51] Use newer cabal-helper. And fix directory upper bound --- ghc-mod.cabal | 8 ++++---- stack-8.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index e9dcd58..46cf899 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -180,9 +180,9 @@ Library , bytestring < 0.11 , binary < 0.9 && >= 0.5.1.0 , containers < 0.6 - , cabal-helper < 0.8 && >= 0.7.2.0 + , cabal-helper < 0.8 && >= 0.7.3.0 , deepseq < 1.5 - , directory < 1.5 + , directory < 1.4 , filepath < 1.5 , ghc < 8.2 && >= 7.6 , ghc-paths < 0.2 && >= 0.1.0.9 @@ -228,7 +228,7 @@ Executable ghc-mod Default-Extensions: ConstraintKinds, FlexibleContexts HS-Source-Dirs: src Build-Depends: base < 5 && >= 4.0 - , directory < 1.5 + , directory < 1.4 , filepath < 1.5 , pretty < 1.2 , process < 1.5 @@ -254,7 +254,7 @@ Executable ghc-modi Build-Depends: base < 5 && >= 4.0 , binary < 0.9 && >= 0.5.1.0 , deepseq < 1.5 - , directory < 1.5 + , directory < 1.4 , filepath < 1.5 , process < 1.5 , old-time < 1.2 diff --git a/stack-8.yaml b/stack-8.yaml index fbff698..9ec79cd 100644 --- a/stack-8.yaml +++ b/stack-8.yaml @@ -3,4 +3,4 @@ flags: {} packages: - '.' extra-deps: -- cabal-helper-0.7.2.0 +- cabal-helper-0.7.3.0 From 4827fafe43c0101d5dd3384d204e277992541690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 16 Jan 2017 23:14:49 +0100 Subject: [PATCH 43/51] Bump version to 5.7.0.0 --- elisp/ghc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp/ghc.el b/elisp/ghc.el index 5c35f05..9b1c0f2 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.6.0.0") +(defconst ghc-version "5.7.0.0") (defgroup ghc-mod '() "ghc-mod customization") From c3d0a681a19261817cf928685f7b96878fe51e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 16 Jan 2017 23:15:02 +0100 Subject: [PATCH 44/51] ChangeLog --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 04577ae..4fe58f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-01-16 v5.7.0.0 + * Bump cabal-helper to 0.7.3.0 to support Cabal-1.24.1.0 + * Bump haskell-src-exts, optparse-applicative, pipes and extra + to be compatible with stackage. + 2016-07-29 v5.6.0.0 * Bump cabal-helper to 0.7, adds support for Cabal-1.24 * Merge #737, `map-file` caching issues From 9ab25526b8690daecaa3d34a7e30f022f7b388bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 26 May 2017 22:42:04 +0200 Subject: [PATCH 45/51] Bump version to 5.8.0.0 --- elisp/ghc.el | 2 +- ghc-mod.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elisp/ghc.el b/elisp/ghc.el index 5c35f05..bb054b2 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.6.0.0") +(defconst ghc-version "5.8.0.0") (defgroup ghc-mod '() "ghc-mod customization") diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 3a11e33..61d473b 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.6.0.0 +Version: 5.8.0.0 Author: Kazu Yamamoto , Daniel Gröber , Alejandro Serrano , From 9de6fa5998ab081f7f2d285854b60ddaf23687fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 26 May 2017 22:47:13 +0200 Subject: [PATCH 46/51] Remove stack*.yaml --- stack-8.yaml | 6 ------ stack.yaml | 5 ----- 2 files changed, 11 deletions(-) delete mode 100644 stack-8.yaml delete mode 100644 stack.yaml diff --git a/stack-8.yaml b/stack-8.yaml deleted file mode 100644 index 9ec79cd..0000000 --- a/stack-8.yaml +++ /dev/null @@ -1,6 +0,0 @@ -resolver: nightly-2017-01-16 -flags: {} -packages: -- '.' -extra-deps: -- cabal-helper-0.7.3.0 diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 1e26270..0000000 --- a/stack.yaml +++ /dev/null @@ -1,5 +0,0 @@ -flags: {} -packages: -- '.' -extra-deps: [] -resolver: lts-5.3 From 0b8a37210b47308514f14e7f7836a5c891c96639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 26 May 2017 22:49:22 +0200 Subject: [PATCH 47/51] ChangeLog --- ChangeLog | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4fe58f6..1c7f6f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2017-05-26 v5.8.0.0 + * Fix logic bug in fix for excessive use of `map-file` + * Bump HLint to 2.x + * Reorganize Cabal file to make maintanance easier + * Merge #872, Do not log warning when Stack project is preferred + * Merge #873, Fix build on case-insensitive filesystems + * Fix 'debug' command when ghc(-pkg) not on PATH + * Rework README + * Reorganize modules as preparation for splitting off ghc-mod-core + * Remove dependency on 'pretty' and use GHC's pretty printer instead + * Merge #854, Fix for "ghc-mod doc" when usind with stack + * Merge #858, Fix Gap.fromTyThing returning GHC internal + representation instead of the user readable representation of + types + * Fix #774, 'find*File' searching all the way up to / + * Fix #778, Check directory permissions before reading in + findFileInParentsP + * Merge #817, fix #779, bad "ghc-mod check" performance + 2017-01-16 v5.7.0.0 * Bump cabal-helper to 0.7.3.0 to support Cabal-1.24.1.0 * Bump haskell-src-exts, optparse-applicative, pipes and extra From 7f05edba322b643dab4ca0926fd307dd979a0455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sat, 27 May 2017 01:57:57 +0200 Subject: [PATCH 48/51] Re-introduce bounds on 'base' for `cabal check` --- ghc-mod.cabal | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 61d473b..86c4ee5 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -170,8 +170,7 @@ Library System.Directory.ModTime Build-Depends: -- See Note [GHC Boot libraries] - base - , binary + binary , bytestring , containers , deepseq @@ -184,6 +183,7 @@ Library , time , transformers + , base < 4.10 && >= 4.6.0.1 , djinn-ghc < 0.1 && >= 0.0.2.2 , extra < 1.6 && >= 1.4 , fclabels < 2.1 && >= 2.0 @@ -225,12 +225,12 @@ Executable ghc-mod X-Internal: True Build-Depends: -- See Note [GHC Boot libraries] - base - , directory + directory , filepath , mtl , process + , base < 4.10 && >= 4.6.0.1 , fclabels < 2.1 && >= 2.0 , monad-control < 1.1 && >= 1 , optparse-applicative == 0.13.0.* @@ -254,8 +254,7 @@ Executable ghc-modi HS-Source-Dirs: ., src, shared Build-Depends: -- See Note [GHC Boot libraries] - base - , binary + binary , deepseq , directory , filepath @@ -263,6 +262,8 @@ Executable ghc-modi , process , time + , base < 4.10 && >= 4.6.0.1 + , ghc-mod @@ -273,7 +274,7 @@ Test-Suite doctest Ghc-Options: -Wall Default-Extensions: ConstraintKinds, FlexibleContexts Main-Is: doctests.hs - Build-Depends: base + Build-Depends: base < 4.10 && >= 4.6.0.1 , doctest < 0.12 && >= 0.9.3 @@ -313,14 +314,14 @@ Test-Suite spec Build-Depends: -- See Note [GHC Boot libraries] - base - , containers + containers , directory , filepath , mtl , process , transformers + , base < 4.10 && >= 4.6.0.1 , fclabels < 2.1 && >= 2.0 , hspec < 2.4 && >= 2.0.0 , monad-journal < 0.8 && >= 0.4 @@ -329,7 +330,7 @@ Test-Suite spec if impl(ghc < 7.8) - Build-Depends: convertible < 1.2 && >= 1.1.0.0 + Build-Depends: convertible < 1.2 && >= 1.1.0.0 if impl(ghc >= 8.0) Build-Depends: ghc-boot @@ -345,8 +346,8 @@ Test-Suite shelltest Hs-Source-Dirs: shelltest Type: exitcode-stdio-1.0 Build-Tools: shelltest - Build-Depends: base - , process < 1.5 + Build-Depends: base < 4.10 && >= 4.6.0.1 + , process < 1.5 -- , shelltestrunner >= 1.3.5 if !flag(shelltest) Buildable: False @@ -362,10 +363,10 @@ Benchmark criterion Main-Is: Bench.hs Build-Depends: -- See Note [GHC Boot libraries] - base - , directory + directory , filepath + , base < 4.10 && >= 4.6.0.1 , criterion < 1.2 && >= 1.1.1.0 , temporary < 1.3 && >= 1.2.0.3 From 441293a9c1d6dd17fa64673a0300bee6d84e52b2 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Sat, 27 May 2017 16:59:57 +0200 Subject: [PATCH 49/51] Match current stackage nightly optparse-applicative --- ghc-mod.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 86c4ee5..3506d8a 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -193,7 +193,7 @@ Library , hlint < 2.1 && >= 2.0.8 , monad-control < 1.1 && >= 1 , monad-journal < 0.8 && >= 0.4 - , optparse-applicative == 0.13.0.* + , optparse-applicative < 0.14 && >= 0.13.0.* , pipes < 4.4 && >= 4.1 , safe < 0.4 && >= 0.3.9 , semigroups < 0.19 && >= 0.10.0 @@ -233,7 +233,7 @@ Executable ghc-mod , base < 4.10 && >= 4.6.0.1 , fclabels < 2.1 && >= 2.0 , monad-control < 1.1 && >= 1 - , optparse-applicative == 0.13.0.* + , optparse-applicative < 0.14 && >= 0.13.0.* , semigroups < 0.19 && >= 0.10.0 , split < 0.3 && >= 0.2.2 From 84524dbd863b0cd19bd9507a410d88cf3870c44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sat, 27 May 2017 23:28:49 +0200 Subject: [PATCH 50/51] Fix syntax error in cabal file --- ghc-mod.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 3506d8a..fb05305 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -193,7 +193,7 @@ Library , hlint < 2.1 && >= 2.0.8 , monad-control < 1.1 && >= 1 , monad-journal < 0.8 && >= 0.4 - , optparse-applicative < 0.14 && >= 0.13.0.* + , optparse-applicative < 0.14 && >= 0.13.0.0 , pipes < 4.4 && >= 4.1 , safe < 0.4 && >= 0.3.9 , semigroups < 0.19 && >= 0.10.0 @@ -233,7 +233,7 @@ Executable ghc-mod , base < 4.10 && >= 4.6.0.1 , fclabels < 2.1 && >= 2.0 , monad-control < 1.1 && >= 1 - , optparse-applicative < 0.14 && >= 0.13.0.* + , optparse-applicative < 0.14 && >= 0.13.0.0 , semigroups < 0.19 && >= 0.10.0 , split < 0.3 && >= 0.2.2 From 35690941aadbe44d9401102ab44a39753e0bb2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 28 May 2017 04:22:56 +0200 Subject: [PATCH 51/51] Reorganize module namespace - Remove Language.Haskell prefix from all modules - Move 'GHCMod.*' to 'GhcMod.Exe' - Move 'GhcModExe' to 'GhcMod.Exe' --- GhcMod.hs | 42 +++--- {GhcModExe => GhcMod/Exe}/Boot.hs | 14 +- {GhcModExe => GhcMod/Exe}/Browse.hs | 14 +- {GhcModExe => GhcMod/Exe}/CaseSplit.hs | 22 ++-- {GhcModExe => GhcMod/Exe}/Check.hs | 10 +- {GhcModExe => GhcMod/Exe}/Debug.hs | 20 +-- {GhcModExe => GhcMod/Exe}/FillSig.hs | 22 ++-- {GhcModExe => GhcMod/Exe}/Find.hs | 20 +-- GhcMod/Exe/Flag.hs | 9 ++ {GhcModExe => GhcMod/Exe}/Info.hs | 24 ++-- {GhcModExe => GhcMod/Exe}/Internal.hs | 26 ++-- {GhcModExe => GhcMod/Exe}/Lang.hs | 6 +- {GhcModExe => GhcMod/Exe}/Lint.hs | 12 +- {GhcModExe => GhcMod/Exe}/Modules.hs | 10 +- {GhcModExe => GhcMod/Exe}/PkgDoc.hs | 10 +- {GhcModExe => GhcMod/Exe}/Test.hs | 8 +- GhcModExe/Flag.hs | 9 -- bench/Bench.hs | 6 +- .../Haskell => }/GhcMod/CabalHelper.hs | 20 +-- core/{Language/Haskell => }/GhcMod/Caching.hs | 12 +- .../Haskell => }/GhcMod/Caching/Types.hs | 2 +- core/{Language/Haskell => }/GhcMod/Convert.hs | 6 +- core/{Language/Haskell => }/GhcMod/Cradle.hs | 16 +-- .../Haskell => }/GhcMod/CustomPackageDb.hs | 8 +- .../Haskell => }/GhcMod/DebugLogger.hs | 6 +- core/{Language/Haskell => }/GhcMod/Doc.hs | 4 +- .../{Language/Haskell => }/GhcMod/DynFlags.hs | 10 +- .../Haskell => }/GhcMod/DynFlagsTH.hs | 2 +- core/{Language/Haskell => }/GhcMod/Error.hs | 6 +- .../Haskell => }/GhcMod/FileMapping.hs | 12 +- core/{Language/Haskell => }/GhcMod/Gap.hs | 8 +- core/{Language/Haskell => }/GhcMod/GhcPkg.hs | 14 +- .../Haskell => }/GhcMod/HomeModuleGraph.hs | 14 +- .../{Language/Haskell => }/GhcMod/LightGhc.hs | 10 +- core/{Language/Haskell => }/GhcMod/Logger.hs | 18 +-- core/{Language/Haskell => }/GhcMod/Logging.hs | 14 +- core/{Language/Haskell => }/GhcMod/Monad.hs | 18 +-- .../Haskell => }/GhcMod/Monad/Compat.hs_h | 0 .../Haskell => }/GhcMod/Monad/Env.hs | 6 +- .../Haskell => }/GhcMod/Monad/Log.hs | 6 +- .../Haskell => }/GhcMod/Monad/Newtypes.hs | 4 +- .../Haskell => }/GhcMod/Monad/Orphans.hs | 6 +- .../Haskell => }/GhcMod/Monad/Out.hs | 6 +- .../Haskell => }/GhcMod/Monad/State.hs | 6 +- .../Haskell => }/GhcMod/Monad/Types.hs | 16 +-- .../Haskell => }/GhcMod/Options/DocUtils.hs | 2 +- .../Haskell => }/GhcMod/Options/Help.hs | 2 +- .../Haskell => }/GhcMod/Options/Options.hs | 10 +- core/{Language/Haskell => }/GhcMod/Output.hs | 8 +- .../Haskell => }/GhcMod/PathsAndFiles.hs | 12 +- core/{Language/Haskell => }/GhcMod/Pretty.hs | 8 +- core/{Language/Haskell => }/GhcMod/Read.hs | 2 +- .../{Language/Haskell => }/GhcMod/SrcUtils.hs | 8 +- core/{Language/Haskell => }/GhcMod/Stack.hs | 14 +- core/{Language/Haskell => }/GhcMod/Target.hs | 30 ++--- core/{Language/Haskell => }/GhcMod/Types.hs | 6 +- core/{Language/Haskell => }/GhcMod/Utils.hs | 10 +- core/{Language/Haskell => }/GhcMod/World.hs | 12 +- ghc-mod.cabal | 122 +++++++++--------- src/{GHCMod => GhcMod/Exe}/Options.hs | 14 +- .../Exe}/Options/Commands.hs | 10 +- .../Exe}/Options/ShellParse.hs | 2 +- src/{GHCMod => GhcMod/Exe}/Version.hs | 2 +- src/{GHCModMain.hs => GhcModMain.hs} | 12 +- src/{GHCModi.hs => GhcModi.hs} | 0 test/CabalHelperSpec.hs | 6 +- test/CradleSpec.hs | 4 +- test/CustomPackageDbSpec.hs | 6 +- test/FileMappingSpec.hs | 4 +- test/FindSpec.hs | 2 +- test/GhcPkgSpec.hs | 6 +- test/HomeModuleGraphSpec.hs | 4 +- test/PathsAndFilesSpec.hs | 6 +- test/ShellParseSpec.hs | 2 +- test/TargetSpec.hs | 6 +- test/TestUtils.hs | 12 +- 76 files changed, 439 insertions(+), 439 deletions(-) rename {GhcModExe => GhcMod/Exe}/Boot.hs (69%) rename {GhcModExe => GhcMod/Exe}/Browse.hs (95%) rename {GhcModExe => GhcMod/Exe}/CaseSplit.hs (95%) rename {GhcModExe => GhcMod/Exe}/Check.hs (88%) rename {GhcModExe => GhcMod/Exe}/Debug.hs (93%) rename {GhcModExe => GhcMod/Exe}/FillSig.hs (97%) rename {GhcModExe => GhcMod/Exe}/Find.hs (94%) create mode 100644 GhcMod/Exe/Flag.hs rename {GhcModExe => GhcMod/Exe}/Info.hs (81%) rename {GhcModExe => GhcMod/Exe}/Internal.hs (68%) rename {GhcModExe => GhcMod/Exe}/Lang.hs (63%) rename {GhcModExe => GhcMod/Exe}/Lint.hs (77%) rename {GhcModExe => GhcMod/Exe}/Modules.hs (78%) rename {GhcModExe => GhcMod/Exe}/PkgDoc.hs (80%) rename {GhcModExe => GhcMod/Exe}/Test.hs (88%) delete mode 100644 GhcModExe/Flag.hs rename core/{Language/Haskell => }/GhcMod/CabalHelper.hs (96%) rename core/{Language/Haskell => }/GhcMod/Caching.hs (94%) rename core/{Language/Haskell => }/GhcMod/Caching/Types.hs (97%) rename core/{Language/Haskell => }/GhcMod/Convert.hs (96%) rename core/{Language/Haskell => }/GhcMod/Cradle.hs (95%) rename core/{Language/Haskell => }/GhcMod/CustomPackageDb.hs (88%) rename core/{Language/Haskell => }/GhcMod/DebugLogger.hs (97%) rename core/{Language/Haskell => }/GhcMod/Doc.hs (83%) rename core/{Language/Haskell => }/GhcMod/DynFlags.hs (93%) rename core/{Language/Haskell => }/GhcMod/DynFlagsTH.hs (99%) rename core/{Language/Haskell => }/GhcMod/Error.hs (98%) rename core/{Language/Haskell => }/GhcMod/FileMapping.hs (93%) rename core/{Language/Haskell => }/GhcMod/Gap.hs (99%) rename core/{Language/Haskell => }/GhcMod/GhcPkg.hs (92%) rename core/{Language/Haskell => }/GhcMod/HomeModuleGraph.hs (96%) rename core/{Language/Haskell => }/GhcMod/LightGhc.hs (89%) rename core/{Language/Haskell => }/GhcMod/Logger.hs (93%) rename core/{Language/Haskell => }/GhcMod/Logging.hs (92%) rename core/{Language/Haskell => }/GhcMod/Monad.hs (92%) rename core/{Language/Haskell => }/GhcMod/Monad/Compat.hs_h (100%) rename core/{Language/Haskell => }/GhcMod/Monad/Env.hs (94%) rename core/{Language/Haskell => }/GhcMod/Monad/Log.hs (94%) rename core/{Language/Haskell => }/GhcMod/Monad/Newtypes.hs (98%) rename core/{Language/Haskell => }/GhcMod/Monad/Orphans.hs (95%) rename core/{Language/Haskell => }/GhcMod/Monad/Out.hs (92%) rename core/{Language/Haskell => }/GhcMod/Monad/State.hs (94%) rename core/{Language/Haskell => }/GhcMod/Monad/Types.hs (95%) rename core/{Language/Haskell => }/GhcMod/Options/DocUtils.hs (95%) rename core/{Language/Haskell => }/GhcMod/Options/Help.hs (97%) rename core/{Language/Haskell => }/GhcMod/Options/Options.hs (96%) rename core/{Language/Haskell => }/GhcMod/Output.hs (97%) rename core/{Language/Haskell => }/GhcMod/PathsAndFiles.hs (96%) rename core/{Language/Haskell => }/GhcMod/Pretty.hs (94%) rename core/{Language/Haskell => }/GhcMod/Read.hs (99%) rename core/{Language/Haskell => }/GhcMod/SrcUtils.hs (97%) rename core/{Language/Haskell => }/GhcMod/Stack.hs (92%) rename core/{Language/Haskell => }/GhcMod/Target.hs (96%) rename core/{Language/Haskell => }/GhcMod/Types.hs (98%) rename core/{Language/Haskell => }/GhcMod/Utils.hs (96%) rename core/{Language/Haskell => }/GhcMod/World.hs (86%) rename src/{GHCMod => GhcMod/Exe}/Options.hs (89%) rename src/{GHCMod => GhcMod/Exe}/Options/Commands.hs (98%) rename src/{GHCMod => GhcMod/Exe}/Options/ShellParse.hs (96%) rename src/{GHCMod => GhcMod/Exe}/Version.hs (97%) rename src/{GHCModMain.hs => GhcModMain.hs} (96%) rename src/{GHCModi.hs => GhcModi.hs} (100%) diff --git a/GhcMod.hs b/GhcMod.hs index 551e30b..8934759 100644 --- a/GhcMod.hs +++ b/GhcMod.hs @@ -69,24 +69,24 @@ module GhcMod ( , unloadMappedFile ) where -import GhcModExe.Boot -import GhcModExe.Browse -import GhcModExe.CaseSplit -import GhcModExe.Check -import GhcModExe.Debug -import GhcModExe.FillSig -import GhcModExe.Find -import GhcModExe.Flag -import GhcModExe.Info -import GhcModExe.Lang -import GhcModExe.Lint -import GhcModExe.Modules -import GhcModExe.PkgDoc -import GhcModExe.Test -import Language.Haskell.GhcMod.Cradle -import Language.Haskell.GhcMod.FileMapping -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Output -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.Types +import GhcMod.Exe.Boot +import GhcMod.Exe.Browse +import GhcMod.Exe.CaseSplit +import GhcMod.Exe.Check +import GhcMod.Exe.Debug +import GhcMod.Exe.FillSig +import GhcMod.Exe.Find +import GhcMod.Exe.Flag +import GhcMod.Exe.Info +import GhcMod.Exe.Lang +import GhcMod.Exe.Lint +import GhcMod.Exe.Modules +import GhcMod.Exe.PkgDoc +import GhcMod.Exe.Test +import GhcMod.Cradle +import GhcMod.FileMapping +import GhcMod.Logging +import GhcMod.Monad +import GhcMod.Output +import GhcMod.Target +import GhcMod.Types diff --git a/GhcModExe/Boot.hs b/GhcMod/Exe/Boot.hs similarity index 69% rename from GhcModExe/Boot.hs rename to GhcMod/Exe/Boot.hs index 35c43d3..4316259 100644 --- a/GhcModExe/Boot.hs +++ b/GhcMod/Exe/Boot.hs @@ -1,14 +1,14 @@ -module GhcModExe.Boot where +module GhcMod.Exe.Boot where import Control.Applicative import Prelude -import GhcModExe.Browse -import GhcModExe.Flag -import GhcModExe.Lang -import GhcModExe.Modules -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Types (defaultBrowseOpts) +import GhcMod.Exe.Browse +import GhcMod.Exe.Flag +import GhcMod.Exe.Lang +import GhcMod.Exe.Modules +import GhcMod.Monad +import GhcMod.Types (defaultBrowseOpts) -- | Printing necessary information for front-end booting. boot :: IOish m => GhcModT m String diff --git a/GhcModExe/Browse.hs b/GhcMod/Exe/Browse.hs similarity index 95% rename from GhcModExe/Browse.hs rename to GhcMod/Exe/Browse.hs index d09666b..069750b 100644 --- a/GhcModExe/Browse.hs +++ b/GhcMod/Exe/Browse.hs @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -module GhcModExe.Browse ( +module GhcMod.Exe.Browse ( browse, BrowseOpts(..) ) where @@ -14,12 +14,12 @@ import FastString import GHC import HscTypes import qualified GHC as G -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Doc (showPage, styleUnqualified) -import Language.Haskell.GhcMod.Gap as Gap -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Logging +import GhcMod.Convert +import GhcMod.Doc (showPage, styleUnqualified) +import GhcMod.Gap as Gap +import GhcMod.Types +import GhcMod.Monad +import GhcMod.Logging import Name (getOccString) import Outputable import TyCon (isAlgTyCon) diff --git a/GhcModExe/CaseSplit.hs b/GhcMod/Exe/CaseSplit.hs similarity index 95% rename from GhcModExe/CaseSplit.hs rename to GhcMod/Exe/CaseSplit.hs index 02562aa..d866fb6 100644 --- a/GhcModExe/CaseSplit.hs +++ b/GhcMod/Exe/CaseSplit.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} -module GhcModExe.CaseSplit ( +module GhcMod.Exe.CaseSplit ( splits ) where @@ -19,16 +19,16 @@ import qualified TyCon as Ty import qualified Type as Ty import Exception -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.DynFlags -import qualified Language.Haskell.GhcMod.Gap as Gap -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.SrcUtils -import Language.Haskell.GhcMod.Doc -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils (withMappedFile) -import Language.Haskell.GhcMod.FileMapping (fileModSummaryWithMapping) +import GhcMod.Convert +import GhcMod.DynFlags +import qualified GhcMod.Gap as Gap +import GhcMod.Monad +import GhcMod.SrcUtils +import GhcMod.Doc +import GhcMod.Logging +import GhcMod.Types +import GhcMod.Utils (withMappedFile) +import GhcMod.FileMapping (fileModSummaryWithMapping) import Control.DeepSeq ---------------------------------------------------------------- diff --git a/GhcModExe/Check.hs b/GhcMod/Exe/Check.hs similarity index 88% rename from GhcModExe/Check.hs rename to GhcMod/Exe/Check.hs index dcb6868..00f2c0f 100644 --- a/GhcModExe/Check.hs +++ b/GhcMod/Exe/Check.hs @@ -1,4 +1,4 @@ -module GhcModExe.Check ( +module GhcMod.Exe.Check ( checkSyntax , check , expandTemplate @@ -7,10 +7,10 @@ module GhcModExe.Check ( import Control.Applicative import Prelude -import Language.Haskell.GhcMod.DynFlags -import qualified Language.Haskell.GhcMod.Gap as Gap -import Language.Haskell.GhcMod.Logger -import Language.Haskell.GhcMod.Monad +import GhcMod.DynFlags +import qualified GhcMod.Gap as Gap +import GhcMod.Logger +import GhcMod.Monad ---------------------------------------------------------------- diff --git a/GhcModExe/Debug.hs b/GhcMod/Exe/Debug.hs similarity index 93% rename from GhcModExe/Debug.hs rename to GhcMod/Exe/Debug.hs index 39f63e5..2ba7ac5 100644 --- a/GhcModExe/Debug.hs +++ b/GhcMod/Exe/Debug.hs @@ -1,4 +1,4 @@ -module GhcModExe.Debug (debugInfo, rootInfo, componentInfo) where +module GhcMod.Exe.Debug (debugInfo, rootInfo, componentInfo) where import Control.Arrow (first) import Control.Applicative @@ -11,15 +11,15 @@ import Data.Version import Data.List.Split import System.Directory -import GhcModExe.Internal -import Language.Haskell.GhcMod.Cradle -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Output -import Language.Haskell.GhcMod.Pretty -import Language.Haskell.GhcMod.Stack -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils +import GhcMod.Exe.Internal +import GhcMod.Cradle +import GhcMod.Monad +import GhcMod.Output +import GhcMod.Pretty +import GhcMod.Stack +import GhcMod.Target +import GhcMod.Types +import GhcMod.Utils import Paths_ghc_mod (version) diff --git a/GhcModExe/FillSig.hs b/GhcMod/Exe/FillSig.hs similarity index 97% rename from GhcModExe/FillSig.hs rename to GhcMod/Exe/FillSig.hs index 0172a3b..236f1dc 100644 --- a/GhcModExe/FillSig.hs +++ b/GhcMod/Exe/FillSig.hs @@ -1,7 +1,7 @@ {-# LANGUAGE CPP, MultiParamTypeClasses, FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} -module GhcModExe.FillSig ( +module GhcMod.Exe.FillSig ( sig , refine , auto @@ -30,16 +30,16 @@ import qualified HsPat as Ty import qualified Language.Haskell.Exts as HE import Djinn.GHC -import qualified Language.Haskell.GhcMod.Gap as Gap -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.DynFlags -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.SrcUtils -import Language.Haskell.GhcMod.Logging (gmLog) -import Language.Haskell.GhcMod.Pretty (showToDoc) -import Language.Haskell.GhcMod.Doc -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.FileMapping (fileModSummaryWithMapping) +import qualified GhcMod.Gap as Gap +import GhcMod.Convert +import GhcMod.DynFlags +import GhcMod.Monad +import GhcMod.SrcUtils +import GhcMod.Logging (gmLog) +import GhcMod.Pretty (showToDoc) +import GhcMod.Doc +import GhcMod.Types +import GhcMod.FileMapping (fileModSummaryWithMapping) #if __GLASGOW_HASKELL__ >= 710 import GHC (unLoc) diff --git a/GhcModExe/Find.hs b/GhcMod/Exe/Find.hs similarity index 94% rename from GhcModExe/Find.hs rename to GhcMod/Exe/Find.hs index 3e0a7fd..17c6190 100644 --- a/GhcModExe/Find.hs +++ b/GhcMod/Exe/Find.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP, BangPatterns, TupleSections, DeriveGeneric #-} -module GhcModExe.Find +module GhcMod.Exe.Find ( Symbol , SymbolDb , loadSymbolDb @@ -22,14 +22,14 @@ import OccName import HscTypes import Exception -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Gap -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Output -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils -import Language.Haskell.GhcMod.World -import Language.Haskell.GhcMod.LightGhc +import GhcMod.Convert +import GhcMod.Gap +import GhcMod.Monad +import GhcMod.Output +import GhcMod.Types +import GhcMod.Utils +import GhcMod.World +import GhcMod.LightGhc import Control.Applicative import Control.DeepSeq @@ -53,7 +53,7 @@ import Data.Map (Map) import qualified Data.Map as M import Data.Set (Set) import qualified Data.Set as S -import Language.Haskell.GhcMod.PathsAndFiles +import GhcMod.PathsAndFiles import System.Directory import Prelude diff --git a/GhcMod/Exe/Flag.hs b/GhcMod/Exe/Flag.hs new file mode 100644 index 0000000..9384dd6 --- /dev/null +++ b/GhcMod/Exe/Flag.hs @@ -0,0 +1,9 @@ +module GhcMod.Exe.Flag where + +import qualified GhcMod.Gap as Gap +import GhcMod.Convert +import GhcMod.Monad + +-- | Listing of GHC flags, same as @ghc@\'s @--show-options@ with @ghc >= 7.10@. +flags :: IOish m => GhcModT m String +flags = convert' Gap.ghcCmdOptions diff --git a/GhcModExe/Info.hs b/GhcMod/Exe/Info.hs similarity index 81% rename from GhcModExe/Info.hs rename to GhcMod/Exe/Info.hs index 0b635ae..0021936 100644 --- a/GhcModExe/Info.hs +++ b/GhcMod/Exe/Info.hs @@ -1,4 +1,4 @@ -module GhcModExe.Info ( +module GhcMod.Exe.Info ( info , types ) where @@ -11,17 +11,17 @@ import GHC (GhcMonad, SrcSpan) import Prelude import qualified GHC as G -import qualified Language.Haskell.GhcMod.Gap as Gap -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Doc -import Language.Haskell.GhcMod.DynFlags -import Language.Haskell.GhcMod.Gap -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.SrcUtils -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils (mkRevRedirMapFunc) -import Language.Haskell.GhcMod.FileMapping (fileModSummaryWithMapping) +import qualified GhcMod.Gap as Gap +import GhcMod.Convert +import GhcMod.Doc +import GhcMod.DynFlags +import GhcMod.Gap +import GhcMod.Logging +import GhcMod.Monad +import GhcMod.SrcUtils +import GhcMod.Types +import GhcMod.Utils (mkRevRedirMapFunc) +import GhcMod.FileMapping (fileModSummaryWithMapping) ---------------------------------------------------------------- diff --git a/GhcModExe/Internal.hs b/GhcMod/Exe/Internal.hs similarity index 68% rename from GhcModExe/Internal.hs rename to GhcMod/Exe/Internal.hs index d310690..930b22b 100644 --- a/GhcModExe/Internal.hs +++ b/GhcMod/Exe/Internal.hs @@ -1,6 +1,6 @@ -- | Low level access to the ghc-mod library. -module GhcModExe.Internal ( +module GhcMod.Exe.Internal ( -- * Types GHCOption , IncludeDir @@ -51,22 +51,22 @@ module GhcModExe.Internal ( , GHandler(..) , gcatches -- * FileMapping - , module Language.Haskell.GhcMod.FileMapping + , module GhcMod.FileMapping ) where import GHC.Paths (libdir) -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.DynFlags -import Language.Haskell.GhcMod.Error -import Language.Haskell.GhcMod.Logger -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils -import Language.Haskell.GhcMod.World -import Language.Haskell.GhcMod.CabalHelper -import Language.Haskell.GhcMod.FileMapping +import GhcMod.Target +import GhcMod.DynFlags +import GhcMod.Error +import GhcMod.Logger +import GhcMod.Logging +import GhcMod.Monad +import GhcMod.Types +import GhcMod.Utils +import GhcMod.World +import GhcMod.CabalHelper +import GhcMod.FileMapping -- | Obtaining the directory for ghc system libraries. ghcLibDir :: FilePath diff --git a/GhcModExe/Lang.hs b/GhcMod/Exe/Lang.hs similarity index 63% rename from GhcModExe/Lang.hs rename to GhcMod/Exe/Lang.hs index 0a5ac4b..3546c4a 100644 --- a/GhcModExe/Lang.hs +++ b/GhcMod/Exe/Lang.hs @@ -1,8 +1,8 @@ -module GhcModExe.Lang where +module GhcMod.Exe.Lang where import DynFlags (supportedLanguagesAndExtensions) -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Monad +import GhcMod.Convert +import GhcMod.Monad -- | Listing language extensions. diff --git a/GhcModExe/Lint.hs b/GhcMod/Exe/Lint.hs similarity index 77% rename from GhcModExe/Lint.hs rename to GhcMod/Exe/Lint.hs index 12237a9..c4a2d75 100644 --- a/GhcModExe/Lint.hs +++ b/GhcMod/Exe/Lint.hs @@ -1,14 +1,14 @@ -module GhcModExe.Lint where +module GhcMod.Exe.Lint where import Exception (ghandle) import Control.Exception (SomeException(..)) -import Language.Haskell.GhcMod.Logger (checkErrorPrefix) -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad +import GhcMod.Logger (checkErrorPrefix) +import GhcMod.Convert +import GhcMod.Types +import GhcMod.Monad import Language.Haskell.HLint3 -import Language.Haskell.GhcMod.Utils (withMappedFile) +import GhcMod.Utils (withMappedFile) import Language.Haskell.Exts.SrcLoc (SrcSpan(..)) -- | Checking syntax of a target file using hlint. diff --git a/GhcModExe/Modules.hs b/GhcMod/Exe/Modules.hs similarity index 78% rename from GhcModExe/Modules.hs rename to GhcMod/Exe/Modules.hs index 80abe7d..735bd8f 100644 --- a/GhcModExe/Modules.hs +++ b/GhcMod/Exe/Modules.hs @@ -1,11 +1,11 @@ -module GhcModExe.Modules (modules) where +module GhcMod.Exe.Modules (modules) where import Control.Arrow import Data.List -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Gap ( listVisibleModuleNames +import GhcMod.Convert +import GhcMod.Types +import GhcMod.Monad +import GhcMod.Gap ( listVisibleModuleNames , lookupModulePackageInAllPackages ) diff --git a/GhcModExe/PkgDoc.hs b/GhcMod/Exe/PkgDoc.hs similarity index 80% rename from GhcModExe/PkgDoc.hs rename to GhcMod/Exe/PkgDoc.hs index d10d2d8..4d521fd 100644 --- a/GhcModExe/PkgDoc.hs +++ b/GhcMod/Exe/PkgDoc.hs @@ -1,9 +1,9 @@ -module GhcModExe.PkgDoc (pkgDoc) where +module GhcMod.Exe.PkgDoc (pkgDoc) where -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.GhcPkg -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Output +import GhcMod.Types +import GhcMod.GhcPkg +import GhcMod.Monad +import GhcMod.Output import Control.Applicative import Prelude diff --git a/GhcModExe/Test.hs b/GhcMod/Exe/Test.hs similarity index 88% rename from GhcModExe/Test.hs rename to GhcMod/Exe/Test.hs index be127e9..96eb01c 100644 --- a/GhcModExe/Test.hs +++ b/GhcMod/Exe/Test.hs @@ -1,4 +1,4 @@ -module GhcModExe.Test where +module GhcMod.Exe.Test where import Control.Applicative import Data.List @@ -6,9 +6,9 @@ import System.FilePath import System.Directory import Prelude -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.DynFlags +import GhcMod.Types +import GhcMod.Monad +import GhcMod.DynFlags import GHC import GHC.Exception diff --git a/GhcModExe/Flag.hs b/GhcModExe/Flag.hs deleted file mode 100644 index 1a09f77..0000000 --- a/GhcModExe/Flag.hs +++ /dev/null @@ -1,9 +0,0 @@ -module GhcModExe.Flag where - -import qualified Language.Haskell.GhcMod.Gap as Gap -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Monad - --- | Listing of GHC flags, same as @ghc@\'s @--show-options@ with @ghc >= 7.10@. -flags :: IOish m => GhcModT m String -flags = convert' Gap.ghcCmdOptions diff --git a/bench/Bench.hs b/bench/Bench.hs index 1880492..542fa4c 100644 --- a/bench/Bench.hs +++ b/bench/Bench.hs @@ -1,7 +1,7 @@ import Criterion.Main -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Types +import GhcMod.Target +import GhcMod.Monad +import GhcMod.Types import Dir import System.IO.Temp import System.Process hiding (env) diff --git a/core/Language/Haskell/GhcMod/CabalHelper.hs b/core/GhcMod/CabalHelper.hs similarity index 96% rename from core/Language/Haskell/GhcMod/CabalHelper.hs rename to core/GhcMod/CabalHelper.hs index cb09569..4265739 100644 --- a/core/Language/Haskell/GhcMod/CabalHelper.hs +++ b/core/GhcMod/CabalHelper.hs @@ -15,7 +15,7 @@ -- along with this program. If not, see . {-# LANGUAGE CPP #-} -module Language.Haskell.GhcMod.CabalHelper +module GhcMod.CabalHelper ( getComponents , getGhcMergedPkgOptions , getCabalPackageDbStack @@ -34,15 +34,15 @@ import Data.Binary (Binary) import Data.Traversable import Distribution.Helper hiding (Programs(..)) import qualified Distribution.Helper as CH -import qualified Language.Haskell.GhcMod.Types as T -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Utils -import Language.Haskell.GhcMod.PathsAndFiles -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Output -import Language.Haskell.GhcMod.CustomPackageDb -import Language.Haskell.GhcMod.Stack +import qualified GhcMod.Types as T +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.Utils +import GhcMod.PathsAndFiles +import GhcMod.Logging +import GhcMod.Output +import GhcMod.CustomPackageDb +import GhcMod.Stack import System.FilePath import System.Process import System.Exit diff --git a/core/Language/Haskell/GhcMod/Caching.hs b/core/GhcMod/Caching.hs similarity index 94% rename from core/Language/Haskell/GhcMod/Caching.hs rename to core/GhcMod/Caching.hs index c8cdb05..2f58929 100644 --- a/core/Language/Haskell/GhcMod/Caching.hs +++ b/core/GhcMod/Caching.hs @@ -14,9 +14,9 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . {-# LANGUAGE CPP, OverloadedStrings #-} -module Language.Haskell.GhcMod.Caching ( - module Language.Haskell.GhcMod.Caching - , module Language.Haskell.GhcMod.Caching.Types +module GhcMod.Caching ( + module GhcMod.Caching + , module GhcMod.Caching.Types ) where import Control.Arrow (first) @@ -38,9 +38,9 @@ import Utils (TimedFile(..), timeMaybe, mightExist) import Paths_ghc_mod (version) import Prelude -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Caching.Types -import Language.Haskell.GhcMod.Logging +import GhcMod.Monad.Types +import GhcMod.Caching.Types +import GhcMod.Logging -- | Cache a MonadIO action with proper invalidation. cached :: forall m a d. (Gm m, MonadIO m, Binary a, Eq d, Binary d, Show d) diff --git a/core/Language/Haskell/GhcMod/Caching/Types.hs b/core/GhcMod/Caching/Types.hs similarity index 97% rename from core/Language/Haskell/GhcMod/Caching/Types.hs rename to core/GhcMod/Caching/Types.hs index 501eae2..4a8a813 100644 --- a/core/Language/Haskell/GhcMod/Caching/Types.hs +++ b/core/GhcMod/Caching/Types.hs @@ -13,7 +13,7 @@ -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module Language.Haskell.GhcMod.Caching.Types where +module GhcMod.Caching.Types where import Utils import Data.Label diff --git a/core/Language/Haskell/GhcMod/Convert.hs b/core/GhcMod/Convert.hs similarity index 96% rename from core/Language/Haskell/GhcMod/Convert.hs rename to core/GhcMod/Convert.hs index fa266d2..f33509e 100644 --- a/core/Language/Haskell/GhcMod/Convert.hs +++ b/core/GhcMod/Convert.hs @@ -1,9 +1,9 @@ {-# LANGUAGE CPP, FlexibleInstances, FlexibleContexts #-} -module Language.Haskell.GhcMod.Convert (convert, convert', emptyResult, whenFound, whenFound') where +module GhcMod.Convert (convert, convert', emptyResult, whenFound, whenFound') where -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.Types import Control.Applicative import Prelude diff --git a/core/Language/Haskell/GhcMod/Cradle.hs b/core/GhcMod/Cradle.hs similarity index 95% rename from core/Language/Haskell/GhcMod/Cradle.hs rename to core/GhcMod/Cradle.hs index b4e499b..9226fd5 100644 --- a/core/Language/Haskell/GhcMod/Cradle.hs +++ b/core/GhcMod/Cradle.hs @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -module Language.Haskell.GhcMod.Cradle +module GhcMod.Cradle ( findCradle , findCradle' , findCradleNoLog @@ -10,13 +10,13 @@ module Language.Haskell.GhcMod.Cradle , plainCradle ) where -import Language.Haskell.GhcMod.PathsAndFiles -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils -import Language.Haskell.GhcMod.Stack -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Error +import GhcMod.PathsAndFiles +import GhcMod.Monad.Types +import GhcMod.Types +import GhcMod.Utils +import GhcMod.Stack +import GhcMod.Logging +import GhcMod.Error import Safe import Control.Applicative diff --git a/core/Language/Haskell/GhcMod/CustomPackageDb.hs b/core/GhcMod/CustomPackageDb.hs similarity index 88% rename from core/Language/Haskell/GhcMod/CustomPackageDb.hs rename to core/GhcMod/CustomPackageDb.hs index 8fc78e3..8f6c38c 100644 --- a/core/Language/Haskell/GhcMod/CustomPackageDb.hs +++ b/core/GhcMod/CustomPackageDb.hs @@ -13,16 +13,16 @@ -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module Language.Haskell.GhcMod.CustomPackageDb where +module GhcMod.CustomPackageDb where import Control.Applicative import Control.Monad import Control.Category ((.)) import Data.Maybe import Data.Traversable -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.PathsAndFiles +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.PathsAndFiles import Prelude hiding ((.)) parseCustomPackageDb :: String -> [GhcPkgDb] diff --git a/core/Language/Haskell/GhcMod/DebugLogger.hs b/core/GhcMod/DebugLogger.hs similarity index 97% rename from core/Language/Haskell/GhcMod/DebugLogger.hs rename to core/GhcMod/DebugLogger.hs index 780dcd6..6e9dfa8 100644 --- a/core/Language/Haskell/GhcMod/DebugLogger.hs +++ b/core/GhcMod/DebugLogger.hs @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . {-# LANGUAGE CPP, RankNTypes #-} -module Language.Haskell.GhcMod.DebugLogger where +module GhcMod.DebugLogger where -- (c) The University of Glasgow 2005 -- @@ -57,8 +57,8 @@ import Outputable (SDoc, PprStyle, runSDoc, initSDocContext, blankLine) import qualified Outputable import ErrUtils -import Language.Haskell.GhcMod.Error -import Language.Haskell.GhcMod.Gap +import GhcMod.Error +import GhcMod.Gap import Prelude debugLogAction :: (String -> IO ()) -> GmLogAction diff --git a/core/Language/Haskell/GhcMod/Doc.hs b/core/GhcMod/Doc.hs similarity index 83% rename from core/Language/Haskell/GhcMod/Doc.hs rename to core/GhcMod/Doc.hs index 7914e2e..005eaf1 100644 --- a/core/Language/Haskell/GhcMod/Doc.hs +++ b/core/GhcMod/Doc.hs @@ -1,7 +1,7 @@ -module Language.Haskell.GhcMod.Doc where +module GhcMod.Doc where import GHC -import Language.Haskell.GhcMod.Gap (withStyle, showDocWith) +import GhcMod.Gap (withStyle, showDocWith) import Outputable import Pretty (Mode(..)) diff --git a/core/Language/Haskell/GhcMod/DynFlags.hs b/core/GhcMod/DynFlags.hs similarity index 93% rename from core/Language/Haskell/GhcMod/DynFlags.hs rename to core/GhcMod/DynFlags.hs index a68a050..77f213d 100644 --- a/core/Language/Haskell/GhcMod/DynFlags.hs +++ b/core/GhcMod/DynFlags.hs @@ -1,16 +1,16 @@ {-# LANGUAGE TemplateHaskell #-} -module Language.Haskell.GhcMod.DynFlags where +module GhcMod.DynFlags where import Control.Applicative import Control.Monad import GHC import qualified GHC as G import GHC.Paths (libdir) -import qualified Language.Haskell.GhcMod.Gap as Gap -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.DebugLogger -import Language.Haskell.GhcMod.DynFlagsTH +import qualified GhcMod.Gap as Gap +import GhcMod.Types +import GhcMod.DebugLogger +import GhcMod.DynFlagsTH import System.IO.Unsafe (unsafePerformIO) import Prelude diff --git a/core/Language/Haskell/GhcMod/DynFlagsTH.hs b/core/GhcMod/DynFlagsTH.hs similarity index 99% rename from core/Language/Haskell/GhcMod/DynFlagsTH.hs rename to core/GhcMod/DynFlagsTH.hs index f5a1c01..9085707 100644 --- a/core/Language/Haskell/GhcMod/DynFlagsTH.hs +++ b/core/GhcMod/DynFlagsTH.hs @@ -15,7 +15,7 @@ -- along with this program. If not, see . {-# LANGUAGE CPP, TemplateHaskell #-} -module Language.Haskell.GhcMod.DynFlagsTH where +module GhcMod.DynFlagsTH where import Language.Haskell.TH import Language.Haskell.TH.Syntax diff --git a/core/Language/Haskell/GhcMod/Error.hs b/core/GhcMod/Error.hs similarity index 98% rename from core/Language/Haskell/GhcMod/Error.hs rename to core/GhcMod/Error.hs index bf60962..18e5fc8 100644 --- a/core/Language/Haskell/GhcMod/Error.hs +++ b/core/GhcMod/Error.hs @@ -15,7 +15,7 @@ -- along with this program. If not, see . {-# LANGUAGE ExistentialQuantification #-} -module Language.Haskell.GhcMod.Error ( +module GhcMod.Error ( GhcModError(..) , GmError , gmeDoc @@ -47,8 +47,8 @@ import Pretty import Config (cProjectVersion, cHostPlatformString) import Paths_ghc_mod (version) -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Pretty +import GhcMod.Types +import GhcMod.Pretty type GmError m = MonadError GhcModError m diff --git a/core/Language/Haskell/GhcMod/FileMapping.hs b/core/GhcMod/FileMapping.hs similarity index 93% rename from core/Language/Haskell/GhcMod/FileMapping.hs rename to core/GhcMod/FileMapping.hs index 4655605..e05a540 100644 --- a/core/Language/Haskell/GhcMod/FileMapping.hs +++ b/core/GhcMod/FileMapping.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.FileMapping +module GhcMod.FileMapping ( loadMappedFile , loadMappedFileSource , unloadMappedFile @@ -6,11 +6,11 @@ module Language.Haskell.GhcMod.FileMapping , fileModSummaryWithMapping ) where -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Gap -import Language.Haskell.GhcMod.HomeModuleGraph -import Language.Haskell.GhcMod.Utils +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.Gap +import GhcMod.HomeModuleGraph +import GhcMod.Utils import System.IO import System.FilePath diff --git a/core/Language/Haskell/GhcMod/Gap.hs b/core/GhcMod/Gap.hs similarity index 99% rename from core/Language/Haskell/GhcMod/Gap.hs rename to core/GhcMod/Gap.hs index 13d0246..728a04c 100644 --- a/core/Language/Haskell/GhcMod/Gap.hs +++ b/core/GhcMod/Gap.hs @@ -1,7 +1,7 @@ {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP, ScopedTypeVariables, RankNTypes #-} -module Language.Haskell.GhcMod.Gap ( - Language.Haskell.GhcMod.Gap.ClsInst +module GhcMod.Gap ( + GhcMod.Gap.ClsInst , mkTarget , withStyle , GmLogAction @@ -44,7 +44,7 @@ module Language.Haskell.GhcMod.Gap ( , listVisibleModuleNames , listVisibleModules , lookupModulePackageInAllPackages - , Language.Haskell.GhcMod.Gap.isSynTyCon + , GhcMod.Gap.isSynTyCon , parseModuleHeader , mkErrStyle' , everythingStagedWithContext @@ -139,7 +139,7 @@ import Packages import Data.Generics (GenericQ, extQ, gmapQ) import GHC.SYB.Utils (Stage(..)) -import Language.Haskell.GhcMod.Types (Expression(..)) +import GhcMod.Types (Expression(..)) import Prelude ---------------------------------------------------------------- diff --git a/core/Language/Haskell/GhcMod/GhcPkg.hs b/core/GhcMod/GhcPkg.hs similarity index 92% rename from core/Language/Haskell/GhcMod/GhcPkg.hs rename to core/GhcMod/GhcPkg.hs index 86ab83b..746b2ea 100644 --- a/core/Language/Haskell/GhcMod/GhcPkg.hs +++ b/core/GhcMod/GhcPkg.hs @@ -1,5 +1,5 @@ {-# LANGUAGE BangPatterns, ScopedTypeVariables, TupleSections #-} -module Language.Haskell.GhcMod.GhcPkg ( +module GhcMod.GhcPkg ( ghcPkgDbOpt , ghcPkgDbStackOpts , ghcDbStackOpts @@ -18,12 +18,12 @@ import System.Directory (doesDirectoryExist, getAppUserDataDirectory) import System.FilePath (()) import Prelude -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.CabalHelper -import Language.Haskell.GhcMod.PathsAndFiles -import Language.Haskell.GhcMod.CustomPackageDb -import Language.Haskell.GhcMod.Stack +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.CabalHelper +import GhcMod.PathsAndFiles +import GhcMod.CustomPackageDb +import GhcMod.Stack ghcVersion :: Int ghcVersion = read cProjectVersionInt diff --git a/core/Language/Haskell/GhcMod/HomeModuleGraph.hs b/core/GhcMod/HomeModuleGraph.hs similarity index 96% rename from core/Language/Haskell/GhcMod/HomeModuleGraph.hs rename to core/GhcMod/HomeModuleGraph.hs index 7ed7b01..cda8261 100644 --- a/core/Language/Haskell/GhcMod/HomeModuleGraph.hs +++ b/core/GhcMod/HomeModuleGraph.hs @@ -15,7 +15,7 @@ -- along with this program. If not, see . {-# LANGUAGE ScopedTypeVariables, RecordWildCards #-} -module Language.Haskell.GhcMod.HomeModuleGraph ( +module GhcMod.HomeModuleGraph ( GmModuleGraph(..) , ModulePath(..) , mkFileMap @@ -58,12 +58,12 @@ import System.Directory import System.IO import Prelude -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Logger -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils (withMappedFile) -import Language.Haskell.GhcMod.Gap (parseModuleHeader) +import GhcMod.Logging +import GhcMod.Logger +import GhcMod.Monad.Types +import GhcMod.Types +import GhcMod.Utils (withMappedFile) +import GhcMod.Gap (parseModuleHeader) -- | Turn module graph into a graphviz dot file -- diff --git a/core/Language/Haskell/GhcMod/LightGhc.hs b/core/GhcMod/LightGhc.hs similarity index 89% rename from core/Language/Haskell/GhcMod/LightGhc.hs rename to core/GhcMod/LightGhc.hs index 8978991..3be80e0 100644 --- a/core/Language/Haskell/GhcMod/LightGhc.hs +++ b/core/GhcMod/LightGhc.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.LightGhc where +module GhcMod.LightGhc where import Control.Monad import Control.Monad.Reader (runReaderT) @@ -12,10 +12,10 @@ import DynFlags import HscMain import HscTypes -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.DynFlags -import qualified Language.Haskell.GhcMod.Gap as Gap +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.DynFlags +import qualified GhcMod.Gap as Gap -- We have to be more careful about tearing down 'HscEnv's since GHC 8 added an -- out of process GHCI server which has to be shutdown. diff --git a/core/Language/Haskell/GhcMod/Logger.hs b/core/GhcMod/Logger.hs similarity index 93% rename from core/Language/Haskell/GhcMod/Logger.hs rename to core/GhcMod/Logger.hs index 6c14d5e..3ccf89b 100644 --- a/core/Language/Haskell/GhcMod/Logger.hs +++ b/core/GhcMod/Logger.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP, RankNTypes #-} -module Language.Haskell.GhcMod.Logger ( +module GhcMod.Logger ( withLogger , withLogger' , checkErrorPrefix @@ -27,14 +27,14 @@ import Bag import SrcLoc import FastString -import Language.Haskell.GhcMod.Convert -import Language.Haskell.GhcMod.Doc (showPage) -import Language.Haskell.GhcMod.DynFlags (withDynFlags) -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Error -import Language.Haskell.GhcMod.Pretty -import Language.Haskell.GhcMod.Utils (mkRevRedirMapFunc) -import qualified Language.Haskell.GhcMod.Gap as Gap +import GhcMod.Convert +import GhcMod.Doc (showPage) +import GhcMod.DynFlags (withDynFlags) +import GhcMod.Monad.Types +import GhcMod.Error +import GhcMod.Pretty +import GhcMod.Utils (mkRevRedirMapFunc) +import qualified GhcMod.Gap as Gap import Prelude type Builder = [String] -> [String] diff --git a/core/Language/Haskell/GhcMod/Logging.hs b/core/GhcMod/Logging.hs similarity index 92% rename from core/Language/Haskell/GhcMod/Logging.hs rename to core/GhcMod/Logging.hs index a6cfaff..930a56b 100644 --- a/core/Language/Haskell/GhcMod/Logging.hs +++ b/core/GhcMod/Logging.hs @@ -16,9 +16,9 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} -module Language.Haskell.GhcMod.Logging ( - module Language.Haskell.GhcMod.Logging - , module Language.Haskell.GhcMod.Pretty +module GhcMod.Logging ( + module GhcMod.Logging + , module GhcMod.Pretty , GmLogLevel(..) , module Data.Monoid , module Pretty @@ -37,10 +37,10 @@ import Prelude import Pretty hiding (style, (<>)) -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Pretty -import Language.Haskell.GhcMod.Output +import GhcMod.Monad.Types +import GhcMod.Types +import GhcMod.Pretty +import GhcMod.Output gmSetLogLevel :: GmLog m => GmLogLevel -> m () gmSetLogLevel level = diff --git a/core/Language/Haskell/GhcMod/Monad.hs b/core/GhcMod/Monad.hs similarity index 92% rename from core/Language/Haskell/GhcMod/Monad.hs rename to core/GhcMod/Monad.hs index 8f44db8..83d22b6 100644 --- a/core/Language/Haskell/GhcMod/Monad.hs +++ b/core/GhcMod/Monad.hs @@ -15,7 +15,7 @@ -- along with this program. If not, see . {-# LANGUAGE CPP #-} -module Language.Haskell.GhcMod.Monad ( +module GhcMod.Monad ( runGmOutT , runGmOutT' , runGhcModT @@ -27,16 +27,16 @@ module Language.Haskell.GhcMod.Monad ( , runGmPkgGhc , withGhcModEnv , withGhcModEnv' - , module Language.Haskell.GhcMod.Monad.Types + , module GhcMod.Monad.Types ) where -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Error -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Cradle -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.Output +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.Error +import GhcMod.Logging +import GhcMod.Cradle +import GhcMod.Target +import GhcMod.Output import Control.Arrow (first) import Control.Applicative diff --git a/core/Language/Haskell/GhcMod/Monad/Compat.hs_h b/core/GhcMod/Monad/Compat.hs_h similarity index 100% rename from core/Language/Haskell/GhcMod/Monad/Compat.hs_h rename to core/GhcMod/Monad/Compat.hs_h diff --git a/core/Language/Haskell/GhcMod/Monad/Env.hs b/core/GhcMod/Monad/Env.hs similarity index 94% rename from core/Language/Haskell/GhcMod/Monad/Env.hs rename to core/GhcMod/Monad/Env.hs index 23b42be..79db698 100644 --- a/core/Language/Haskell/GhcMod/Monad/Env.hs +++ b/core/GhcMod/Monad/Env.hs @@ -17,10 +17,10 @@ {-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances, UndecidableInstances #-} -module Language.Haskell.GhcMod.Monad.Env where +module GhcMod.Monad.Env where -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Newtypes +import GhcMod.Types +import GhcMod.Monad.Newtypes import Control.Monad import Control.Monad.Trans.Journal (JournalT) diff --git a/core/Language/Haskell/GhcMod/Monad/Log.hs b/core/GhcMod/Monad/Log.hs similarity index 94% rename from core/Language/Haskell/GhcMod/Monad/Log.hs rename to core/GhcMod/Monad/Log.hs index f353084..5e21375 100644 --- a/core/Language/Haskell/GhcMod/Monad/Log.hs +++ b/core/GhcMod/Monad/Log.hs @@ -17,10 +17,10 @@ {-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances, UndecidableInstances #-} -module Language.Haskell.GhcMod.Monad.Log where +module GhcMod.Monad.Log where -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Newtypes +import GhcMod.Types +import GhcMod.Monad.Newtypes import Control.Monad import Control.Monad.Trans.Journal (JournalT) diff --git a/core/Language/Haskell/GhcMod/Monad/Newtypes.hs b/core/GhcMod/Monad/Newtypes.hs similarity index 98% rename from core/Language/Haskell/GhcMod/Monad/Newtypes.hs rename to core/GhcMod/Monad/Newtypes.hs index 90a6b26..b9a070f 100644 --- a/core/Language/Haskell/GhcMod/Monad/Newtypes.hs +++ b/core/GhcMod/Monad/Newtypes.hs @@ -18,11 +18,11 @@ {-# LANGUAGE MultiParamTypeClasses, TypeFamilies, UndecidableInstances #-} {-# LANGUAGE RankNTypes, FlexibleInstances #-} -module Language.Haskell.GhcMod.Monad.Newtypes where +module GhcMod.Monad.Newtypes where #include "Compat.hs_h" -import Language.Haskell.GhcMod.Types +import GhcMod.Types import GHC diff --git a/core/Language/Haskell/GhcMod/Monad/Orphans.hs b/core/GhcMod/Monad/Orphans.hs similarity index 95% rename from core/Language/Haskell/GhcMod/Monad/Orphans.hs rename to core/GhcMod/Monad/Orphans.hs index 18fe9f5..0c9e7fd 100644 --- a/core/Language/Haskell/GhcMod/Monad/Orphans.hs +++ b/core/GhcMod/Monad/Orphans.hs @@ -18,12 +18,12 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -module Language.Haskell.GhcMod.Monad.Orphans where +module GhcMod.Monad.Orphans where #include "Compat.hs_h" -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Newtypes +import GhcMod.Types +import GhcMod.Monad.Newtypes #if DIFFERENT_MONADIO import qualified MonadUtils as GHC (MonadIO(..)) diff --git a/core/Language/Haskell/GhcMod/Monad/Out.hs b/core/GhcMod/Monad/Out.hs similarity index 92% rename from core/Language/Haskell/GhcMod/Monad/Out.hs rename to core/GhcMod/Monad/Out.hs index d372f9f..6024f9d 100644 --- a/core/Language/Haskell/GhcMod/Monad/Out.hs +++ b/core/GhcMod/Monad/Out.hs @@ -17,10 +17,10 @@ {-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, UndecidableInstances #-} -module Language.Haskell.GhcMod.Monad.Out where +module GhcMod.Monad.Out where -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Newtypes +import GhcMod.Types +import GhcMod.Monad.Newtypes import Control.Monad import Control.Monad.State.Strict (StateT(..)) diff --git a/core/Language/Haskell/GhcMod/Monad/State.hs b/core/GhcMod/Monad/State.hs similarity index 94% rename from core/Language/Haskell/GhcMod/Monad/State.hs rename to core/GhcMod/Monad/State.hs index 5edcbe7..fdef21e 100644 --- a/core/Language/Haskell/GhcMod/Monad/State.hs +++ b/core/GhcMod/Monad/State.hs @@ -17,10 +17,10 @@ {-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances, UndecidableInstances #-} -module Language.Haskell.GhcMod.Monad.State where +module GhcMod.Monad.State where -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Newtypes +import GhcMod.Types +import GhcMod.Monad.Newtypes import Control.Monad import Control.Monad.State.Strict (StateT(..)) diff --git a/core/Language/Haskell/GhcMod/Monad/Types.hs b/core/GhcMod/Monad/Types.hs similarity index 95% rename from core/Language/Haskell/GhcMod/Monad/Types.hs rename to core/GhcMod/Monad/Types.hs index 416ee13..abb7a6f 100644 --- a/core/Language/Haskell/GhcMod/Monad/Types.hs +++ b/core/GhcMod/Monad/Types.hs @@ -20,7 +20,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -module Language.Haskell.GhcMod.Monad.Types ( +module GhcMod.Monad.Types ( -- * Monad Types GhcModT , GmOutT(..) @@ -64,14 +64,14 @@ module Language.Haskell.GhcMod.Monad.Types ( #include "Compat.hs_h" -import Language.Haskell.GhcMod.Types +import GhcMod.Types -import Language.Haskell.GhcMod.Monad.Env -import Language.Haskell.GhcMod.Monad.State -import Language.Haskell.GhcMod.Monad.Log -import Language.Haskell.GhcMod.Monad.Out -import Language.Haskell.GhcMod.Monad.Newtypes -import Language.Haskell.GhcMod.Monad.Orphans () +import GhcMod.Monad.Env +import GhcMod.Monad.State +import GhcMod.Monad.Log +import GhcMod.Monad.Out +import GhcMod.Monad.Newtypes +import GhcMod.Monad.Orphans () import Safe diff --git a/core/Language/Haskell/GhcMod/Options/DocUtils.hs b/core/GhcMod/Options/DocUtils.hs similarity index 95% rename from core/Language/Haskell/GhcMod/Options/DocUtils.hs rename to core/GhcMod/Options/DocUtils.hs index 9fd846c..ab8add7 100644 --- a/core/Language/Haskell/GhcMod/Options/DocUtils.hs +++ b/core/GhcMod/Options/DocUtils.hs @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module Language.Haskell.GhcMod.Options.DocUtils ( +module GhcMod.Options.DocUtils ( ($$), ($$$), (<=>), diff --git a/core/Language/Haskell/GhcMod/Options/Help.hs b/core/GhcMod/Options/Help.hs similarity index 97% rename from core/Language/Haskell/GhcMod/Options/Help.hs rename to core/GhcMod/Options/Help.hs index 2ecc144..b23487c 100644 --- a/core/Language/Haskell/GhcMod/Options/Help.hs +++ b/core/GhcMod/Options/Help.hs @@ -15,7 +15,7 @@ -- along with this program. If not, see . {-# LANGUAGE OverloadedStrings, FlexibleInstances, GeneralizedNewtypeDeriving #-} -module Language.Haskell.GhcMod.Options.Help where +module GhcMod.Options.Help where import Options.Applicative import Options.Applicative.Help.Pretty (Doc) diff --git a/core/Language/Haskell/GhcMod/Options/Options.hs b/core/GhcMod/Options/Options.hs similarity index 96% rename from core/Language/Haskell/GhcMod/Options/Options.hs rename to core/GhcMod/Options/Options.hs index 34d6fe0..551f925 100644 --- a/core/Language/Haskell/GhcMod/Options/Options.hs +++ b/core/GhcMod/Options/Options.hs @@ -16,20 +16,20 @@ {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -module Language.Haskell.GhcMod.Options.Options ( +module GhcMod.Options.Options ( globalArgSpec , parseCmdLineOptions ) where import Options.Applicative import Options.Applicative.Types -import Language.Haskell.GhcMod.Types +import GhcMod.Types import Control.Arrow import Data.Char (toUpper, toLower) import Data.List (intercalate) -import Language.Haskell.GhcMod.Read -import Language.Haskell.GhcMod.Options.DocUtils -import Language.Haskell.GhcMod.Options.Help +import GhcMod.Read +import GhcMod.Options.DocUtils +import GhcMod.Options.Help import Data.Monoid import Prelude diff --git a/core/Language/Haskell/GhcMod/Output.hs b/core/GhcMod/Output.hs similarity index 97% rename from core/Language/Haskell/GhcMod/Output.hs rename to core/GhcMod/Output.hs index 9a02b1c..0d39398 100644 --- a/core/Language/Haskell/GhcMod/Output.hs +++ b/core/GhcMod/Output.hs @@ -18,7 +18,7 @@ -- Copyright (c) The University of Glasgow 2004-2008 {-# LANGUAGE FlexibleInstances #-} -module Language.Haskell.GhcMod.Output ( +module GhcMod.Output ( gmPutStr , gmErrStr , gmPutStrLn @@ -53,9 +53,9 @@ import Pipes import Pipes.Lift import Prelude -import Language.Haskell.GhcMod.Types hiding (LineSeparator, MonadIO(..)) -import Language.Haskell.GhcMod.Monad.Types hiding (MonadIO(..)) -import Language.Haskell.GhcMod.Gap () +import GhcMod.Types hiding (LineSeparator, MonadIO(..)) +import GhcMod.Monad.Types hiding (MonadIO(..)) +import GhcMod.Gap () class ProcessOutput a where hGetContents' :: Handle -> IO a diff --git a/core/Language/Haskell/GhcMod/PathsAndFiles.hs b/core/GhcMod/PathsAndFiles.hs similarity index 96% rename from core/Language/Haskell/GhcMod/PathsAndFiles.hs rename to core/GhcMod/PathsAndFiles.hs index dcb982e..c55987c 100644 --- a/core/Language/Haskell/GhcMod/PathsAndFiles.hs +++ b/core/GhcMod/PathsAndFiles.hs @@ -14,9 +14,9 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module Language.Haskell.GhcMod.PathsAndFiles ( - module Language.Haskell.GhcMod.PathsAndFiles - , module Language.Haskell.GhcMod.Caching +module GhcMod.PathsAndFiles ( + module GhcMod.PathsAndFiles + , module GhcMod.Caching ) where import Config (cProjectVersion) @@ -34,9 +34,9 @@ import System.Directory import System.FilePath import System.Process -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Caching -import qualified Language.Haskell.GhcMod.Utils as U +import GhcMod.Types +import GhcMod.Caching +import qualified GhcMod.Utils as U import Utils (mightExist) import Prelude diff --git a/core/Language/Haskell/GhcMod/Pretty.hs b/core/GhcMod/Pretty.hs similarity index 94% rename from core/Language/Haskell/GhcMod/Pretty.hs rename to core/GhcMod/Pretty.hs index 35718a8..9f6145b 100644 --- a/core/Language/Haskell/GhcMod/Pretty.hs +++ b/core/GhcMod/Pretty.hs @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module Language.Haskell.GhcMod.Pretty +module GhcMod.Pretty ( renderGm , renderSDoc , gmComponentNameDoc @@ -35,9 +35,9 @@ import Pretty import GHC import Outputable (SDoc, withPprStyleDoc) -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Doc -import Language.Haskell.GhcMod.Gap (renderGm) +import GhcMod.Types +import GhcMod.Doc +import GhcMod.Gap (renderGm) renderSDoc :: GhcMonad m => SDoc -> m Doc renderSDoc sdoc = do diff --git a/core/Language/Haskell/GhcMod/Read.hs b/core/GhcMod/Read.hs similarity index 99% rename from core/Language/Haskell/GhcMod/Read.hs rename to core/GhcMod/Read.hs index 21b5b65..3297f51 100644 --- a/core/Language/Haskell/GhcMod/Read.hs +++ b/core/GhcMod/Read.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Read where +module GhcMod.Read where import Text.Read (readPrec_to_S, readPrec, minPrec) import qualified Text.ParserCombinators.ReadP as P diff --git a/core/Language/Haskell/GhcMod/SrcUtils.hs b/core/GhcMod/SrcUtils.hs similarity index 97% rename from core/Language/Haskell/GhcMod/SrcUtils.hs rename to core/GhcMod/SrcUtils.hs index 5829fde..30999f3 100644 --- a/core/Language/Haskell/GhcMod/SrcUtils.hs +++ b/core/GhcMod/SrcUtils.hs @@ -2,7 +2,7 @@ {-# LANGUAGE CPP, TupleSections, FlexibleInstances, Rank2Types #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -module Language.Haskell.GhcMod.SrcUtils where +module GhcMod.SrcUtils where import Control.Applicative import CoreUtils (exprType) @@ -17,9 +17,9 @@ import qualified Type as G import GHC.SYB.Utils import GhcMonad import qualified Language.Haskell.Exts as HE -import Language.Haskell.GhcMod.Doc -import Language.Haskell.GhcMod.Gap -import qualified Language.Haskell.GhcMod.Gap as Gap +import GhcMod.Doc +import GhcMod.Gap +import qualified GhcMod.Gap as Gap import OccName (OccName) import Outputable (PprStyle) import TcHsSyn (hsPatType) diff --git a/core/Language/Haskell/GhcMod/Stack.hs b/core/GhcMod/Stack.hs similarity index 92% rename from core/Language/Haskell/GhcMod/Stack.hs rename to core/GhcMod/Stack.hs index e733c88..0c0ada0 100644 --- a/core/Language/Haskell/GhcMod/Stack.hs +++ b/core/GhcMod/Stack.hs @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module Language.Haskell.GhcMod.Stack where +module GhcMod.Stack where import Safe import Control.Applicative @@ -30,12 +30,12 @@ import System.FilePath import System.Info.Extra import Exception -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Output -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Error -import qualified Language.Haskell.GhcMod.Utils as U +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.Output +import GhcMod.Logging +import GhcMod.Error +import qualified GhcMod.Utils as U import Prelude patchStackPrograms :: (IOish m, GmOut m) => Cradle -> Programs -> m Programs diff --git a/core/Language/Haskell/GhcMod/Target.hs b/core/GhcMod/Target.hs similarity index 96% rename from core/Language/Haskell/GhcMod/Target.hs rename to core/GhcMod/Target.hs index f0eeeb6..1b61f9e 100644 --- a/core/Language/Haskell/GhcMod/Target.hs +++ b/core/GhcMod/Target.hs @@ -15,7 +15,7 @@ -- along with this program. If not, see . {-# LANGUAGE CPP, ViewPatterns, NamedFieldPuns, RankNTypes #-} -module Language.Haskell.GhcMod.Target where +module GhcMod.Target where import Control.Arrow import Control.Applicative @@ -30,20 +30,20 @@ import DynFlags import HscTypes import Pretty -import Language.Haskell.GhcMod.DynFlags -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.CabalHelper -import Language.Haskell.GhcMod.HomeModuleGraph -import Language.Haskell.GhcMod.PathsAndFiles -import Language.Haskell.GhcMod.GhcPkg -import Language.Haskell.GhcMod.Error -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Utils as U -import Language.Haskell.GhcMod.FileMapping -import Language.Haskell.GhcMod.LightGhc -import Language.Haskell.GhcMod.CustomPackageDb -import Language.Haskell.GhcMod.Output +import GhcMod.DynFlags +import GhcMod.Monad.Types +import GhcMod.CabalHelper +import GhcMod.HomeModuleGraph +import GhcMod.PathsAndFiles +import GhcMod.GhcPkg +import GhcMod.Error +import GhcMod.Logging +import GhcMod.Types +import GhcMod.Utils as U +import GhcMod.FileMapping +import GhcMod.LightGhc +import GhcMod.CustomPackageDb +import GhcMod.Output import Safe import Data.Maybe diff --git a/core/Language/Haskell/GhcMod/Types.hs b/core/GhcMod/Types.hs similarity index 98% rename from core/Language/Haskell/GhcMod/Types.hs rename to core/GhcMod/Types.hs index 4836abb..7eccdac 100644 --- a/core/Language/Haskell/GhcMod/Types.hs +++ b/core/GhcMod/Types.hs @@ -2,8 +2,8 @@ StandaloneDeriving, DefaultSignatures, FlexibleInstances, TemplateHaskell, GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans -fno-warn-deprecations #-} -module Language.Haskell.GhcMod.Types ( - module Language.Haskell.GhcMod.Types +module GhcMod.Types ( + module GhcMod.Types , ModuleName , mkModuleName , moduleNameString @@ -40,7 +40,7 @@ import GHC.Generics import Pretty (Doc) import Prelude -import Language.Haskell.GhcMod.Caching.Types +import GhcMod.Caching.Types -- | A constraint alias (-XConstraintKinds) to make functions dealing with -- 'GhcModT' somewhat cleaner. diff --git a/core/Language/Haskell/GhcMod/Utils.hs b/core/GhcMod/Utils.hs similarity index 96% rename from core/Language/Haskell/GhcMod/Utils.hs rename to core/GhcMod/Utils.hs index c923750..38062b6 100644 --- a/core/Language/Haskell/GhcMod/Utils.hs +++ b/core/GhcMod/Utils.hs @@ -17,8 +17,8 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DoAndIfThenElse #-} -module Language.Haskell.GhcMod.Utils ( - module Language.Haskell.GhcMod.Utils +module GhcMod.Utils ( + module GhcMod.Utils , module Utils , readProcess ) where @@ -30,9 +30,9 @@ import Data.Maybe (fromMaybe) import Data.Either (rights) import Data.List (inits) import Exception -import Language.Haskell.GhcMod.Error -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types +import GhcMod.Error +import GhcMod.Types +import GhcMod.Monad.Types import System.Directory import System.Environment import System.FilePath diff --git a/core/Language/Haskell/GhcMod/World.hs b/core/GhcMod/World.hs similarity index 86% rename from core/Language/Haskell/GhcMod/World.hs rename to core/GhcMod/World.hs index d166b49..374a1d5 100644 --- a/core/Language/Haskell/GhcMod/World.hs +++ b/core/GhcMod/World.hs @@ -1,10 +1,10 @@ -module Language.Haskell.GhcMod.World where +module GhcMod.World where -import Language.Haskell.GhcMod.GhcPkg -import Language.Haskell.GhcMod.PathsAndFiles -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.Utils +import GhcMod.GhcPkg +import GhcMod.PathsAndFiles +import GhcMod.Types +import GhcMod.Monad.Types +import GhcMod.Utils import Control.Applicative import Data.Maybe diff --git a/ghc-mod.cabal b/ghc-mod.cabal index fb05305..edc6a95 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -30,7 +30,7 @@ Data-Files: elisp/Makefile elisp/*.el Extra-Source-Files: ChangeLog README.md - core/Language/Haskell/GhcMod/Monad/Compat.hs_h + core/GhcMod/Monad/Compat.hs_h test/data/annotations/*.hs test/data/broken-cabal/*.cabal test/data/broken-sandbox/cabal.sandbox.config @@ -110,60 +110,60 @@ Library HS-Source-Dirs: ., core, shared Exposed-Modules: GhcMod - GhcModExe.Boot - GhcModExe.Browse - GhcModExe.CaseSplit - GhcModExe.Check - GhcModExe.Debug - GhcModExe.FillSig - GhcModExe.Find - GhcModExe.Flag - GhcModExe.Info - GhcModExe.Internal - GhcModExe.Lang - GhcModExe.Lint - GhcModExe.Modules - GhcModExe.PkgDoc - GhcModExe.Test - Language.Haskell.GhcMod.CabalHelper - Language.Haskell.GhcMod.Caching - Language.Haskell.GhcMod.Caching.Types - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.CustomPackageDb - Language.Haskell.GhcMod.DebugLogger - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.DynFlagsTH - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FileMapping - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.HomeModuleGraph - Language.Haskell.GhcMod.LightGhc - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Logging - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.Monad.Env - Language.Haskell.GhcMod.Monad.Log - Language.Haskell.GhcMod.Monad.Newtypes - Language.Haskell.GhcMod.Monad.Orphans - Language.Haskell.GhcMod.Monad.Out - Language.Haskell.GhcMod.Monad.State - Language.Haskell.GhcMod.Monad.Types - Language.Haskell.GhcMod.Options.DocUtils - Language.Haskell.GhcMod.Options.Help - Language.Haskell.GhcMod.Options.Options - Language.Haskell.GhcMod.Output - Language.Haskell.GhcMod.PathsAndFiles - Language.Haskell.GhcMod.Pretty - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Stack - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Language.Haskell.GhcMod.World + GhcMod.Exe.Boot + GhcMod.Exe.Browse + GhcMod.Exe.CaseSplit + GhcMod.Exe.Check + GhcMod.Exe.Debug + GhcMod.Exe.FillSig + GhcMod.Exe.Find + GhcMod.Exe.Flag + GhcMod.Exe.Info + GhcMod.Exe.Internal + GhcMod.Exe.Lang + GhcMod.Exe.Lint + GhcMod.Exe.Modules + GhcMod.Exe.PkgDoc + GhcMod.Exe.Test + GhcMod.CabalHelper + GhcMod.Caching + GhcMod.Caching.Types + GhcMod.Convert + GhcMod.Cradle + GhcMod.CustomPackageDb + GhcMod.DebugLogger + GhcMod.Doc + GhcMod.DynFlags + GhcMod.DynFlagsTH + GhcMod.Error + GhcMod.FileMapping + GhcMod.Gap + GhcMod.GhcPkg + GhcMod.HomeModuleGraph + GhcMod.LightGhc + GhcMod.Logger + GhcMod.Logging + GhcMod.Monad + GhcMod.Monad.Env + GhcMod.Monad.Log + GhcMod.Monad.Newtypes + GhcMod.Monad.Orphans + GhcMod.Monad.Out + GhcMod.Monad.State + GhcMod.Monad.Types + GhcMod.Options.DocUtils + GhcMod.Options.Help + GhcMod.Options.Options + GhcMod.Output + GhcMod.PathsAndFiles + GhcMod.Pretty + GhcMod.Read + GhcMod.SrcUtils + GhcMod.Stack + GhcMod.Target + GhcMod.Types + GhcMod.Utils + GhcMod.World Other-Modules: Paths_ghc_mod Utils Data.Binary.Generic @@ -213,12 +213,12 @@ Library Executable ghc-mod Default-Language: Haskell2010 - Main-Is: GHCModMain.hs + Main-Is: GhcModMain.hs Other-Modules: Paths_ghc_mod - , GHCMod.Options - , GHCMod.Options.Commands - , GHCMod.Version - , GHCMod.Options.ShellParse + , GhcMod.Exe.Options + , GhcMod.Exe.Options.Commands + , GhcMod.Exe.Version + , GhcMod.Exe.Options.ShellParse GHC-Options: -Wall -fno-warn-deprecations -threaded Default-Extensions: ConstraintKinds, FlexibleContexts HS-Source-Dirs: src, shared @@ -243,7 +243,7 @@ Executable ghc-mod Executable ghc-modi Default-Language: Haskell2010 - Main-Is: GHCModi.hs + Main-Is: GhcModi.hs Other-Modules: Paths_ghc_mod Utils System.Directory.ModTime diff --git a/src/GHCMod/Options.hs b/src/GhcMod/Exe/Options.hs similarity index 89% rename from src/GHCMod/Options.hs rename to src/GhcMod/Exe/Options.hs index 8549fbd..936dd97 100644 --- a/src/GHCMod/Options.hs +++ b/src/GhcMod/Exe/Options.hs @@ -16,7 +16,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -module GHCMod.Options ( +module GhcMod.Exe.Options ( parseArgs, parseArgsInteractive, GhcModCommands(..) @@ -25,12 +25,12 @@ module GHCMod.Options ( import Options.Applicative import Options.Applicative.Types -import GHCMod.Options.Commands -import GHCMod.Options.ShellParse -import GHCMod.Version -import Language.Haskell.GhcMod.Options.DocUtils -import Language.Haskell.GhcMod.Options.Options -import Language.Haskell.GhcMod.Types +import GhcMod.Exe.Options.Commands +import GhcMod.Exe.Options.ShellParse +import GhcMod.Exe.Version +import GhcMod.Options.DocUtils +import GhcMod.Options.Options +import GhcMod.Types parseArgs :: IO (Options, GhcModCommands) parseArgs = diff --git a/src/GHCMod/Options/Commands.hs b/src/GhcMod/Exe/Options/Commands.hs similarity index 98% rename from src/GHCMod/Options/Commands.hs rename to src/GhcMod/Exe/Options/Commands.hs index cc9f64f..cd8ef55 100644 --- a/src/GHCMod/Options/Commands.hs +++ b/src/GhcMod/Exe/Options/Commands.hs @@ -16,16 +16,16 @@ {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -module GHCMod.Options.Commands where +module GhcMod.Exe.Options.Commands where import Data.Semigroup import Options.Applicative import Options.Applicative.Types import Options.Applicative.Builder.Internal -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Read -import Language.Haskell.GhcMod.Options.DocUtils -import Language.Haskell.GhcMod.Options.Help +import GhcMod.Types +import GhcMod.Read +import GhcMod.Options.DocUtils +import GhcMod.Options.Help type Symbol = String type Expr = String diff --git a/src/GHCMod/Options/ShellParse.hs b/src/GhcMod/Exe/Options/ShellParse.hs similarity index 96% rename from src/GHCMod/Options/ShellParse.hs rename to src/GhcMod/Exe/Options/ShellParse.hs index 6a74dc2..e9c73d7 100644 --- a/src/GHCMod/Options/ShellParse.hs +++ b/src/GhcMod/Exe/Options/ShellParse.hs @@ -13,7 +13,7 @@ -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module GHCMod.Options.ShellParse (parseCmdLine) where +module GhcMod.Exe.Options.ShellParse (parseCmdLine) where import Data.Char import Data.List diff --git a/src/GHCMod/Version.hs b/src/GhcMod/Exe/Version.hs similarity index 97% rename from src/GHCMod/Version.hs rename to src/GhcMod/Exe/Version.hs index c151c04..b27e8c0 100644 --- a/src/GHCMod/Version.hs +++ b/src/GhcMod/Exe/Version.hs @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module GHCMod.Version where +module GhcMod.Exe.Version where import Paths_ghc_mod import Data.Version (showVersion) diff --git a/src/GHCModMain.hs b/src/GhcModMain.hs similarity index 96% rename from src/GHCModMain.hs rename to src/GhcModMain.hs index 2e74b3d..d4c0116 100644 --- a/src/GHCModMain.hs +++ b/src/GhcModMain.hs @@ -7,7 +7,7 @@ import Control.Monad import Data.Typeable (Typeable) import Data.List import Data.List.Split -import Language.Haskell.GhcMod.Pretty +import GhcMod.Pretty import System.FilePath (()) import System.Directory (setCurrentDirectory, getAppUserDataDirectory, removeDirectoryRecursive) @@ -15,12 +15,12 @@ import System.IO import System.Exit import Prelude -import GHCMod.Options import GhcMod -import GhcModExe.Find -import GhcModExe.Internal hiding (MonadIO,liftIO) -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Types +import GhcMod.Exe.Find +import GhcMod.Exe.Options +import GhcMod.Exe.Internal hiding (MonadIO,liftIO) +import GhcMod.Monad +import GhcMod.Types import Exception diff --git a/src/GHCModi.hs b/src/GhcModi.hs similarity index 100% rename from src/GHCModi.hs rename to src/GhcModi.hs diff --git a/test/CabalHelperSpec.hs b/test/CabalHelperSpec.hs index 1645c81..c14ed38 100644 --- a/test/CabalHelperSpec.hs +++ b/test/CabalHelperSpec.hs @@ -4,9 +4,9 @@ module CabalHelperSpec where import Control.Arrow import Control.Applicative import Distribution.Helper -import Language.Haskell.GhcMod.CabalHelper -import Language.Haskell.GhcMod.PathsAndFiles -import Language.Haskell.GhcMod.Error +import GhcMod.CabalHelper +import GhcMod.PathsAndFiles +import GhcMod.Error import Test.Hspec import System.Directory import System.FilePath diff --git a/test/CradleSpec.hs b/test/CradleSpec.hs index c62a589..02c6d5b 100644 --- a/test/CradleSpec.hs +++ b/test/CradleSpec.hs @@ -2,8 +2,8 @@ module CradleSpec where import Control.Applicative import Data.List (isSuffixOf) -import Language.Haskell.GhcMod.Cradle -import Language.Haskell.GhcMod.Types +import GhcMod.Cradle +import GhcMod.Types import System.Directory (canonicalizePath) import System.FilePath (pathSeparator) import Test.Hspec diff --git a/test/CustomPackageDbSpec.hs b/test/CustomPackageDbSpec.hs index c19c193..f25d59a 100644 --- a/test/CustomPackageDbSpec.hs +++ b/test/CustomPackageDbSpec.hs @@ -1,8 +1,8 @@ module CustomPackageDbSpec where -import Language.Haskell.GhcMod.CabalHelper -import Language.Haskell.GhcMod.CustomPackageDb -import Language.Haskell.GhcMod.Error +import GhcMod.CabalHelper +import GhcMod.CustomPackageDb +import GhcMod.Error import System.Process import Test.Hspec import Prelude diff --git a/test/FileMappingSpec.hs b/test/FileMappingSpec.hs index 5b50e6c..aec284d 100644 --- a/test/FileMappingSpec.hs +++ b/test/FileMappingSpec.hs @@ -1,7 +1,7 @@ module FileMappingSpec where -import Language.Haskell.GhcMod.FileMapping -import Language.Haskell.GhcMod.Utils (withMappedFile) +import GhcMod.FileMapping +import GhcMod.Utils (withMappedFile) import Test.Hspec import TestUtils import qualified Data.Map as M diff --git a/test/FindSpec.hs b/test/FindSpec.hs index 2ccf346..b98376a 100644 --- a/test/FindSpec.hs +++ b/test/FindSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module FindSpec where -import GhcModExe.Find +import GhcMod.Exe.Find import Test.Hspec import TestUtils diff --git a/test/GhcPkgSpec.hs b/test/GhcPkgSpec.hs index 69d9661..19a1604 100644 --- a/test/GhcPkgSpec.hs +++ b/test/GhcPkgSpec.hs @@ -1,8 +1,8 @@ module GhcPkgSpec where -import Language.Haskell.GhcMod.GhcPkg -import Language.Haskell.GhcMod.CabalHelper -import Language.Haskell.GhcMod.CustomPackageDb +import GhcMod.GhcPkg +import GhcMod.CabalHelper +import GhcMod.CustomPackageDb import Test.Hspec import System.Process (system) diff --git a/test/HomeModuleGraphSpec.hs b/test/HomeModuleGraphSpec.hs index 9e10987..8f534e1 100644 --- a/test/HomeModuleGraphSpec.hs +++ b/test/HomeModuleGraphSpec.hs @@ -18,8 +18,8 @@ module HomeModuleGraphSpec where -import Language.Haskell.GhcMod.HomeModuleGraph -import Language.Haskell.GhcMod.LightGhc +import GhcMod.HomeModuleGraph +import GhcMod.LightGhc import TestUtils import GHC diff --git a/test/PathsAndFilesSpec.hs b/test/PathsAndFilesSpec.hs index d3611f1..cd0f6d5 100644 --- a/test/PathsAndFilesSpec.hs +++ b/test/PathsAndFilesSpec.hs @@ -1,9 +1,9 @@ module PathsAndFilesSpec where -import Language.Haskell.GhcMod.PathsAndFiles -import Language.Haskell.GhcMod.Cradle -import qualified Language.Haskell.GhcMod.Utils as U +import GhcMod.PathsAndFiles +import GhcMod.Cradle +import qualified GhcMod.Utils as U import Control.Monad.Trans.Maybe import System.Directory diff --git a/test/ShellParseSpec.hs b/test/ShellParseSpec.hs index 2c5cefe..751f404 100644 --- a/test/ShellParseSpec.hs +++ b/test/ShellParseSpec.hs @@ -1,7 +1,7 @@ module ShellParseSpec where -import GHCMod.Options.ShellParse +import GhcMod.Exe.Options.ShellParse import Test.Hspec diff --git a/test/TargetSpec.hs b/test/TargetSpec.hs index f5ceef2..dcc2362 100644 --- a/test/TargetSpec.hs +++ b/test/TargetSpec.hs @@ -1,9 +1,9 @@ {-# LANGUAGE OverloadedStrings #-} module TargetSpec where -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.LightGhc -import Language.Haskell.GhcMod.Gap +import GhcMod.Target +import GhcMod.LightGhc +import GhcMod.Gap import Test.Hspec import TestUtils diff --git a/test/TestUtils.hs b/test/TestUtils.hs index af5367b..3d252f1 100644 --- a/test/TestUtils.hs +++ b/test/TestUtils.hs @@ -10,14 +10,14 @@ module TestUtils ( , shouldReturnError , isPkgDbAt , isPkgConfDAt - , module Language.Haskell.GhcMod.Monad - , module Language.Haskell.GhcMod.Types + , module GhcMod.Monad + , module GhcMod.Types ) where -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Cradle -import Language.Haskell.GhcMod.Types +import GhcMod.Logging +import GhcMod.Monad +import GhcMod.Cradle +import GhcMod.Types import Control.Arrow import Control.Category