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

Auto-import does not work as expected nor suggest imports #2543

Closed
andrew-noyo opened this issue Apr 6, 2022 · 4 comments
Closed

Auto-import does not work as expected nor suggest imports #2543

andrew-noyo opened this issue Apr 6, 2022 · 4 comments
Labels
needs investigation Could be an issue - needs investigation

Comments

@andrew-noyo
Copy link

Environment data

  • Language Server version: Pylance v2022.3.4
  • OS and version: macOS Monterey 12.2.1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
  • Attached to running container: Docker

Expected behaviour

Auto-import or suggestions to import appear.

from schemas.carriers import reliance_standard_us_uuid

Actual behaviour

No auto-import or suggestions to import appear.

Logs

9,57,F,F821:undefined name 'reliance_standard_us_uuid'

##########Linting Output - flake8##########

39,57,F,F821:undefined name 'reliance_standard_us_uuid'

> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
##########Linting Output - flake8##########


> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
##########Linting Output - flake8##########


> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
##########Linting Output - flake8##########


> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
##########Linting Output - flake8##########


> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
##########Linting Output - flake8##########


> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
##########Linting Output - flake8##########


##########Linting Output - flake8##########


> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/linter.py -m flake8 ./pipeline/carriers/reliance_standard/cron_download/store.py
cwd: .
> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests
cwd: .
##########Linting Output - flake8##########

Code Snippet / Additional information

batch_enrollment_processor_file = (
                f"{employee_navigator_organization_id}/{reliance_standard_us_uuid}/"
                f"employeenavigator-reliance-standard/{ftp_file}.xml"
            )
@github-actions github-actions bot added the triage label Apr 6, 2022
@judej judej added the needs investigation Could be an issue - needs investigation label Apr 7, 2022
@github-actions github-actions bot removed the triage label Apr 7, 2022
@judej
Copy link
Contributor

judej commented Apr 7, 2022

Thanks for the report. Currently we only support first level symbols for auto import. Since reliance_standard_us_uuid is in the second level in carriers, it is not provided as an auto import.

@judej judej closed this as completed Apr 7, 2022
@heejaechang
Copy link
Contributor

There is a hidden option that let you control auto-import behavior if you are okay to take perf hit.

see this comment for detail - #2533 (comment)

by the way, if you are looking for simplest way to include more in auto-import, put this in settings.json, it will include everything up to 3 levels for all modules.

"python.analysis.packageIndexDepths":[["",3, true]],

@andrew-noyo
Copy link
Author

Does this include support for installed packages? I am unable to get an install package to auto import. It is recognized once I manually type it out.

@debonte
Copy link
Contributor

debonte commented Apr 11, 2022

@andrew-noyo, rather than commenting on a closed issue, it would be better to open a new issue describing what you are seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation Could be an issue - needs investigation
Projects
None yet
Development

No branches or pull requests

4 participants