Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python auto import extension for VSCode

Is there a Python auto import extension/plugin available for Visual Studio Code?

By auto import I mean, auto import of python modules. Eclipse and Intellij has this feature with Java.

like image 418
Soumitri Pattnaik Avatar asked Oct 14 '17 09:10

Soumitri Pattnaik


People also ask

How do I import an extension into VS Code?

You can browse and install extensions from within VS Code. Bring up the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of VS Code or the View: Extensions command (Ctrl+Shift+X). This will show you a list of the most popular VS Code extensions on the VS Code Marketplace.

How do I import a Python File into Visual Studio Code?

With Python installed and your local programming environment set up, open Visual Studio Code. Inside of Visual Studio Code, open the directory you're working in by going to File -> Open and selecting the directory. After that, you'll see your folder open in the explorer window on the left.


2 Answers

VSCode team recently released Pylance

Features

  • Docstrings
  • Signature help, with type information
  • Parameter suggestions
  • Code completion
  • Auto-imports (as well as add and remove import code actions)
  • As-you-type reporting of code errors and warnings (diagnostics)
  • Code outline
  • Code navigation
  • Code lens (references/implementations)
  • Type checking mode
  • Native multi-root workspace support
  • IntelliCode compatibility
  • Jupyter Notebooks compatibility
like image 76
Eyal Levin Avatar answered Sep 21 '22 08:09

Eyal Levin


No, but it will soon be a part of vscode-python: https://github.com/Microsoft/vscode-python/pull/636

EDIT: See answer by @Eric, who built such an extension.

EDIT 2: See answer by @Eyal Levin, mentioning such an extension (Pylance).

like image 32
Zachary Ryan Smith Avatar answered Sep 23 '22 08:09

Zachary Ryan Smith