'Is there plugin for VS code that can automatically handle my webdriver imports? [closed]
I am learning selenium and I am having an issue with from where to import stuff.
For example, when I want to use WebDriverWait I need to import it like:
from selenium.webdriver.support.wait import WebDriverWait
Is there any way to automatically do this with some plugin for VS Code?
Solution 1:[1]
Currently we only support first level symbols on auto import by default.
you need to use the hidden options to enable it if necessary.
In settings.json, put this for us to pick the symbols up for auto import:
"python.analysis.packageIndexDepths":[["PySide6",2]],
what it basically means is ["package name", "max depth to search"]. "max depth" basically means how many dot you need to access the module you want.
For example, PySide6.QtWidgets this is 2 level deep.
Deeper you go, Pylance will take more time to scan python files.
You can also use [["",2]]
, it will change default depth.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | MingJie-MSFT |