MypyReveal
Uses mypy to easily reveal type of variable under cursor, or types of all local variables
Details
Installs
- Total 868
- Win 294
- Mac 270
- Linux 304
| Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 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 |
| 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 | 1 | 0 |
| Linux | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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.