tweag / nickel

Better configuration for less
https://nickel-lang.org/
MIT License
2.23k stars 85 forks source link

Hovering on a record field defined several times will only show the information for the first definition #1971

Open thufschmitt opened 1 week ago

thufschmitt commented 1 week ago

Describe the bug

In the LSP, hovering over a record field will show some information on that field if there's any:

image

However, if the field is defined more than once, only the first one will get a useful information on hover:

image

image

To Reproduce

On the following file:

{ foo, foo } | { foo | doc "The field Foo" }

Hover on the second foo

Expected behavior

Both instances of the field should display the full information on hover

Environment

Additional context

jneem commented 1 day ago

I looked into this a little. The issue is that when converting from UniRecord to RichTerm the duplicate fields are merged. So by the time nls gets its hands on the AST, it only sees one of the foos as a field definition. I think to solve this, nls would need to get its hands on the UniTerm AST.