vscode-importmagic icon indicating copy to clipboard operation
vscode-importmagic copied to clipboard

Importing standard libraries

Open mrkafk opened this issue 6 years ago • 2 comments

I wrote:

def fun():
    fname = hashlib.

And hashlib is not imported at the top. Importing some symbol with Ctrl-space after dot does not add import either.

VSCode: 1.30.2. OS: Debian 9.7, GUI: kde-plasma

mrkafk avatar Feb 01 '19 10:02 mrkafk

Hi,

Please, verify your project settings. Your environment and python interpreter should be configured properly for your project (python.pythonPath). When you're typing "hashlib" you will see suggestinon "import hashlib". Press enter at this moment and import will be inserted to top:

video

pilat avatar Feb 01 '19 13:02 pilat

Hm, it's a bit surprising how it works. I expected that this plugin would provide code actions. But once I saw your example, it became clear how to actually use it.

balta2ar avatar Mar 11 '19 14:03 balta2ar