nickel icon indicating copy to clipboard operation
nickel copied to clipboard

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

Open thufschmitt opened this issue 1 year ago • 1 comments

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

  • OS name + version:
  • Version of the code: f5b5876

Additional context

thufschmitt avatar Jun 20 '24 08:06 thufschmitt

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.

jneem avatar Jul 02 '24 22:07 jneem