3

Is it possible to see mypy types in emacs? I would like a command that does something like show the type of what's under point (presumably getting that information from the mypy cache for speed?). Or alternatively, I might be happy with a UI like lsp-mode's (perhaps using lsp-mode itself) that shows the type immediately when point is over something, without needing to run a command.

Would be interested to know also if there is an easy way to set things up in spacemacs, but this question is primarily about the generic emacs issue.

Croad Langshan
  • 3,332
  • 18
  • 44
  • I recall the main thing preventing this some months back is lack of support for this from mypy itself (but, again from memory, I think they do want to provide support for it eventually). Types in e.g. VS code I believe come from proprietary Microsoft code whose source either isn't published or is published under a non-free license. Perhaps the necessary information is there in the mypy cache for a sufficiently determined implementor though? :-) – Croad Langshan Mar 02 '22 at 17:04
  • Support seems to be there in mypy now (in the form of experimental support from mypy 0.981 on, in dmypy in particular) https://mypy.readthedocs.io/en/latest/mypy_daemon.html#statically-inspect-expressions I'm still surprised by how few requests this feature this seems to get from emacs users. Does that mean that emacs support exists for this dmypy feature now, somewhere I haven't noticed it? Perhaps in https://github.com/python-lsp/pylsp-mypy ? – Croad Langshan Mar 16 '23 at 19:38

0 Answers0