Skip to content

Show type of a variable #367

@talwrii

Description

@talwrii

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)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions