-
Notifications
You must be signed in to change notification settings - Fork 39
Quick Start Guide
HaskForce currently requires at least IntelliJ IDEA 13.1.5. See the Dependencies section of the wiki for more info.
To install the plugin, download the latest zip archive from the releases page and install it from IntelliJ -
- Preferences > Plugins > Install plugin from disk.
Note that pre-releases are non-production builds. If you encounter any issues please report them in our issues tracker.
- Choose New Project, select the Haskell option, then click Next.
- Enter the project name and location.
- Set the Project SDK. This should be the path to your GHC installation. The IDE will attempt to guess your GHC directory. Once you are in that directory, click Choose.
- Click Finish.
Create a new project and set the project location to the root of your existing project.
HaskForce can integrate with tools such as HLint and Stylish-Haskell. These can be configured from Project Preferences > Haskell Tools. The Auto Find button will attempt to find this executable for you. These are configured on a per-project basis. You can set the defaults for all projects using File > Other Settings > Default Settings.
Currently you can jump to the declaration of any function which has an explicit type signature. Functions without type signatures, data/newtype declarations, etc. are not supported yet but should be soon.
HaskForce currently implements the following autocompletion features -
-
Reference completion - This completion is based on the references captured from the functions you have defined with explicit type signatures. This works mostly in conjunction with the Jump to Declaration section above.
-
GHC-Mod completion - This completion is more complex and gets you many more features. It does require you to set the paths to ghc-mod and optionally ghc-modi in your external tool settings. With GHC-Mod you get completion of -
- Language extensions in
LANGUAGE
pragmas. - GHC flags in
OPTIONS_GHC
pragmas. - Module names in imports.
- Language extensions in
-
GHC-Modi completion - Same as above, except you get -
- Name import completion -
import Data.ByteString (rea->readFile)
- Qualified name completion -
Data.ByteString.rea->readFile
- Prelude and imported name completion -
foo = getL->getLine
- Name import completion -
Note that retrieving completion information can be expensive so it is cached frequently. If you find that your completion cache needs to be updated, you can use Code > Haskell Completion Cache Reload. This is currently mapped to Ctrl+Shift+Space (Command+Shift+Space on OSX).
Error checking is supplied with ghc-mod or ghc-modi. Error reporting turnaround time can be nearly 4 times faster with ghc-modi, so in most cases that is probably the best route. Please note that the ghc-mod tools currently do not support multiple cabal components for a single project very well. Solutions to this are actively being developed. However, test suite components can be enabled simply by reconfiguring with tests enabled (this can be done via Preferences > Compiler > Haskell Compiler > Enable Tests and a rebuild or manually on the command line with cabal configure --enable-tests
).
In order to build your application you must be using a cabalized project. If so, you can use Build > Make Project.
To customize your build, navigate to Project Settings > Compiler > Haskell Compiler. From there you can set your preferences, such as disabling profiling, building in a sandbox, etc. You can set the defaults for all projects using File > Other Settings > Default Settings.
HaskForce currently supports two run types: applications and test-suites. You can find these via the Edit Configurations menu. These are implemented using cabal run
and cabal test
, respectively. Use the Program Arguments parameter to specify alternative run configurations from the cabal file or other command line arguments.