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