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

missing parentheses in function type definition #1340

Open
TheAngryByrd opened this issue Jan 11, 2025 · 1 comment
Open

missing parentheses in function type definition #1340

TheAngryByrd opened this issue Jan 11, 2025 · 1 comment
Labels

Comments

@TheAngryByrd
Copy link
Member

Discussed in #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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant