-
Notifications
You must be signed in to change notification settings - Fork 57
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
Pipe completion unknown/type parameter return types #662
Conversation
…pe does not work, not even after compilation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a reasonable compromise.
I think the full solution would involve changing the case of application, which would have to find a way to instantiate function type parameters. That would need to get one's hands dirty with unification though, which is much more complex.
…pe does not work, not even after compilation
…cript-lang/rescript-vscode into pipe-completion-unknown-return-types
@cristianoc ready for another look through, I think I fixed all of your points. |
@@ -4,13 +4,6 @@ | |||
|
|||
<p align="center">The Official VSCode plugin for ReScript</p> | |||
|
|||
<p align="center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about these changes?
This fixes pipe completion for functions returning a type not known until the code has compiled.
Array.reduce
being an example, which has the signature('a, ('a, 'b) => 'a) => 'a
. It returns'a
but we don't know what'a
is unless it has compiled.This makes it so that this now completes as
int
(after saving):Again, note this only has effect after saving (compiling so that the type parameter is instantiated). But it at least enables pipe completion in this scenario, even if it requires saving, which used to not work at all.