I'd like to be able to hover cursor/mouse over a variable and see mypy type information.
Could pylsp-mypy support that?
As far as I know, mypy provides two ways to access this information at present, neither of which are perfect for this purpose:
- dmypy supports this as of 0.981 https://mypy.readthedocs.io/en/latest/mypy_daemon.html#statically-inspect-expressions -- but I think your README.md says that dmypy only currently gives you any info on saving to disk? Better than nothing.
- reveal_type/reveal_locals. I guess in principle pylsp could sneak in a
reveal_locals() to whatever function point is on before sending the file to mypy (obviously this has its problems!)
At present, the only other way I know of to get this information in emacs is using reveal_locals() (or reveal_type) and having flycheck show the note-level info about that that contains the types. However, this flycheck issue makes that awkward for now (and quite non-obvious that you can even see types that way!). Also of course it's annoying to have to add reveal_locals() whenever you want to see types.
I'd like to be able to hover cursor/mouse over a variable and see mypy type information.
Could pylsp-mypy support that?
As far as I know, mypy provides two ways to access this information at present, neither of which are perfect for this purpose:
reveal_locals()to whatever function point is on before sending the file to mypy (obviously this has its problems!)At present, the only other way I know of to get this information in emacs is using
reveal_locals()(orreveal_type) and havingflycheckshow thenote-level info about that that contains the types. However, this flycheck issue makes that awkward for now (and quite non-obvious that you can even see types that way!). Also of course it's annoying to have to addreveal_locals()whenever you want to see types.