-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Feature
Support invoking reveal_type
from dmypy (similar to suggest
) to enable tooling to use mypy for type information.
Pitch
libCST is an extremely powerful tool for supporting refactoring Python code, and it has support for type information, but currently only supports Pyre:
https://libcst.readthedocs.io/en/latest/_modules/libcst/metadata/type_inference_provider.html#TypeInferenceProvider
Pyre and Mypy result in slightly different type information so I'd prefer to get our type data from mypy itself.
Existing solutions seem pretty janky -
https://github.com/fortana-co/sublime-mypy-reveal/blob/master/mypy_reveal.py#L72-L102 modifies the code and invokes reveal_type
, https://github.com/matangover/mypy-vscode/blob/master/README.md#caveats imports mypy
which isn't well supported.