As of May, 25th 2022, this project is officially unmaintained. If you would like to take over, drop a message to @lierdakil.
If you're looking for a decent editor support for Haskell, consider using VSCode with Haskell extensions.
This package provides Haskell Language Server powered IDE features like autocompletion, type/info tooltips, etc.
This package depends on the Haskell Language Server binary being available on PATH. More specifically, it runs haskell-language-server-wrapper
by default.
By far the easiest way to get HLS is to use ghcup via ghcup install hls
. However, ghcup isn’t available on Windows (except through WSL). Refer to HLS documentation for more detailed installation instructions.
IDE-Haskell-HLS depends on some Atom packages. If those packages are not installed, a prompt should be shown asking if you’d like to install them. The dependencies are also listed here for documentation purposes and can be installed manually:
language-haskell
: a single dependency that can’t be installed automatically. Haskell Language definitions.ide-haskell
: provides most UI elementsatom-ide-markdown-service
: will be used to render documentation tooltipside-haskell-hoogle
: will be used to open documentation links from tooltips directly in Atom.atom-ide-definitions
: provides “go to definition” functionalityatom-ide-outline
: provides outline functionalityPath to the binary can be configured via ide-haskell-hls.binaryPath
option. It is recommended you do not touch this option however and instead add the directory containing your HLS binaries to system PATH.
IDE-Haskell-HLS provides the following utility commands:
ide-haskell-hls:restart-all-severs
will attempt to restart all HLS processes managed by Atom.ide-haskell-hls:clear-messages
will clear out the error message cache on the Atom side. This is useful if you’ve, say, removed or renamed a file, and HLS didn’t clear the messages for that file automatically.Due to some idiosyncrasies of how language server protocol is implemented in Atom, HLS will pick up the project correctly only when the project root is open as a project directory in Atom, i.e. not as a subdirectory.
The project root can be either:
cabal.project
file,*.cabal
file.For the common case of a single “root” directory directly containing multiple directories with loosely-related projects, as, for instance, for course exercises, a cabal.project
file with the following contents:
packages: */*.cabal
should suffice. That is to say, with this cabal.project
, the directory tree should look something like this:
.
├── cabal.project
├── project01
│ ├── project01.cabal
│ └── ...
├── project02
│ ├── project02.cabal
│ └── ...
├── ...
└── projectN
├── projectN.cabal
└── ...