haskell / haskell/haskell-language-server

`Use type signature` action inserts invalid syntax for long signatures

Open
#4,922 2 comments 1 reaction 0 assignees View on GitHub
component: hls-refactor-plugin type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

### Your environment

Which OS do you use?
fedora
Which version of GHC do you use and how did you install it?
9.10.3
How is your project built (alternative: link to the project)?
In this repo

Which LSP client (editor/plugin) do you use?
helix
Which version of HLS do you use and how did you install it?
HLS HEAD
Have you configured HLS in any way (especially: a `hie.yaml` file)?
no

### Steps to reproduce

Encountered while dev'ing locally. I create holes for signatures when refactoring and then have HLS insert the type signature for me. This seems to create invalid syntax sometimes when the signature is too long.

Note that there's two errors. One is syntax and one is printing. The type signature that's inserted isn't indented, and `Text` is a locally qualified symbol in the file and should be `T.Text`.

Image

### Expected behaviour

```haskell
withWorkerQueue
:: Recorder (WithPriority LogWorkerThread)
-> T.Text
-> (a -> IO ())
-> ContT () IO (TaskQueue a)
withWorkerQueue = withWorkerTasks workerTaskQueue
```

Or something akin to the above.

### Actual behaviour

Image

### Debug information

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.