Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polymorphic record does not get inlay hint #4475

Open
guibou opened this issue Dec 30, 2024 · 2 comments
Open

Polymorphic record does not get inlay hint #4475

guibou opened this issue Dec 30, 2024 · 2 comments
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@guibou
Copy link
Collaborator

guibou commented Dec 30, 2024

Your environment

Which OS do you use? Linux
Which version of GHC do you use and how did you install it? GHC 9.10.1
How is your project built (alternative: link to the project)? standalone

Which LSP client (editor/plugin) do you use? Neovim+lspconfig
Which version of HLS do you use and how did you install it? I picked latest commit, so f09500b because I was excited to test.
Have you configured HLS in any way (especially: a hie.yaml file)? standalone files

Steps to reproduce

The following code:

data Foo = Foo { bar :: Int, baz :: Char }

foo = Foo 1 'a'

data FooM m = FooM { barM :: Int, bazM :: Char }

fooM = FooM 1 'a'

Expected behaviour

I would like inlay hint for the implicit fields of constructors Foo and FooM when defining foo and fooM.

More generally, it seems that inlay hints are not shown for record field when the record does have type parameters.

Actual behaviour

I only have inlay hint for Foo/foo but not for Foo/fooM:

image

I also tried to add type signature and monomorphise FooM:

image

Debug information

@guibou guibou added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. status: needs triage labels Dec 30, 2024
@guibou
Copy link
Collaborator Author

guibou commented Dec 30, 2024

The problem is also transitive with pattern

pattern Cheval {a} = Just a

titi = Cheval 10

pattern Cheval2 {b} = Foo b

toto = Cheval2 10

Here, pattern Cheval is polymorphic, but pattern Cheval2 is not, and indeed, we see the inlay hint for Cheval2 but not Cheval:

image

@fendor
Copy link
Collaborator

fendor commented Dec 30, 2024

Thanks for the bug report! Tagging @jetjinser, maybe they have an idea about what's up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

2 participants