FsAutoComplete icon indicating copy to clipboard operation
FsAutoComplete copied to clipboard

missing parentheses in function type definition

Open TheAngryByrd opened this issue 1 year ago • 1 comments

Discussed in https://github.com/ionide/FsAutoComplete/discussions/1337

Originally posted by joprice January 8, 2025 I'm asking this here as I'm not sure where to open an issue and the issue templates are quite hefty. Other issues I've opened were premature and maybe a distraction to contributors, since they may have been issues in the underlying fsharp compiler libraries powering fsautocomplete. (It's also tricky to search for an existing issue across many repos, as this may be fixed already on head).

I've found that the type hint shown for certain types where a type is parameterized by a tuple and a function are not correctly printed with the correct precedence. For example, In the screenshot below, it shows a tupled function to 'c instead of a tuple of a value and a function from unit to `c.

This affects the Add explicit type annotation code action, which is where I usually notice it, since the provided type causes a compilation error in otherwise working unannotated code.

Screenshot 2025-01-08 at 7 28 13 PM

(In passing, another issue with the Add explicit type annotation I noticed is that it doesn't add the requires bounds, so the type ends up being just `c in this specific case when it's used on an untyped token, which is valid, but perhaps surprising given that the tooling shows a more specific type.)

TheAngryByrd avatar Jan 11 '25 16:01 TheAngryByrd

Have to investigate where the problem is coming from. Probably best to start TextDocumentHover endpoint and see where it leads.

TheAngryByrd avatar Jan 11 '25 16:01 TheAngryByrd