Microsoft has released the December update of the extension for Python in Visual Studio Code. The official extension brings something new for the Pylance language server, including for working in virtual or untrustworthy environments. Local debugging with Python 2.7 is to be omitted from the next release, as the debugger used debugpy will raise the required language version to Python 3 from January.
New Pylance function: Refactor Preview
The current release of the Python extension brings innovations for the Language Server Pylance, including the most desired feature according to the development team. Previously, after renaming files or modules, developers had to manually search for references in the code base and adapt them. Pylance now does this automatically: It finds all mentions of the relevant instance and shows a preview of the changes, which can be accepted, changed or discarded as required.
Python in VS Code: A click on the hook accepts the change proposed by the Refactor Preview in the December update.
In addition, Pylance offers syntax error detection and limited IntelliSense use for virtual or untrustworthy workspaces. Additional features for these environments include semantic highlighting and contextual document highlighting, which marks symbols used at a glance in a code file.
Pylance as the sole language server
The language server Pylance, first published in July 2020, was declared standard in May and finally replaced the three-year-old Python Language Server, also developed by Microsoft, last month. Under the hood, Pylance relies on Microsoft’s static type checking tool Pyright and offers, among other things, automatic code completion, semantic highlighting and compatibility with Jupyter notebooks. Pylance is available as an optional dependency after installing the Python Extension.
More information on the new release of the Python Extension for VS Code offers Microsoft’s developer blog.
Disclaimer: This article is generated from the feed and not edited by our team.