intellij-haskell
intellij-haskell copied to clipboard
Indent after do/where/if/then/else/of
trafficstars
We need appropriate indentations when starting a newline after a do/where/if/then/else/of keywords.
You can partially solve this by writing properly indented live templates for Haskell (just select other for the applicable languages), e.g.:
mod
module $MODULE_NAME$ where
do
do
return $RETURN_VALUE$
if
if $CONDITION$
then $EXPRESSION1$
else $EXPRESSION2$
case
case $STATEMENT$ of
$CONDITION$ -> $EXPRESSION1$
otherwise -> $EXPRESSION2$
fun
$FUNCTION$ :: $TYPE_SPECIFICATION$
$FUNCTION$ $ARGUMENTS$ = $IMPLEMENTATION$
where
where
$EXPRESSIONS$
let
let $EXPRESSION$
in
$STATEMENTS$
etc...
@erikhuizinga Thanks for your hints!
Btw, when you create a module, it already contains the module declaration.
When I have more time, I will take a look for a proper solution.