|Julian Ospald 54ac5e6594 Raise minimum cabal-helper version||8 months ago|
|3rdparty||8 months ago|
|GhcMod/Exe||1 year ago|
|bench||1 year ago|
|core||8 months ago|
|doc||3 years ago|
|elisp||1 year ago|
|scripts||10 months ago|
|shelltest||1 year ago|
|src||1 year ago|
|test||1 year ago|
|test-elisp||4 years ago|
|.ghci||7 years ago|
|.gitignore||2 years ago|
|.gitlab-ci.yml||1 year ago|
|.gitmodules||8 months ago|
|.travis.yml||2 years ago|
|COPYING.AGPL3||4 years ago|
|COPYING.BSD3||4 years ago|
|ChangeLog||1 year ago|
|CodingStyle||4 years ago|
|GhcMod.hs||1 year ago|
|LICENSE||4 years ago|
|README.md||1 year ago|
|Setup.hs||1 year ago|
|cabal.project||1 year ago|
|ghc-mod.cabal||8 months ago|
|ghcmodHappyHaskellProgram-Dg.tex||3 years ago|
ghc-mod provides editors/IDEs with support for Haskell compiler features. It supports both Cabal and Stack based projects and integrations exist for Emacs, Vim, Atom, IntelliJ and VSCode.
ghc-mod in your development environment of choice you need two things:
ghc-modprogram included in the package of the same name, see Installing
We provide two modes of operation for frontends: interactive and single shot
mode. The former is accessed by calling
$ ghc-mod legacy-interactive. This will
sit and wait for you to type a command, exiting when an empty line is
entered. Interactive mode is pretty much always faster than single shot mode,
since it gives ghc-mod the ability to cache the compiler session between
commands. On the other hand, it needs more memory because it keeps these things
Single shot mode is pretty much only there for (backwards) compatibility with
Vim, since it only recently got the ability to talk to background processes
without installing some external plugin. You can use single shot mode by simply
calling the sub-commands of the
ghc-mod program. Since recompiling large
projects can be really, really slow, you really should prefer interactive mode.
As a rule of thumb, all commands available in single shot mode are available in
interactive mode. A list of the former can be obtained by running
$ ghc-mod --help.
If you’re developing a new ghc-mod frontend, we’d love to hear from you! Please open an issue or e-mail the maintainer. Also, we invite you to add installation and configuration instructions to Frontend.
Internally, ghc-mod uses the Glasgow Haskell Compiler’s API to implement most of its functionality.
In order to provide a hassle-free experience to users, ghc-mod tries hard to automatically, and correctly, detect and, if necessary, tweak the environment GHC needs. It also handles some of the more cumbersome parts of getting a working compiler session up and running.
This functionality can be very useful to all kinds of Haskell development tools. Therefore, we want to expose all the useful abstractions ghc-mod provides.
Right now the ghc-mod API is pretty messy; a result of major internal rewrite and reorganization coupled with too little time for cleanups over the course of almost 100 releases! We would like to make a cut during v6.0 or so and completely redo the API, but we need more input from downstream tool writers to do that properly, see Library API Redesign.
For example, The Haskell Refactorer (HaRe) uses the build environment abstraction ghc-mod provides so it can concentrate on its core functionality instead of worrying about build environments and compiler session setup.
has sprung up, and if you’re planning to write any kind of tool that needs editor
integration eventually you should definitely look into that.
ghc-mod at its core, so you’ll want to be familliar with it either way.
API “documentation” is here: Hackage docs.
Please report bugs on the GitHub issue tracker for ghc-mod: https://github.com/DanielG/ghc-mod/issues
Including general environment information like the operating system
(distribution, version) you’re using and the output of
$ ghc-mod debug run in
your project directory is probably a good idea.
If you have any problems, suggestions, comments swing by #ghc-mod (web client) on Freenode. If you’re reporting a bug please also create an issue here (GitHub issue tracker) so we have a way to contact you if you don’t have time to stay.
Do hang around for a while if no one answers, and repeat your question if you still haven’t gotten any answer after a day or so (the maintainer was probably asleep). You’re most likely to get an answer during the day in GMT+1.