Skip to content

Enhancement: parenthesise compound completion snippets #1700

Closed
@konn

Description

@konn

Currently, HLS's completion snippet inserts types or kinds as-is.
For example,

foldl

gets completed to:

foldl b -> a -> b b t a

where b -> a -> b, b and t a are three separate snippet placeholders.
This makes it harder to detect boundaries of generated "placeholders" after a snippet is completed tentatively.
It might be good to parenthesise each placeholder when it is compound.
For example, the above must be at least:

foldl (b -> a -> b) b (t a)

or:

foldl (_ :: b -> a -> b) (_ :: b) (_ :: t a)

Hole-based approach works better as it generates well-formed programs; however, holes can make GHC significantly slower, it might be good to parenthesise plain placeholders (with types or kinds alone) could be enough.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions