【VSCode】插件 Pylance : 给 Python 带来编译语言般的开发支持

Backto VS Code

Pylance 是 微软在 2020.06.01 发布的一款 python 语言支持 vs code 插件。

Fast, feature-rich language support for Python
Pylance is an extension that works alongside Python in Visual Studio Code to provide performant language support. Under the hood, Pylance is powered by Pyright, Microsoft’s static type checking tool. Using Pyright, Pylance has the ability to supercharge your Python IntelliSense experience with rich type information, helping you write better code faster.
The Pylance name is a small ode to Monty Python’s Lancelot who was the first knight to answer the bridgekeeper’s questions in the Holy Grail.

新特性很足,给 Python 开发带来了 C++/Java 般的语言支持。

  • Docstrings
  • 参数提示
  • 自动导入
  • 代码补全
  • 代码诊断
  • 引用和跳转
  • 代码大纲
  • 类型检查
  • 支持多工作区
  • 带有类型信息的签名帮助
  • 兼容IntelliCode和Jupyter notebook

具体演示,Ctr + Sht + XPylance 的官方文档,也可参考以下博客

  • 微软再出神器,这次终于对Python下手了! - Jackpop的文章 - 知乎
  • Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code

快捷键 Shortcuts

  • Ctr + Left Click : 代码跳转

设置 Settings

  • Type Checking Mode 默认 off, 可改成 basic 或者 strict ,强制提升代码质量
    【VSCode】插件 Pylance : 给 Python 带来编译语言般的开发支持_第1张图片

你可能感兴趣的:(Python,iTools)