-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto import feature doesn't work properly #2312
Comments
it looks like a bug. thank you for reporting the issue! |
It's my honor for getting confirmed by you.The problem also happened with the module in the subdirectory of the package.
Be waiting for the next update for the solution.
…------------------------------------------------------------
it looks like a bug. thank you for reporting the issue!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
so, it is happening since DictCursor is not in __ all __ nor there is pyi file. and it is not py.typed package. so we don't know whether it is a part of public API or not. so we dropped it. |
Since we don't want to bloat completion with bunch of symbols, I dont think we want to enable it by default, but I added a hidden option as an escape patch. Basically, if one adds this to setting.json, we will treat the package special and scan more symbols from it. "python.analysis.packageIndexDepths": [[packageName: string, depth: number, forceIndexing: boolean]*], ex)
packageName is the name of the package, depth means how deep the scanner will scan, forceIndexing means it will include all symbols in the py file discovered regardless of __ all __ or py.typed. |
This issue has been fixed in version 2022.3.2, which we've just released. You can find the changelog here: CHANGELOG.md |
@heejaechang That is awesome! Would something similar work for workspace files too? I keep having issues where auto-import / suggestions don't work or symbols aren't found. Even with The project I currently work on usually doesn't use With
A somewhat related issue: #1055 |
Is there any way to use the packageIndexDepths workaround without specifying the package? The inability to get auto-imports for most of the third-party packages I use is frustrating, and I don't want to have to configure these package by package. |
for default 3 levels I believe this is it: "python.analysis.packageIndexDepths": [
["",3]
], |
Thanks, that works! |
Using normal VS code (not Insiders) with this config in settings.json gives me: an "Unknown Configuration Setting" popup in VS Code and the config line looks gray-out. Also can not say that it fixes anything for me. |
I want to get the auto-import hint when inputing an Class or Function defined in another module. But pylance don't give the correct hint.
In this case,I want to get the quick fixes suggestion for 'DictCursor' defined in the 'cursors.py' of pymysql package. Bud the amazing thing is when I reload the window ,it will give the correct hint whit quick fixes in a few seconds,and soon disappeared.
After review the trace output of pylance,the 'cursors.py' has been parsed.
(99398) [BG(1)] parsing: /Users/python/vscode/vscode/venv/lib/python3.9/site-packages/pymysql/cursors.py [fs read 0ms] (9ms)
(99398) [BG(1)] binding: /Users/python/vscode/vscode/venv/lib/python3.9/site-packages/pymysql/cursors.py (4ms)
What happened,is there any configuration should be setup?
2022-02-01.11.51.54.mov
The text was updated successfully, but these errors were encountered: