Skip to content

Conversation

@patrys
Copy link
Contributor

@patrys patrys commented Jan 19, 2017

I'm playing with the idea of providing type annotations on hover instead of duplicating autocomplete results. This is quite useful especially when combined with PEP 484 annotations or comments with type hints.

@patrys patrys changed the title [WIP] Show symbol type on hover Show symbol type on hover Jan 20, 2017
@patrys
Copy link
Contributor Author

patrys commented Jan 20, 2017

I think this is ready for review now. The behaviour is as follows:

  • for classes and functions hover displays the docstring (if available) and the signature
  • for modules hover displays the docstring (if available) and the full name
  • for the rest (mostly variables) hover shows possible (can be multiple) types inferred by jedi

I've reversed the description and signature to match what other language providers do.

@gandhis1
Copy link
Contributor

Any screenshots?

@patrys
Copy link
Contributor Author

patrys commented Jan 20, 2017

Variable:
image

Function:
image

@gandhis1
Copy link
Contributor

Looks great. Anything you can do to handle very long doc strings, like limiting the hover box height and adding a scroll bar, or is that limited by VS Code?

@patrys
Copy link
Contributor Author

patrys commented Jan 20, 2017

This is already handled by VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants