vscode-importmagic
vscode-importmagic copied to clipboard
Importing standard libraries
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
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:
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.