Skip to content

Use type signature action inserts invalid syntax for long signatures #4922

@crtschin

Description

@crtschin

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-refactor-pluginIssues related to the hls-refactor-plugintype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions