dfinity / vscode-motoko

Motoko language support for VS Code.
Apache License 2.0
42 stars 15 forks source link

Feature Request: Data type on variable hover #287

Closed Gekctek closed 2 weeks ago

Gekctek commented 2 weeks ago

One feature that I have needed for a while is being able to see type/function information on hover in vscode. Im not sure how to get the type of a variable without inferring or declaring a type for it and see if there is an error or its ok Also a common issue I have is seeing method signature. If I break it it gives me an error message which I can figure it out or I just change the function name to something invalid, then look at the available functions in the module in the error message there

Would be nice to just quickly see basic information on variables/functions without having to look at error messages or F12 into the module

rvanasa commented 2 weeks ago

This should be available (along with doc comments for functions, modules, etc.) for all recent versions of the extension:

image image

Does anything look unusual in the "Motoko Language Server" output logs?

image
Gekctek commented 2 weeks ago

You're right. I guess the issue is when there is ANY error in the file, which is the time when i care about what the type/signature is I think this is a general issue with things not working/parsing correctly with errors, but I doubt its trivial issue

rvanasa commented 2 weeks ago

I see what you're saying; yes, this is a known limitation. I'll keep this in mind in case there's a way to improve this as part of the next batch of changes to the VS Code extension.