haskell / haskell/haskell-mode

Incorrect indentation with `let` in guards

Open
#1,668 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
1.4k
Forks
354
Avg merge
5d 10h
Merged PRs (30d)
2

Description

```
module Foo where

foo :: Int -> IO ()
foo x = case x of
x |
let y = x + 1,
y > 5 -> do
putStrLn "foo"
```

If you load this file in haskell-mode and then press TAB on the line containing `putStrLn`, it gets dedented all the way to the left, which is incorrect.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in haskell-mode by loading the provided Foo module and pressing TAB on the putStrLn line. Inspect the indentation handling for a case guard containing a let binding, and consider the issue done when that line remains nested under the guard and do block.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, haskell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.