-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
[Feature request] Type sigs on class plugin #1157
Comments
For 1., I believe the current plugin already uses type information of instantiated class. |
For 2, you can take a look to the hlint plugin, there we are querying the actual extensions used by a module |
Alternative design would be to always show the signatures (they can be quite helpful) and if someone clicks on the hyperlink and InstanceSigs aren't enabled you insert it too. |
Which "hyperlink" are you referring to? (using vim, so I'm not too sure about what gets shown in vscode and the like..) Right now there's
Where could the signatures be? I can think of having a code lens on the method, like there currently is for top level declarations with no types, which you can trigger to add the type. |
As far as I can tell, the only information I have available regarding class methods is their names (and whether they have default definitions). I guess this needs to get fetched in a similar way to how the |
Their approach won't work here, since they're interested in getting bindings, not the type of an arbitrary identifier. Perhaps something like requesting a typecheck and/or a ghc session and looking in there might work.. |
@googleson78 We already request a typecheck and ghc session in the action part of the plugin, so I believe you can reuse those if you need them (and create type info in the action part instead of the command part). |
Hello @googleson78, do you still work on this? I'll pick this if you don't have more plan on it. |
Go ahead and pick it up, I'd completely forgotten it 😅 Sorry! |
My $0.02 on design would be:
|
Very handy 😉 codelens.mp4 |
Incidentally, I believe the current add-type-signatures lens doesn't do this, and it would be nice if it did. |
Sure, I'm working on this. |
Would it be possible to look at the current source file, and if
InstanceSigs
is enabled, also add type signatures to the methods that the "Add placeholders" action generates?I would add this too, but I don't know
The text was updated successfully, but these errors were encountered: