Skip to content

Typeclass constraint insert suggestions should not be fully-qualified as the syntax is not valid. #4810

@theophile-scrive

Description

@theophile-scrive

Hi! When suggesting the addition of a missing typeclass constraint in a function signature, which has not yet been brought into scope, HLS will suggest its fully-qualified name (Module.Module.Class m), which is not valid syntax in the absence of a corresponding import line, which 1) is not handled automatically by HLS, and 2) not desired, as fully-qualified constraints are noisy and hamper legibility.

I would suggest to trim the name of the constraint, and let the import plugin sort out its provenance, or better, leave the user decide how it should be qualified. But inserting a fully-qualified name which then has to be edited is not a smooth experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: 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