スポンサードサーチ
2020年6月30日に、Microsoftは「Visual Studio Code」向けの拡張機能「Pylance」を発表しました。
「Pylance」とは
Pylance is a new language server for Python, which uses the Language Server Protocol to communicate with VS Code.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code
「Pylance」はPython用の新しい言語サーバで、言語サーバープロトコル(LSP)を使用して「Visual Studio Code」と対話します。
Pylance leverages type stubs (.pyi files) and lazy type inferencing to provide a highly-performant development experience.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code
「Pylance」は型スタブファイル(.pyi)と遅延型推論を利用して、高性能な開発体験を提供します。
Pylance supercharges your Python IntelliSense experience with rich type information, helping you write better code, faster.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code
「Pylance」は、豊富な型情報を利用してPython IntelliSenseの経験を強化し、より優れたコードをより迅速に記述できるようにします。
The Pylance extension is also shipped with a collection of type stubs for popular modules to provide fast and accurate auto-completions and type checking.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code
Pylance拡張機能には、一般的なモジュールの型スタブのリストも付属しており、高速で正確な入力補完と型チェックを提供します。
「Pylance」が提供する機能
「Pylance」が提供する機能としては、以下のものがあります。
タイプ情報
Type information is now available in function signatures and when hovering on symbols, providing you with helpful information to ensure that you are correctly invoking functions, to improve the quality of the code you write.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code

タイプ情報が関数シグネチャとシンボルにカーソルを合わせたときに利用できる。
自動インポート
One of our most requested features is finally here! With auto-imports, you are now able to get smart import suggestions in your completions list for installed and standard library modules.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code

自動インポートでインストール済みおよび標準のライブラリモジュールの補完リストを取得。
型チェック診断
If you are excited about types in Python, you can try out Pylance’s type checking mode by setting python.analysis.typeCheckingMode to basic or strict. This setting uses Pyright’s type checking to apply either a basic or comprehensive set of rules over your codebase, respectively. The diagnostics produced from this mode can help improve the quality of your code and help you find edge cases more easily.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code

Pyrightの型チェックを使用して、コードベースに対してルールセットを適用。
マルチルート・ワークスペースのサポート
Pylance natively supports multi-root workspaces, meaning that you can open multiple folders in the same Visual Studio Code session and have Pylance functionality in each folder.
Microsoft:Announcing Pylance: Fast, feature-rich language support for Python in Visual Studio Code

「Pylance」は標準でマルチルート・ワークスペースをサポートしており、同じVisual Studio Codeセッションで複数のフォルダーを開き、各フォルダーに「Pylance」機能を持たせることができます。
スポンサードサーチ