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

Show type of a variable #367

Open
talwrii opened this issue Nov 7, 2022 · 0 comments
Open

Show type of a variable #367

talwrii opened this issue Nov 7, 2022 · 0 comments

Comments

@talwrii
Copy link

talwrii commented Nov 7, 2022

Vscode has a feature where it will show the types of a variable on hover which can be useful if you are inferring types (or using a dynamic language which allows for inferring type).

This feature is supported by other jedi backends. See coc-jedi. It might be nice to support this in emacs-jedi. I'm not sure how you would implement the hover functions - and I tend to neither use the mouse nor like tooltips showing up unless I asked for them.

I hacked up the following function to show the types of attributes and variables. I don't know if something like this wants to be added to jedi.

(defun my-jedi-show-type ()
  "Show the documentation of the object at point."
  (interactive)
  (deferred:nextc (jedi:call-deferred 'get_definition)
    (lambda (reply)
      (popup-tip (plist-get (car (my-jedi:call-sync 'get_definition)) :full_name)))))
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

No branches or pull requests

1 participant