An extension with rich support for the Python language (including Python 3.6), with features including the following and more:
- Linting (Prospector, Pylint, pycodestyle/Pep8, Flake8, pylama, pydocstyle with config files and plugins)
- Intellisense (autocompletion with support for PEP-0484 and PEP 526)
- Auto indenting
- Code formatting (autopep8, yapf, with config files)
- Code refactoring (Rename, Extract Variable, Extract Method, Sort Imports)
- Viewing references, code navigation, view signature
- Excellent debugging support (remote debugging over SSH, mutliple threads, django, flask)
- Running and debugging Unit tests (unittest, pytest, nosetests, with config files)
- Execute file or code in a python terminal
- Local help file (offline documentation)
- Snippets
- Install the extension
- optionally install
ctags
for Workspace Symbols, from here, or usingbrew install ctags
on OSX. - If Python is in the current path
- You're ready to use it.
- To select a different Python Interpreter/Version (or use Virtual Environment), use the command
Select Workspace Interpreter
)
For further information and details continue through to the documentation.
- Contributions are always welcome. Fork it, modify it and create a pull request.
- Details on contributing can be found here
- Any and all feedback is appreciated and welcome.
- Please feel free to add suggestions here
- IDE Features
- Auto indenting
- Code navigation (Go to, Find all references)
- Code definition (Peek and hover definition, View Signature)
- Rename refactoring
- Sorting Import statements (use "Python: Sort Imports" command)
- Intellisense and Autocomplete with support for PEP-0484
- Ability to include custom module paths (e.g. include paths for libraries like Google App Engine, etc.)
- Use the
setting python.autoComplete.extraPaths = []
- For instance getting autocomplete/intellisense for Google App Engine, add the following to your settings file:
"python.autoComplete.extraPaths": [
"C:/Program Files (x86)/Google/google_appengine",
"C:/Program Files (x86)/Google/google_appengine/lib" ]
- This functionality has been moved into a separate extension Jupyter
- Auto formatting of code upon saving changes (default to 'Off')
- Use either yapf or autopep8 for code formatting (defaults to autopep8)
- It can be turned off (default is to be turned on and use pylint)
- Multiple linters supported (along with support for configuration files for each linter)
- Supported linters include pylint, pep8, flake8, pydocstyle, prospector
- Paths to each of the linters can be optionally configured
- Custom plugins such as pylint plugin for Django can be easily used by modifying the settings as follows:
"python.linting.pylintArgs": ["--load-plugins", "pylint_django"]
- Watch window
- Evaluate Expressions
- Step through code (Step in, Step out, Continue)
- Add/remove break points
- Local variables and arguments
- Multiple Threads and Web Applications (such as Flask, Django, with template debugging)
- Expanding values (viewing children, properties, etc)
- Conditional break points
- Remote debugging (over SSH)
- Google App Engine
- Debugging in the integrated or external terminal window
- Debugging as sudo
- Unit Testing
- Support for unittests, nosetests and pytest
- Test results are displayed in the "Python" output window
- Run failed tests, individual tests
- Debugging unittests
- Snippets
- Miscellaneous
- Running a file or selected text in python terminal
- Refactoring
- Fix to enure custom linter paths are respected #1106
- Add new editor menu 'Run Current Unit Test File' #1061
- Changed 'mypy-lang' to mypy #930, #998, #505
- Using "Python -m" to launch linters #716, #923, #1059
- Add PEP 526 AutoCompletion #1102, #1101
- Resolved issues in Go To and Peek Definitions #1085, #961, #870
- Provide details of error with solution for changes to syntax in launch.json #1047, #1025
- Provide a warning about known issues with having pyenv.cfg whilst debugging #913
- Create .vscode directory if not found #1043
- Highlighted text due to linter errors is off by one column #965, #970
- Added preminary support for WSL Bash and Cygwin #1049
- Ability to configure the linter severity levels #941, #895
- Fixes to unit tests #1051, #1050
- Outdent lines following
contibue
,break
andreturn
#1050 - Change location of cache for Jedi files #1035
- Fixes to the way directories are searched for Python interpreters #569, #1040
- Handle outputs from Python packages that interfere with the way autocompletion is handled #602