haskell / haskell/haskell-language-server

Wrong alignment while adding placeholder for class instances

Open
#2,998 2 comments 0 reactions 0 assignees Claimed by @Aster89 View on GitHub
component: hls-class-plugin Hackathon type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

### Steps to reproduce

With the following code
```haskell
data A
instance Eq A where
```
Execute code action to add placeholder for `==` with signature

### Expected behaviour

```haskell
instance Eq A where
(==) :: A -> A -> Bool
(==) = _
```

### Actual behaviour

```haskell
instance Eq A where (==) :: A -> A -> Bool
(==) = _
```

---

It **only** happens while the instance definition is at the last line and there is no extra line later. It doesn't matter before we have `add instance signature code action` but will result in errors after #2920.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.