Skip to content

Implement "Go to implementation" request for type/data families #4655

@dschrempf

Description

@dschrempf

Is your enhancement request related to a problem? Please describe.

"Go to implementation" already allows to jump from the use site of a class method to the implementation of the class method (if a specific instance is used).

It would be extremely useful, to also jump from the use site of a type or data family to the implementation of that type or data family (if a specific instance is used).

Using the classical example of a list-like data family:

-- Declare a list-like data family.
data family XList a                                          -- [1]
-- Declare a list-like instance for 'Char'.
data instance XList Char = XCons !Char !(XList Char) | XNil  -- [2]

A possible use site could be

toString :: XList Char -> String
toString = _

If the cursor position is on XList, we can jump to [1] using "Go to definition".

Describe the solution you'd like

However, many times, especially in more complex code bases, the definition of the data family XList, and the definition of instances are far apart, and we want to jump to the implementation [2] of the instance for Char. This would be done using "Go to implementation", but does not yet (?) work in these cases.

Describe alternatives you've considered

None.

Additional context

You tell me!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions