-
Notifications
You must be signed in to change notification settings - Fork 770
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 completions not triggering despite proper indexing #7024
Comments
Can I know what kind of repro is needed? Can I offer this or it's for the team members? |
@PabloLION, the "needs repro" label name is confusing and we've been talking about changing it. In any case, it means that no one on the Pylance team has successfully reproduced (or in this case, even tried to reproduce) the issue yet. It's not saying I'm not that additional info is needed from the person that filed the issue. |
@debonte I'm doing some experiments with a new profile with no extension nor settings, and sometimes the behavior is different. I'm now doubting if it's a problem from pylance or from VSCode. |
Based on my experiment, I believe I’ve found the culprit: The poetry-env managed python 3.13. The symbol shows in "add import" code action and "quick fix", but auto-import is unavailable. Despite using What's my next step to do if I want to try fix this? new profile
{
"python.analysis.autoImportCompletions": true
} old profile
{
"python.analysis.autoImportCompletions": true,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.cacheLSPData": false,
// sometimes CacheLSPData cause pylance to crash
"python.analysis.diagnosticMode": "workspace",
// more unrelated settings
}
Case 3: Only works if the file was opened in the same session Off-topicIs there a tool or some bash command that can help doing all these instead of doing it manually? I think with LLM we can maybe repro automatically without manually checking them. |
Environment data
I tried it with poetry and without poetry with a simple module (with
__init__.py
).Additionally, I checked 5 combinations of pylance and python, because before the auto-import worked:
Code Snippet
Repro Steps
FooClass
, the auto-import should trigger.FooClass
, (automatically; or manually by default Ctrl+Space, editor.action.triggerSuggest) and observe that auto-import suggestions do not appear, instead the tokenFooClass
appears in the suggestion with no "auto-import".Expected behavior
When typing partial of "FooClass", the auto-import should trigger.
Actual behavior
"auto-import" did not trigger

"add import" code action works

Notes
Logs
The text was updated successfully, but these errors were encountered: