头图

We are happy to announce that the Python and Jupyter extensions for Visual Studio Code released in July 2022 are now available.

This release includes Pylance's embedded type hints and improvements to the Jupyter notebook setup experience. If you're interested, you can check out our blog for full updates on the Python , Jupyter , and Pylance extensions.

Embedded type hints

Embed hints add inline information to your code in the editor to help you understand the meaning of a variable or function at a glance.

In this release, we've added two types of embedding hints when using Pylance : variable types and return types.

The return type embedding hint shows the return type of functions that are not explicitly annotated. To enable it, you can add the following settings in settings.json (Preferences: Open Settings (JSON)):

"python.analysis.inlayHints.functionReturnTypes": true

Likewise, variable type embedding hints show variable types without explicit type annotations. You can enable it by setting: "python.analysis.inlayHints.variableTypes": true.

image.png

Subject: Horizon Extended

It's worth noting that these prompts don't change the code, they just display information in the coding interface. In the meantime, we're working on adding the ability to add suggested comments to code , so stay tuned!

Improve the setup experience for Jupyter Notebooks

We've improved the extension recommendation process in Jupyter to help improve the onboarding experience when no Python or Jupyter extensions are installed. After opening the Jupyter Notebook in VS Code, when you try to run the unit or select the kernel, you will see the "install suggested extensions" option:

This change greatly simplifies running your first notebook cell in VS Code.

Other changes and enhancements

We've also added some small enhancements and user-requested fixes that should improve your experience with Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:
We added a warning to conda env when it lacks an interpreter with a valid python binary, ( vscode-python#18934 ).
The --user flag is no longer used when installing tools in a virtual environment ( vscode-python#14327 ).
We fixed some IPyWidget issues related to loading of resources (images, scripts, etc.) in Jupyter extensions, and improved support for widgets like VegaFusion , ipyleaflet , Chemiscope , mobilechelonian , and ipyturtle ( vscode-jupyter#10459 ).

·
We have added new functionality to the web version of the Jupyter extension :

export interactive windows ( vscode-jupyter#10291 )

· Debug interactive window

Collapsible cells in interactive windows ( vscode-jupyter#10524 )

Our special thanks to this month's contributors:

·
Lakshmikanth2001 : Add breakpoint support for django-html and django-txt ( vscode-python#19288 ).

·
ksy7588 : Fix unit test discovery issue with experimental components ( vscode-python#19324 ).

·
usta : Fix variable names described by flake8Path ( vscode-python#19313 ).

·
ChaseKnowlden : Fix inconsistent links in README ( vscode-jupyter#10396 ).

·
kilacoda : Remove extra button from restarting kernel mode ( vscode-jupyter#10539 ).

·
afeld : Add more context around extension in README ( vscode-black-formatter#82 ).

Try these new improvements by downloading the Python extension and Jupyter extension from the Marketplace, or install them directly from the Extensions view in Visual Studio Code (Ctrl + Shift + X or ⌘ + ⇧ + X). You can learn more about Visual Studio Code Python support in the documentation. If you run into any issues or have suggestions, please file an issue on the GitHub page.

图片
Long press to identify the QR code and follow Microsoft Developer MSDN

Click to go to the original blog~


微软技术栈
423 声望998 粉丝

微软技术生态官方平台。予力众生,成就不凡!微软致力于用技术改变世界,助力企业实现数字化转型。