intellij-haskell icon indicating copy to clipboard operation
intellij-haskell copied to clipboard

Indent after do/where/if/then/else/of

Open swr1bm86 opened this issue 8 years ago • 2 comments
trafficstars

We need appropriate indentations when starting a newline after a do/where/if/then/else/of keywords.

swr1bm86 avatar Feb 24 '17 18:02 swr1bm86

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 avatar Oct 09 '17 10:10 erikhuizinga

@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.

rikvdkleij avatar Oct 09 '17 11:10 rikvdkleij