MypyReveal
Uses mypy to easily reveal type of variable under cursor, or types of all local variables
Details
Installs
- Total 862
- Win 291
- Mac 269
- Linux 302
| Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 1 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
MypyReveal
A Sublime Text plugin that uses mypy to reveal the type of the variable under your cursor, or to reveal the types of all local variables, using reveal_type or reveal_locals. Read more here.
Requirements
Make sure you install mypy 0.711 or later first, and that it's in your $PATH.
Installation
Search for MypyReveal in Package Control.
Usage
Search for MypyReveal in the command palette, and run either MypyReveal: Type or MypyReveal: Locals.
Key Bindings
If you wanted to bind ctrl+t to reveal type and alt+t to reveal locals, you would insert the following into your .sublime-keymap:
{
"keys": ["ctrl+t"],
"command": "mypy_reveal",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.python" }]
},
{
"keys": ["alt+t"],
"command": "mypy_reveal",
"args": {
"locals": true
},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.python" }]
},
Custom Executable
Like Sublime Linter, this plugin assumes mypy is in the $PATH available to Sublime Text. If it's not, you'll have to set your own executable path in settings.
If you want per-project executable paths, e.g. because you want mypy to have access to the packages you have installed in a virtual env, add the following to your project settings:
{
"folders": [
{
"path": "..."
}
],
"settings": {
"MypyReveal.executable": "/path/to/mypy"
}
}
This plugin is designed to work in conjunction with the mypy Sublime Linter plugin.
If, in your project settings, you set SublimeLinter.linters.mypy.executable instead of MypyReveal.executable, MypyReveal will fall back to this setting.