Commit Graph

781 Commits

Author SHA1 Message Date
Daniel Vigovszky
3b7d51d25a Removed unused function 2015-04-24 10:41:39 +02:00
Daniel Vigovszky
308c2d7963 Undo indenation change in Types.hs 2015-04-23 17:31:54 +02:00
Daniel Vigovszky
5d9d6f5630 Custom cradle support 2015-04-23 17:25:45 +02:00
Daniel Gröber
247e4e0e76 Decrease default log level 2015-04-15 13:13:22 +02:00
Daniel Gröber
fb19d021ca Fix a few warnings 2015-04-14 21:39:11 +02:00
Daniel Gröber
95b16ded6d Fix checkComponent 2015-04-14 00:53:40 +02:00
Daniel Gröber
9077e96aeb Fix tests 2015-04-13 23:16:14 +02:00
Daniel Gröber
94ef8fae79 Enhance debug information 2015-04-12 02:48:54 +02:00
Daniel Gröber
ee4ee8765e Fix weird resolveModule double path issue
`mconcat` recurses into `Maybe a` which is not what I want, I just want
the first `Just` value
2015-04-12 02:48:54 +02:00
Daniel Gröber
d7984faf79 No double : in logmsgs without a location 2015-04-12 02:48:54 +02:00
Daniel Gröber
2bf4c80580 Fix finding consistent component solution for targets
Union does the wrong thing, I wanted an intersection here.
2015-04-12 02:48:54 +02:00
Daniel Gröber
39a8ded102 Fix resolved component caching 2015-04-12 02:48:54 +02:00
Daniel Gröber
ca79f99c3e Also add language options when resolving components 2015-04-12 02:48:54 +02:00
Daniel Gröber
6f59f07f00 Fix non canonicalized paths 2015-04-12 02:48:54 +02:00
Daniel Gröber
523f43c3c9 Fix some tests 2015-04-12 02:48:54 +02:00
Daniel Gröber
d0ca3ee807 Fix MonadIO mess 2015-04-12 02:48:54 +02:00
Daniel Gröber
f3b4da7a0e Use cabal-helper to get buildPlatform 2015-04-12 02:48:53 +02:00
Daniel Gröber
55216e4af3 ifdef for ghc < 7.10 2015-03-28 19:54:10 +01:00
Markus Hauck
e3812b49ec GHC 7.10.0.20150123 fixes 2015-03-28 19:13:51 +01:00
Daniel Gröber
80d91776c5 Cleanup and some fixes 2015-03-28 19:13:48 +01:00
Daniel Gröber
2a02742f9e Write autogen file when calling cabal configure 2015-03-28 02:32:47 +01:00
Daniel Gröber
7019cbcfa1 Implement better caching for target options 2015-03-28 02:32:44 +01:00
Daniel Gröber
90d9577f8d Factor out cabal-helper into a package 2015-03-15 20:48:55 +01:00
Daniel Gröber
a97e07065e Don't set -Wall on check 2015-03-15 20:48:05 +01:00
Daniel Gröber
6756f1d10b Get rid of some warnings with ghc-7.8 2015-03-11 13:17:24 +01:00
Daniel Gröber
539c294dd4 Fix a bunch of relate exception handling problems
should handle exceptions outside of runGmlT otherwise we don't catch ghc
load related ones.
2015-03-09 22:04:04 +01:00
Daniel Gröber
7d7f848afb Fix cabal-helper ignoring --with-* flags 2015-03-08 20:53:00 +01:00
Daniel Gröber
1ac71364a9 Fix use of (head . lines) 2015-03-08 17:33:09 +01:00
Daniel Gröber
a6d3f477bc Add better handling for empty component assignments 2015-03-08 17:32:17 +01:00
Daniel Gröber
baf5cad809 Pass through --with-* options to cabal-helper 2015-03-07 19:37:19 +01:00
Daniel Gröber
85d4844a0d Improve suggestions on inconsistent assignment 2015-03-06 19:49:26 +01:00
Daniel Gröber
e23772b1ed Recache cabal-helper stuff when cabal-helper-* executable changes 2015-03-06 19:48:22 +01:00
Daniel Gröber
c05bd816e7 Add quiet option to decrease log level 2015-03-06 19:47:51 +01:00
Daniel Gröber
c8da5b8085 Fix line endings in logging output 2015-03-06 14:04:49 +01:00
Daniel Gröber
2151363dd6 Add back -d option to modules command 2015-03-05 19:38:18 +01:00
Daniel Gröber
01dde80385 Bring test suite up to date 2015-03-05 17:35:28 +01:00
Daniel Gröber
f0ea445a9b Cleanup errors and logging a bit 2015-03-05 17:35:28 +01:00
Daniel Gröber
bc71877dcf Change the way cabal-helper is built a bit 2015-03-05 17:35:28 +01:00
Daniel Gröber
82bb0090c0 Refactoring to use cabal-helper-wrapper
This turned out to be quite involved but save for this huge commit it's
actually quite awesome and squashes quite a few bugs and nasty
problems (hopefully). Most importantly we now have native cabal
component support without the user having to do anything to get it!

To do this we traverse imports starting from each component's
entrypoints (library modules or Main source file for executables) and
use this information to find which component's options each module will
build with. Under the assumption that these modules have to build with
every component they're used in we can now just pick one.

Quite a few internal assumptions have been invalidated by this
change. Most importantly the runGhcModT* family of cuntions now change
the current working directory to `cradleRootDir`.
2015-03-05 17:35:24 +01:00
Daniel Gröber
7438539ca5 Change primary license to AGPL-3 2015-03-03 21:09:18 +01:00
Daniel Gröber
ef96b926c7 Use cabal-helper to support Cabal >= 1.22 with any version of ghc 2015-02-08 12:43:35 +01:00
Daniel Gröber
844bdea3db Move symbolCache to PathsAndFiles 2015-02-08 12:43:35 +01:00
Daniel Gröber
1c5a1c8b3e Add util function for finding libexec binaries 2015-02-08 12:43:35 +01:00
Daniel Gröber
417cacbf81 Fix finding sandbox in sandbox only projects 2015-02-08 12:43:35 +01:00
Daniel Gröber
2b4fd77c28 Add GHC-7.10 support 2015-02-08 12:43:35 +01:00
Daniel Gröber
45d6b7d67a Guess right sandbox pkg-db path on ghc version mismatch
If cabal.sandbox.config contains a "package-db:" declaration with the
wrong path and only the ghc version is wrong, for example:

```
package-db: <DIR>/.cabal-sandbox/x86_64-linux-ghc-7.8.3-packages.conf.d
```

Even though the user is using 7.10.0.20141222 `cabal repl` will correct
this and pass

```
-package-db <DIR>/.cabal-sandbox/x86_64-linux-ghc-7.10.0.20141222-packages.conf.d
```

to ghci, so obviously Cabal/cabal-install is doing some magic.

Conflicts:
	Language/Haskell/GhcMod/PathsAndFiles.hs
2015-02-08 12:43:25 +01:00
Daniel Gröber
ce61f38f4d Remove a bunch of dead code 2015-01-03 00:36:12 +01:00
klapaucius
fc7ce47e93 fix for varid bug in showExports & processExports 2014-12-24 22:17:36 +01:00
Dimitri 'phaazon' Sabadie
f023f4fc06 Fixed #422. 2014-12-24 22:12:36 +01:00
Daniel Gröber
782f234981 Fix ghc-mod tempdirs not being removed on exit 2014-12-24 21:34:57 +01:00
Daniel Gröber
80e826a199 Prefix ghc-mod tmpdirs with "ghc-mod" 2014-12-24 21:34:39 +01:00
Daniel Gröber
9a8a3651d0 Fix findCabalFile 2014-11-03 00:45:27 +01:00
Daniel Gröber
506cf18885 Don't use fromJust 2014-11-03 00:33:23 +01:00
Rob Everest
56cc237e26 Support where clauses, let bindings and case expressions in case splitting (fixes #395) 2014-11-03 00:15:12 +01:00
Daniel Gröber
833d9ce058 $HOME/.cabal is not a cabal file 2014-11-03 00:04:15 +01:00
Daniel Gröber
94a60350c8 docs 2014-11-02 21:43:49 +01:00
Daniel Gröber
0cdbcb247b Fix warning 2014-11-02 19:27:57 +01:00
Daniel Gröber
2af3383fad Really fix newTempDir on Windows 2014-11-02 19:02:05 +01:00
Daniel Gröber
37af8e368d Refactoring World, etc. and fix #387 2014-11-02 01:19:27 +01:00
Daniel Gröber
14ee81e300 Allow GhcModError as an Exception and catch it in GhcModT's liftIO 2014-10-31 22:23:48 +01:00
Daniel Gröber
1797a53800 Fix newTempDir on Windows 2014-10-31 12:42:03 +01:00
Daniel Gröber
34dd9de83c Add Show instance for Options 2014-10-30 01:11:10 +01:00
Daniel Gröber
9ac128aa6f Fix #387, Pattern match failure in GhcPkg 2014-10-30 01:10:56 +01:00
Kazu Yamamoto
33d6f38a20 removing a warning. 2014-10-06 15:55:16 +09:00
Kazu Yamamoto
ef371a7ebf fixing tests. 2014-10-06 15:29:05 +09:00
Daniel Gröber
ab7059d5e4 Merge remote-tracking branch 'upstream/no-set'
Conflicts:
	Language/Haskell/GhcMod/Find.hs
2014-10-03 21:39:20 +02:00
Kazu Yamamoto
c4929c54af getConfig runs "cabal configure" first if setup-config is invalid. 2014-09-23 21:28:03 +09:00
Kazu Yamamoto
7db266c22d adding World.hs. 2014-09-23 17:34:09 +09:00
Kazu Yamamoto
9ed4aa8fdf using void. 2014-09-23 14:55:56 +09:00
Kazu Yamamoto
735b80d0cc exporting setupConfigFile. 2014-09-23 14:49:13 +09:00
Kazu Yamamoto
d831d6aa59 moving PackageDb stuff to GhcPkg. 2014-09-23 13:47:32 +09:00
Kazu Yamamoto
71bbd1c5d4 removing warnings. 2014-09-22 11:32:28 +09:00
Kazu Yamamoto
bc65c477d0 fixing typo. 2014-09-22 11:20:11 +09:00
Kazu Yamamoto
b96a8c6457 check does not use overrideGhcUserOptions again.
- workaround for #376
- logically reverting ec1b115cc1
2014-09-22 10:46:46 +09:00
Kazu Yamamoto
e8988c2f02 ghc-modi's "find" now catches up if packageDb is updated. 2014-09-20 12:25:46 +09:00
Daniel Gröber
5a4bec8755 Rewrite ghc-mod command line frontend. 2014-09-18 10:45:14 +02:00
Daniel Gröber
34dd8c5bd9 Fix error when compiling with HSE < 1.16 2014-09-17 23:39:10 +02:00
Daniel Gröber
8f123dc7de Fix compiling with HSE >= 1.16.0 2014-09-16 05:50:00 +02:00
Daniel Gröber
b96ef00248 formatting: FillSig.hs 2014-09-16 05:49:56 +02:00
Daniel Gröber
690a64f5b5 Merge branch 'master' of https://github.com/robeverest/ghc-mod
Conflicts:
	Language/Haskell/GhcMod/CabalConfig.hs
2014-09-12 05:21:12 +02:00
Rob Everest
2c2e7782d2 Use the cabal configuration flags where possible when finalizing the PackageDescription. 2014-09-12 13:15:05 +10:00
Cary M. Robbins
8b01af6cde Handle LocalBuildInfo for Cabal 1.21; squash commits; fixes #343. 2014-09-12 04:50:29 +02:00
Daniel Gröber
1c8d1edb4d Workaround for #340 2014-09-12 04:02:32 +02:00
Daniel Gröber
8889c2e8e5 note 2014-09-11 01:27:19 +02:00
Daniel Gröber
83d780015c Use readProcess' in PkgDoc.hs 2014-09-11 01:26:42 +02:00
Daniel Gröber
274b5d8e1c Rephrase some docs 2014-08-29 17:21:38 +02:00
Daniel Gröber
a0ae09a3e6 Give readProcess' more sensible error messages.
Also a bunch of refactoring for GhcModError
2014-08-28 15:57:49 +02:00
Daniel Gröber
a7f00931c5 Rename List.hs -> Modules.hs 2014-08-28 11:41:03 +02:00
Daniel Gröber
42c0e8f913 docs: Move GhcModError to right export category in Monad.hs 2014-08-24 14:19:56 +02:00
Alan Zimmerman
0944820dba CaseSplit panic sorted. closes https://github.com/kazu-yamamoto/ghc-mod/issues/336 2014-08-23 14:06:26 +02:00
Kazu Yamamoto
d045001eb7 Letting "ghc-mod dumpsym" work on non-cabal directories. 2014-08-20 15:31:26 +09:00
Kazu Yamamoto
190dc2ac51 try to fix Travis CI. 2014-08-20 11:59:44 +09:00
Kazu Yamamoto
9456ea426d fixing typos. 2014-08-19 17:18:36 +09:00
Kazu Yamamoto
a483f4f8b6 error messages are stored after NG, not printed in stderr. 2014-08-19 14:56:01 +09:00
Kazu Yamamoto
ad3a42844d Merge pull request #330 from DanielG/dev-error
Remove dedicated exception handling in `check` completely
2014-08-19 11:52:09 +09:00
Daniel Gröber
147dd90ee7 Remove dedicated exception handling in check completely
Exceptions are already caught at the top level so this is unnecessary.
2014-08-19 04:49:44 +02:00
Kazu Yamamoto
af6de8c849 Merge pull request #329 from DanielG/dev-error
Remove `withErrorHandler`, use `liftExceptions` instead
2014-08-19 11:41:44 +09:00
Daniel Gröber
1b5917c70e Remove withErrorHandler, use liftExceptions instead 2014-08-19 04:30:44 +02:00
Alejandro Serrano
5b78711842 Revert way to report errors when deferred as warnings
Fixes #310
2014-08-18 17:32:32 +02:00
Kazu Yamamoto
0fd8b9afd8 first try to resolve #322. 2014-08-18 16:55:41 +09:00
Kazu Yamamoto
5a657b9df8 removing warnings 2014-08-18 15:24:38 +09:00
Daniel Gröber
271ff4e162 Catch cabal configure failure properly 2014-08-18 08:06:36 +02:00
Daniel Gröber
f5d051dcef Remove toGhcModT it's not needed anymore. 2014-08-15 20:35:21 +02:00
Alejandro Serrano
10042c6b0c Fix for GHC 7.4 2014-08-15 11:00:48 +02:00
Alejandro Serrano
57db768ed0 Fix for GHC 7.4 2014-08-15 10:46:52 +02:00
Alejandro Serrano
f584bf5d5b Show error messages without qualification 2014-08-15 10:43:07 +02:00
Alejandro Serrano
6b62117381 Remove redundant typed hole warnings 2014-08-15 09:41:02 +02:00
Alejandro Serrano
7612229cc0 Keep all errors and warnings for code 2014-08-15 09:32:28 +02:00
Alejandro Serrano
fdbecdddce Make better check in presence of typed holes 2014-08-14 20:51:49 +02:00
Alejandro Serrano
890658f9cb Fix merge conflict, dropdown-list no longer needed 2014-08-14 18:02:58 +02:00
Daniel Gröber
bd28310e59 Don't fall back to sandbox if cabal file failes to parse 2014-08-12 00:02:39 +02:00
Daniel Gröber
b13465b588 Some docs in CabalConfig.hs 2014-08-11 23:48:15 +02:00
Daniel Gröber
fad99f466f Export GhcModError(..) 2014-08-06 20:40:11 +02:00
Daniel Gröber
9e4f1c9057 add note 2014-08-06 19:38:42 +02:00
Daniel Gröber
cb28e9ec8f Fix warning 2014-08-06 19:38:42 +02:00
Daniel Gröber
c98eb23bdf Clean up getSymbolTable a bit more 2014-08-06 19:38:42 +02:00
Daniel Gröber
459106a6d5 Clean up Find.hs a bit 2014-08-06 19:38:42 +02:00
Daniel Gröber
f311efd90c Rework GhcModT monad stack 2014-08-06 19:38:42 +02:00
Alejandro Serrano
43ac9036f9 Fixes on GHC < 7.8 2014-08-04 17:25:18 +02:00
Alejandro Serrano
d1a6618329 More package fixes for GHC < 7.8 2014-08-03 20:38:54 +02:00
Alejandro Serrano
d22e50d9e4 Small fix to compile in GHC < 7.8 2014-08-03 19:57:01 +02:00
Alejandro Serrano
9cc6476df1 Add better support for auto, with several options searched 2014-08-03 19:14:42 +02:00
Alejandro Serrano
3aa83e14dd Show more than one Djinn completion 2014-08-02 09:52:36 +02:00
Alejandro Serrano
31a7ce3d19 Merge remote-tracking branch 'kazu/master' 2014-08-01 17:08:50 +02:00
Alejandro Serrano
9161757f95 First attempt to add auto 2014-08-01 17:08:23 +02:00
Kazu Yamamoto
d1daf6def9 Merge pull request #296 from serras/master
Add refinement and better support for typed holes in Emacs mode
2014-08-01 15:14:50 +09:00
Kenta Sato
92651fbb26 interpret backslash-escaped characters at the line boundary 2014-07-30 12:03:58 +09:00
Alejandro Serrano
e3853a49f1 Add fix for GHC 7.4 2014-07-27 14:11:54 +02:00
Alejandro Serrano
f1d0436467 Remove case splitting for type families 2014-07-27 12:20:46 +02:00
Alejandro Serrano
9b500da4b8 Another try at case split for type families 2014-07-26 13:07:45 +02:00
Alejandro Serrano
9b38818f66 Merge remote-tracking branch 'kazu/master' 2014-07-24 20:21:44 +02:00
Alejandro Serrano
361fe24be0 Start case splitting on type families (NOT working) 2014-07-24 20:21:05 +02:00
Alejandro Serrano
d9c6638493 Work on initial signature for type families 2014-07-24 20:20:30 +02:00
Kazu Yamamoto
10ef20b967 Merge pull request #293 from DanielG/dev-exec-path
Fall back to getProgName when exeutable name is not available
2014-07-21 11:11:25 +09:00
Daniel Gröber
0736516512 Document exposed parts of GhcMod.Monad 2014-07-21 00:27:12 +02:00
Daniel Gröber
ba9c70dff7 Fall back to assuming ghc-mid is on PATH when exeutable name is not available 2014-07-20 23:50:32 +02:00
Alejandro Serrano
eb5ec73ae1 Complete parenthesis on refinement 2014-07-20 13:33:36 +02:00
Alejandro Serrano
54d10684b9 Merge remote-tracking branch 'kazu/master' 2014-07-20 10:45:28 +02:00
Alejandro Serrano
ae49eab547 First steps in refinement 2014-07-19 12:11:34 +02:00
Alejandro Serrano
60e97d4579 Merge remote-tracking branch 'kazu/master' 2014-07-19 10:13:19 +02:00
Kazu Yamamoto
981051a642 implementing fallback from Simple to Intelligent. 2014-07-19 11:53:05 +09:00
Kazu Yamamoto
5abd75ea7d fixing a infinite process loop. 2014-07-19 11:50:12 +09:00
Alejandro Serrano
6302d4882e Merge remote-tracking branch 'kazu/master'
Conflicts:
	Language/Haskell/GhcMod/Check.hs
	Language/Haskell/GhcMod/FillSig.hs
	Language/Haskell/GhcMod/GHCApi.hs
2014-07-18 17:12:52 +02:00
Alejandro Serrano
852d742796 Continue work on refinement 2014-07-18 17:09:02 +02:00
Kazu Yamamoto
0080f9b68c Internal exports extra Monad stuff. 2014-07-18 15:42:05 +09:00
Kazu Yamamoto
30ddd655cd export minimum Monad stuff from GhcMod. 2014-07-18 15:31:42 +09:00
Kazu Yamamoto
e1d9c3b881 clean up lookupSymbol. 2014-07-18 15:13:30 +09:00
Kazu Yamamoto
6d42354a5b setMode and getMode 2014-07-18 14:55:21 +09:00
Kazu Yamamoto
7b079896b1 doc sectioning. 2014-07-18 14:55:08 +09:00
Kazu Yamamoto
26316262aa converting GhcMonad to IOish. 2014-07-18 14:54:39 +09:00
Kazu Yamamoto
233f4cf05e moving setFlags to Gap. 2014-07-18 11:09:11 +09:00
Kazu Yamamoto
0ce70ae22d set Opt_SpecConstr just in case. 2014-07-18 10:52:57 +09:00
Daniel Gröber
3c04e78ba7 Don't rely on ghc-mod being in PATH 2014-07-17 16:17:17 +02:00
Daniel Gröber
3c1b560068 Short circuit export list when compiling spec 2014-07-17 16:15:02 +02:00
Daniel Gröber
4f0f5f09a6 Remove type Db it's only used once and makes things less clear 2014-07-17 15:54:59 +02:00
Daniel Gröber
e61aaed023 Make readProcess'more generic 2014-07-17 15:52:33 +02:00
Kazu Yamamoto
cffa7463eb adopting hlint's suggestions. 2014-07-17 17:16:44 +09:00
Kazu Yamamoto
05f45f1d36 adding error handling. 2014-07-17 14:40:35 +09:00
Kazu Yamamoto
cf0df26560 Monad.hs is now exported by GhcMod.hs. 2014-07-17 14:30:42 +09:00
Kazu Yamamoto
74e84e89ac deleting GhcMod.Ghc. 2014-07-17 14:04:28 +09:00
Alejandro Serrano
b21fa674ea Merge remote-tracking branch 'kazu/master' 2014-07-17 06:59:29 +02:00
Alejandro Serrano
c3722f7a20 Include 'refine' again 2014-07-17 06:59:10 +02:00
Kazu Yamamoto
409bc99f10 error handling for loadSymbolDb. 2014-07-17 12:37:38 +09:00
Kazu Yamamoto
cee1b83daa the first step to create SymbolDB via a file. 2014-07-17 11:57:19 +09:00
Alejandro Serrano
57bd408785 Merge remote-tracking branch 'kazu/master'
Conflicts:
	Language/Haskell/GhcMod.hs
	Language/Haskell/GhcMod/Check.hs
	Language/Haskell/GhcMod/FillSig.hs
	Language/Haskell/GhcMod/GHCApi.hs
	Language/Haskell/GhcMod/Ghc.hs
	src/GHCMod.hs
2014-07-16 19:01:43 +02:00
Alejandro Serrano
49437d82d9 Initial work on refining variable 2014-07-16 18:20:52 +02:00
Kazu Yamamoto
204d449aef set optimization level to 0 just in case. 2014-07-15 21:34:05 +09:00
Kazu Yamamoto
49284a64be Uses HscNothing and falls back to HscInterpreted if necessary (#205)
Two Test case are fails but it is not fatal.
2014-07-15 17:20:35 +09:00
Kazu Yamamoto
25730e2a6c trying to fix CI 2014-07-15 15:13:06 +09:00
Kazu Yamamoto
c87ea45488 adding #if to Monad.hs. 2014-07-15 14:45:41 +09:00
Kazu Yamamoto
0b71748708 moving #if to Gap.hs 2014-07-15 14:44:02 +09:00
Kazu Yamamoto
a7a02a3f4c Bringing back MaybeT
This brings back a warning to be fixed.
2014-07-15 12:49:12 +09:00
Kazu Yamamoto
86829561ab style only. 2014-07-15 12:41:10 +09:00
Kazu Yamamoto
84c3cec0f1 moving #if to Gap.hs. 2014-07-15 12:40:18 +09:00
Kazu Yamamoto
be9a67f02a moving #if to Gap.hs. 2014-07-15 12:29:27 +09:00
Kazu Yamamoto
1524d2a43e removing warnings. 2014-07-15 12:10:18 +09:00
Kazu Yamamoto
8495633dc8 explicitly specifying CompManager to ghcMode. 2014-07-15 12:06:07 +09:00
Kazu Yamamoto
89a4db2345 Merge pull request #288 from DanielG/dev-pkgs
Make `GhcMod` be `GhcModT (ErrorT IO)`
2014-07-15 11:49:10 +09:00
Daniel Gröber
686179f12b Fix building with ghc < 7.8 2014-07-15 02:34:07 +02:00
Daniel Gröber
7474a1b652 Bring back GhcMod but this time it's a GhcModT with an ErrorT inside 2014-07-15 01:04:06 +02:00
Daniel Gröber
f0bfcb8811 Use GhcModT everywhere and remove the GhcMod alias
Not doing this makes having GhcModT pretty pointless as users of the
library wouldn't be able to use custom inner monads as evey function for
dealing with GhcModT's would be constraint to (GhcModT IO) thus only
allowing IO as the inner monad.
2014-07-15 01:03:56 +02:00
Kazu Yamamoto
d98cedc9c0 Merge pull request #287 from DanielG/dev-untangle
Untangle Monad.hs and GHCApi.hs and some other changes
2014-07-12 14:27:43 +09:00
Daniel Gröber
b6896a481a Move initializeFlagsWithCradle to Monad.hs 2014-07-12 03:33:04 +02:00
Daniel Gröber
503e8cbe06 Move DynFlag related functions from GHCApi to another module 2014-07-12 02:57:19 +02:00
Daniel Gröber
81c58585a2 Add functions for dealing with packages, modules and bindings to GHCApi 2014-07-11 10:43:51 +02:00
Daniel Gröber
73bf4cbc4e Remove withGhc and withGhc', they're not used anymore. 2014-07-11 10:41:43 +02:00
Alejandro Cabrera
daada0d27e Fix GHC 7.8.3: MatchGroup now has 4 args
Rather than use a pattern match, this patch opts to explicitly extract
the fields of interest using where syntax. This keeps compatibility
across GHC 7.8 releases.

Ref: eeaea2df3f (diff-259092edcc59456f526cdef255c181d1L909)
2014-07-11 01:15:22 -04:00
Daniel Gröber
9f94bc863c Add Module type 2014-07-11 05:44:31 +02:00
Daniel Gröber
d818a64f6f whitespace 2014-07-11 04:51:27 +02:00
Daniel Gröber
320b2243a2 Make GhcMod a special case of GhcModT
i.e. turn GhcMod into a monad transformer
2014-07-11 04:51:11 +02:00
Daniel Gröber
56ad1a3c8c Control.Monad.Trans.MonadIO -> CoreMonad.MonadIO
they are different before ghc 7.8
2014-07-11 04:12:05 +02:00
Daniel Gröber
4b6a687bc1 Migrate the remaining parts of the exposed API to GhcMod a 2014-07-11 03:13:38 +02:00
Daniel Gröber
dc5ba6d00d Add newGhcModEnv for allowing multiple active sessions
Conflicts:
	Language/Haskell/GhcMod/Monad.hs
2014-07-10 21:14:47 +02:00
Alejandro Serrano
72679c619c Show more relevant bindings in typed holes 2014-07-06 09:45:02 +02:00
Daniel Gröber
86a7f954e3 Add a comment discouraging the use of toGhcMod in new code 2014-07-04 19:03:02 +02:00
Kazu Yamamoto
609ca52dee Merge branch 'serras-master' 2014-07-03 17:04:00 +09:00
Kazu Yamamoto
f2e20e3279 comments. 2014-07-03 14:26:39 +09:00
Kazu Yamamoto
640140608e layout. 2014-07-03 14:22:43 +09:00
Kazu Yamamoto
826d42f824 clean up macros. 2014-07-03 14:19:36 +09:00
Kazu Yamamoto
c13fdde2f8 importing Control.Monad.IO.Class explicity.
trying to resolve #277.
2014-07-03 12:50:46 +09:00
Alejandro Serrano
df258843d9 Fix missing OccName import for ghc 7.4 2014-07-02 17:18:03 +02:00
Alejandro Serrano
ccc21461b2 Fix missing import for ghc 7.4 2014-07-02 17:00:10 +02:00
Alejandro Serrano
c707eb4e8c Revert back change in MonadIO GhcMod 2014-07-01 17:56:59 +02:00
Alejandro Serrano
063ca80946 Fix compilation errors on ghc < 7.8 2014-07-01 17:43:13 +02:00
Alejandro Serrano
11acd93bf6 Try to fix for ghc < 7.8 2014-06-29 10:28:28 +02:00
Alejandro Serrano
c06ee75fbb Fix building errors on ghc < 7.8 and tests 2014-06-28 23:18:49 +02:00
Alejandro Serrano
1b66f65b48 Move lots of stuff to GhcMod
- Generalize many signatures to GhcMonad m
2014-06-28 21:43:51 +02:00
Alejandro Serrano
871f72fca4 Remove code with extensions not present < ghc 7.8 2014-06-27 19:32:05 +02:00
Alejandro Serrano
edfe0c8ef3 Cleaning of case splitting code 2014-06-27 19:06:20 +02:00
Alejandro Serrano
2ab6991d95 Move code to new FillSig module
- Clean up a lot of code
2014-06-27 18:38:15 +02:00
Alejandro Serrano
3ef1979f67 Case splitting works in Emacs! 2014-06-26 21:17:22 +02:00
Alejandro Serrano
40cd5b7deb Haskell part of case splitting working! 2014-06-25 18:09:24 +02:00
Alejandro Serrano
5fa536714f Initial code generation working
- Added fallback with haskell-src-exts
2014-06-22 18:03:34 +02:00
Alejandro Serrano
90abb89a98 Inserting instance initial body now works :) 2014-06-22 11:10:23 +02:00
Alejandro Serrano
a45fb4c6f5 Move case split and sig. generation to own files
- Created SrcUtils module for shared functionality
2014-06-21 11:38:44 +02:00
Alejandro Serrano
8c56d2e3c8 Obtain better information for case split 2014-06-18 21:01:22 +02:00
Alejandro Serrano
5a968225c3 Initial skeleton for case split in elisp 2014-06-17 18:15:36 +02:00
Alejandro Serrano
8a63ae078b Add missing cases for signatures 2014-06-16 22:10:01 +02:00
Alejandro Serrano
585c28f928 Initial implementation of instance completion 2014-06-11 22:01:43 +02:00
Alejandro Serrano
323c1b5471 Initial support for adding body from signature 2014-06-10 21:34:05 +02:00
Alejandro Serrano
cedf59ace7 Merge branch 'fix-typed-holes' 2014-06-10 17:09:46 +02:00
Alejandro Serrano
2f42d77b53 Add special cases for case splitting 2014-06-09 13:01:47 +02:00
Alejandro Serrano
c9b901f4f9 Fix problems with GHC's Typed Holes 2014-06-09 10:30:33 +02:00
Alejandro Serrano
0c445aa30f Work on case split variable naming 2014-06-08 14:23:06 +02:00
Alejandro Serrano
6854d417c0 Initial implementation of case splitting
- It doesn't handle vars correctly yet
2014-06-08 12:33:13 +02:00
Daniel Gröber
241c7946fc Revert "Fix tests for Cabal <= 1.16"
The problem the reverted commit tried to fix seems to have been just a
symptom of another root cause that was later fixed as the problem does
not seem to occur anymore even without this changeset also this
changeset broke cabal sandboxes with ghc < 7.8.

Fix #262

This reverts commit 8741323f5b.

Conflicts:
	Language/Haskell/GhcMod/GhcPkg.hs
2014-05-19 01:27:35 +02:00
Kazu Yamamoto
fcc3b46415 defining C macro if not defined. 2014-05-16 09:27:23 +09:00
Daniel Gröber
814ea60552 Types doesn't export convert anymore 2014-05-14 20:55:54 +02:00
Daniel Gröber
8324dd96ae Don't expose Convert 2014-05-14 18:54:56 +02:00
Daniel Gröber
80e2761f2f Ghc->GhcMod: finish Browse, Check 2014-05-14 18:05:40 +02:00
Daniel Gröber
ebfb740a2e Move convert to it's own module. 2014-05-14 17:06:30 +02:00
Daniel Gröber
f1535efcf2 Ghc -> GhcMod: Browse, Check 2014-05-14 17:06:29 +02:00
Daniel Gröber
e5c6d3e472 Start migrating Ghc -> GhcMod monad 2014-05-14 17:06:29 +02:00
Kohei Suzuki
ef375668d1 Suppress empty line 2014-05-11 00:30:02 +09:00
Daniel Gröber
96a85fe953 Copy readMaybe/readEither from base >= 4.7 for backwards compatibility 2014-05-10 13:43:46 +02:00
Daniel Gröber
5492f0c5d1 Add license headers for code copied from Cabal 2014-05-10 13:43:27 +02:00
Daniel Gröber
f949e4be7a Copy ComponentLocalBuildInfo from Cabal-1.18
This way `configDependencies` works even when the Cabal version used by
cabal-install is later than the one used by ghc-mod.
2014-05-10 02:04:09 +02:00
Daniel Gröber
13930a9d7d Fix Cabal >= 1.18 2014-05-09 21:12:52 +02:00
Daniel Gröber
175635505d Fix warnings 2014-05-09 20:44:33 +02:00
Daniel Gröber
8741323f5b Fix tests for Cabal <= 1.16 2014-05-09 20:37:15 +02:00
Daniel Gröber
d1da6ab289 Make getSystemLibDir use GHC.Paths instead of running ghc 2014-05-09 20:36:20 +02:00
Daniel Gröber
b8f9498f83 Fix reading of older Cabal setup-configs 2014-05-09 20:35:13 +02:00
Kazu Yamamoto
2e3b172b0e enabling -fno-warn- (#246). 2014-05-09 23:45:34 +09:00
Daniel Gröber
fae4730ba5 Import HscTypes (HscEnv) with ghc <= 7.2 2014-05-08 13:14:44 +02:00
Daniel Gröber
a7b2c86985 Fall back to Cabal 1.16 format on runtime if extracting fails 2014-05-08 12:59:52 +02:00
Daniel Gröber
4c93819da8 Fix ghc-7.8 2014-05-08 11:50:51 +02:00
Daniel Gröber
7b8540add1 Add support for getting pkgDeps with Cabal <= 1.16 2014-05-08 11:32:40 +02:00
Kazu Yamamoto
b7d92417bc HasDynFlags is provided after 7.6. 2014-05-08 17:01:01 +09:00
Kazu Yamamoto
cc3e728f03 fixing comment. 2014-05-08 16:51:15 +09:00
Daniel Gröber
61207c13d3 Add MonadIO instance for RWST 2014-05-08 08:36:18 +02:00
Kazu Yamamoto
8561e7b656 To break cyclic import, this patch makes GhcPkg.hs independent from Monad.hs(refactoring for #244)
This removes `ghcPkgList`, `ghcPkgListEx` and `ghcPkgDbOpt`. I'm not sure
this is a right way to do.
2014-05-08 12:42:45 +09:00
Kazu Yamamoto
f199ea9e2e removing warnings. 2014-05-08 10:49:40 +09:00
Daniel Gröber
5044cf7f56 Fix warnings 2014-05-05 09:43:14 +02:00
Daniel Gröber
635830b527 Fix #242, ghcPkgList(Ex) on NixOS 2014-05-05 00:29:10 +02:00
Daniel Gröber
ea427d60ba note: MonadIO class 2014-05-04 04:57:38 +02:00
Daniel Gröber
c50b4f5a38 ghc-mod deserves it's own monad
Having to call `findCradle` and `initializeFlagsWithCradle` everywhere
we interact with ghc-mod's API doesn't seem very Haskell-like to me I
think we should provide a Monad that has a run function that already
does all those tedious tasks for us.

The `GhcMod` monad is basically a wrapper around `RWST r w s IO` with an
instance for `GhcMonad`

Having a `Reader` allows us to pass `Options` to runGhcMod and not have
to worry about passing it everywhere, `Cradle` is also stored in the
reader environment on initialization.

Writer and State are just there for future use.

I've included a `toGhcMod` function that turns a `Ghc a` into a `GhcMod
a` this will make it easy to transition everyting to using the `GhcMod`
monad instead of `Ghc` without breaking the build or test suite for
extended periods of time.

Conflicts:
	ghc-mod.cabal
2014-05-04 04:57:38 +02:00
Daniel Gröber
096a56e660 Hide catch from Prelude 2014-05-04 04:57:38 +02:00
Daniel Gröber
4e4d27e62d Use componentsConfigs instead of configDependencies
`configDependencies` was added in Cabal-1.20 but we're using 1.18 on travis.
2014-05-04 04:57:38 +02:00
Daniel Gröber
9d9f66e942 Remove Maybe from cabalConfigDependencies and fromInstalledPackageId 2014-05-04 04:57:38 +02:00
Daniel Gröber
0c859294a3 Parse cabal setup-config to get depencencies 2014-05-03 15:36:10 +02:00
Daniel Gröber
19b56738c6 Add withDirectory_ to Utils 2014-05-03 15:36:10 +02:00
Daniel Gröber
aec46dbd51 Factor out readProcess' 2014-05-03 15:36:10 +02:00
Daniel Gröber
77605c6daf Add fromInstalledPackageId 2014-05-03 15:36:10 +02:00
Kazu Yamamoto
14f5768c90 doc. 2014-04-30 10:51:34 +09:00
Kazu Yamamoto
186485577d bootInfo as API. 2014-04-30 10:49:25 +09:00
Kazu Yamamoto
d007fa817a better names. 2014-04-28 21:59:54 +09:00
Kazu Yamamoto
a1aa44bdbb doc. 2014-04-28 21:51:39 +09:00
Kazu Yamamoto
913fb72911 ErrMsg -> Logger. 2014-04-28 21:47:08 +09:00
Kazu Yamamoto
0155cf5e5f style. 2014-04-28 21:43:24 +09:00
Kazu Yamamoto
d68690bab0 removing LogReader. 2014-04-28 21:41:29 +09:00
Kazu Yamamoto
411a584bb8 using check finally. 2014-04-28 16:31:28 +09:00
Kazu Yamamoto
9bc25046e3 rescue old GHCs. 2014-04-28 14:36:55 +09:00
Kazu Yamamoto
ae75872638 fixing regression. 2014-04-28 14:36:46 +09:00
Kazu Yamamoto
662842a085 clean up Gap. 2014-04-28 14:13:25 +09:00
Kazu Yamamoto
adb4addd54 707 -> 708. 2014-04-28 14:04:18 +09:00
Kazu Yamamoto
fc570551a2 withLogger handles errors. 2014-04-28 13:52:28 +09:00
Kazu Yamamoto
000076223f removing the third argument from initializeFlagsWithCradle. 2014-04-28 13:00:25 +09:00
Kazu Yamamoto
117d01a52a removing -Wall and -w:. 2014-04-28 12:52:09 +09:00
Kazu Yamamoto
f413cda0fe one more try. 2014-04-28 11:26:06 +09:00
Kazu Yamamoto
6a7955679a rescue old GHCs. 2014-04-28 09:28:57 +09:00
Kazu Yamamoto
2733f94a52 rescue old GHCs. 2014-04-28 09:00:03 +09:00
Kazu Yamamoto
017d4cc22f don't use InteractiveImport for old GHCs.. 2014-04-27 22:48:24 +09:00
Kazu Yamamoto
dede115731 defining withContext. 2014-04-27 21:26:03 +09:00
Kazu Yamamoto
64365807f9 refactoring. 2014-04-26 23:03:50 +09:00
Kazu Yamamoto
98d3c7028c refactoring. 2014-04-26 22:51:29 +09:00
Kazu Yamamoto
9c7c6a5cf9 refactoring. 2014-04-26 21:59:06 +09:00
Kazu Yamamoto
6b63cb7098 doc. 2014-04-26 20:24:47 +09:00
Kazu Yamamoto
c45415a367 cleaning up check, splice flag and logger. 2014-04-26 17:54:15 +09:00
Kazu Yamamoto
74cde29ae0 refactoring setTargetFiles. 2014-04-26 14:38:49 +09:00
Kazu Yamamoto
c1c0993b4a import DynFlag only in Gap. 2014-04-26 13:21:22 +09:00
Kazu Yamamoto
c8fbdcfa2f Thanks to DeferTypeErrors, info/type can work even if the file contains errors. 2014-04-26 11:43:30 +09:00
Kazu Yamamoto
66a5123f8c rescue old Cabal which does not support bench. 2014-04-26 09:22:42 +09:00
Daniel Gröber
8ac39a3378 Add benchmarks to cabalAllBuildInfo 2014-04-25 20:48:20 +02:00
Kazu Yamamoto
f50e5229c4 NG contains an error. 2014-04-25 11:08:29 +09:00
Kazu Yamamoto
13c5c2c5af doc. 2014-04-24 22:11:06 +09:00
Kazu Yamamoto
6cca65b11e ghc-mod find (#203). 2014-04-24 21:08:45 +09:00
Kazu Yamamoto
390c509144 find functions went to lib. 2014-04-24 17:02:50 +09:00
Kazu Yamamoto
4074c3d751 error handling for modules. 2014-04-24 12:51:43 +09:00
Kazu Yamamoto
93dadfef44 error handling for browse. 2014-04-24 12:45:47 +09:00
Kazu Yamamoto
2d1133ea8e exporting necessary types. 2014-04-24 12:17:50 +09:00
Kazu Yamamoto
e49fef6765 setTargetFiles now loads files. 2014-04-24 12:15:59 +09:00
Kazu Yamamoto
0c1469e53c <package>:<module> style.
refactoring for #159.
2014-04-24 11:26:30 +09:00
Kazu Yamamoto
79946f9a3d removing withGHCDummyFile. 2014-04-23 16:37:24 +09:00
Kazu Yamamoto
3b3b767556 Merge branch 'dev-dynflags' of https://github.com/DanielG/ghc-mod into DanielG-dev-dynflags
Conflicts:
	Language/Haskell/GhcMod/GHCApi.hs
2014-04-23 12:20:18 +09:00
Kazu Yamamoto
44ece2dcb9 Merge branch 'master' of github.com:kazu-yamamoto/ghc-mod 2014-04-23 12:04:00 +09:00
Daniel Gröber
c9ca3a6d76 Clean up DynFlags initialization 2014-04-23 04:04:41 +02:00
Daniel Gröber
dc43d600dc Remove Alternative class constraint from withGhc 2014-04-23 03:43:53 +02:00
Kazu Yamamoto
b8a151421d removing fixme. 2014-04-22 12:34:35 +09:00
Kazu Yamamoto
b3fd99fa7d using Builder. 2014-04-22 11:28:27 +09:00
Kazu Yamamoto
4764ff1acb ghc-modi boot. 2014-04-21 16:30:31 +09:00
Kazu Yamamoto
152b218813 hlint hack. 2014-04-21 16:12:30 +09:00
Kazu Yamamoto
8983cf2d88 lineSeparator are only used in toList/toPlain. 2014-04-21 15:58:36 +09:00
Kazu Yamamoto
3d03cff06b refactoring for lineSeparator. 2014-04-21 14:58:25 +09:00
Kazu Yamamoto
b2c2d1a443 cleaning up APIs. 2014-04-21 14:04:58 +09:00
Kazu Yamamoto
1006cd4eec APIs in Ghc monad now go to GHCMod.Ghc. 2014-04-21 12:51:56 +09:00
Kazu Yamamoto
2f55a19d49 cleaning up APIs. 2014-04-21 12:46:14 +09:00
Kazu Yamamoto
df4dd97e48 ghc-mod debug does not need a file. 2014-04-21 11:31:15 +09:00
Kazu Yamamoto
12dac1f0a5 ghc-mod root does not need a file. 2014-04-21 11:22:39 +09:00
Kazu Yamamoto
756d17eaa2 -l for ghc-modi info. 2014-04-21 09:45:41 +09:00
Kazu Yamamoto
e09b406ee8 ToString String and doctest. 2014-04-21 09:45:00 +09:00
Kazu Yamamoto
3c8fea85fb dropWhileEnd moves to Utils. 2014-04-19 15:20:16 +09:00
Kazu Yamamoto
82b6519935 removing suppress stuff. 2014-04-19 15:17:36 +09:00
Kazu Yamamoto
841c721928 -l for lint. 2014-04-19 08:36:35 +09:00
Kazu Yamamoto
ab5e082e81 --quiet back (#226). 2014-04-19 08:26:30 +09:00
Daniel Gröber
8f3fb2a7d7 Only supress stderr on success 2014-04-18 13:22:31 +02:00
Kazu Yamamoto
4389dea800 -l for check. 2014-04-18 17:28:12 +09:00
Kazu Yamamoto
9a6c84410d close import. 2014-04-18 16:17:46 +09:00
Kazu Yamamoto
f2081466fc Using Hidden also. (#223) 2014-04-18 16:12:21 +09:00
Kazu Yamamoto
aecb9bc1e4 implementing suppressStdout/err. 2014-04-18 15:41:32 +09:00
Daniel Gröber
bd2db5e98e Dont use Applicative ReadP instance 2014-04-18 04:00:01 +02:00
Daniel Gröber
2381f6e1ab More refactoring of package handling
- 'GhcPkg' now parses 'ghc-pkg -v list' output directly to also get the
  package-id

- Remove unused field 'cradlePackages' in Cradle

- Remove 'getPackageDbPackages' and use 'ghcPkgListEx' instead
2014-04-18 03:59:46 +02:00
satoshi-murakumo
0eadfa91fd Fix windows tempfile handling
On Windows, `ghc-mod lint` fails with following message.

    ghc-mod: DeleteFile "<Ommit>\\Temp\\ghc-mod-hlint8464": permission denied <Ommit>

Perhaps, On Windows, GHC opens file exclusively.
So, we move `removeFile` to `finally`.
2014-04-16 22:41:53 +09:00
Kazu Yamamoto
abb9ecd8ac style. 2014-04-16 11:59:00 +09:00
Kazu Yamamoto
145c27a129 hlint hack. 2014-04-16 11:52:49 +09:00
Kazu Yamamoto
cd56e26b25 just style. 2014-04-16 11:50:31 +09:00
Kazu Yamamoto
697ad3722a removing warnings. 2014-04-16 11:32:36 +09:00
Kazu Yamamoto
2dc1eb645a Merge branch 'dev' of git://github.com/DanielG/ghc-mod into DanielG-dev 2014-04-16 11:24:39 +09:00
Daniel Gröber
bb438feb83 User ghc's cProjectVersionInt to get version information 2014-04-16 01:57:52 +02:00
Daniel Gröber
7d75787ae3 Only add available package to ghc options
Fixes #185
2014-04-15 05:18:42 +02:00
Daniel Gröber
30b8366526 Refactor the way packages databases are handled
- cradle now stores a list of active package databases instead of only
  the user store (if present).

- rename `cradlePackageDb` -> `cradlePkgDbStack` as that`s what the ghc
  documentaion calls this kind of thing

- `getPackageDbPackages` now returns names of all visible packages in
  the given directory. Also the implementation now uses `ghc-pkg`
  instead of manually looking at the package database
2014-04-15 05:15:50 +02:00
Kazu Yamamoto
8f5498c554 refactoring. 2014-04-11 14:59:31 +09:00
Kazu Yamamoto
a0d559de61 clarifying Ghc and IO. 2014-04-11 13:14:45 +09:00
Kazu Yamamoto
998a43ce24 removing depanal. 2014-04-11 12:56:06 +09:00
Kazu Yamamoto
196450af9f simplifying modSummary. 2014-04-11 12:41:39 +09:00
Kazu Yamamoto
3ed59464f0 just style. 2014-04-11 12:21:58 +09:00
Kazu Yamamoto
862e8c397c refactoring. 2014-04-11 12:19:42 +09:00
Kazu Yamamoto
dd8f9a5fcb refactoring. 2014-04-11 11:54:39 +09:00
Kazu Yamamoto
e9859980ab info/type does not require module name.
Fallback was removed. See #199.
2014-04-11 11:51:25 +09:00
Kazu Yamamoto
54bea65736 style change. 2014-04-11 11:15:59 +09:00
Kazu Yamamoto
ba4a1b9688 removing unnecessary code. 2014-04-11 11:13:24 +09:00