Skip to content
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

Pylance intelligence can only take effect after qucik fix is used #3324

Closed
ydmykr opened this issue Sep 13, 2022 · 2 comments
Closed

Pylance intelligence can only take effect after qucik fix is used #3324

ydmykr opened this issue Sep 13, 2022 · 2 comments
Assignees

Comments

@ydmykr
Copy link

ydmykr commented Sep 13, 2022

Here is an example:

image

When I click quick fix, delete the content and re-enter it, I can get a prompt, otherwise it doesn't exist.

image

Is there any way I can get a prompt directly?

I tried to add the following in settings.json:

    "python.autoComplete.extraPaths": [
        "C:\\newPython\\helloFloder\\helloFloder2\\hello.py"
    ],
    "python.analysis.extraPaths": [
        "C:\\newPython\\helloFloder\\helloFloder2\\hello.py"
    ]

I also add the init.py in the folder. But they didn't work.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Sep 13, 2022
@luabud luabud self-assigned this Sep 13, 2022
@luabud
Copy link
Member

luabud commented Sep 13, 2022

Hey @ydmykr, would you mind trying setting "python.analysis.indexing":true in your settings.json file? (View > Command Palette... and run "Open User Settings (JSON)"). What you're reporting seems to be the behaviour of when this setting is set to "false", and it looks like there's a bug where we're not setting it to "true" by default.

@heejaechang
Copy link
Contributor

heejaechang commented Sep 13, 2022

this is currently by design. currently, we do not add user types in auto import unless it is already used (doesn't need to be current file, but by some imports or other opened files). code action on the other hand, adds all user types. this was a decision to make sure we do not add hundreds of user types in completion list.

so, even if you enable "indexing", the behavior you are describing won't change. we already experimented with putting all user types in completion, but that caused perf issue on completion especially with big project that has hundred thousands of user symbols. word matching wasn't enough. completion still had thousand of matched suggestion in there.

we might be able to provide a hidden option to put all user types in completion for people who are okay with perf hit, but that should be done in discussion, not in issue.

if you want that enhancement, please create new discussion item on discussion tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants