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

Autocomplete fails with paths listed in PYTHONPATH via .env file #316

Closed
xgalaxy opened this issue Nov 28, 2017 · 8 comments · Fixed by #466
Closed

Autocomplete fails with paths listed in PYTHONPATH via .env file #316

xgalaxy opened this issue Nov 28, 2017 · 8 comments · Fixed by #466
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@xgalaxy
Copy link

xgalaxy commented Nov 28, 2017

Environment data

VS Code version:
Code 1.18.1 (929bacba01ef658b873545e26034d1a8067445e9, 2017-11-16T18:23:26.125Z)

Python Extension version:
0.8.0

Python Version:
Python 2.7.14 :: Anaconda, Inc.

OS and version:
Darwin x64 16.7.0

Actual behavior

Auto complete does not work properly with additional packages listed in PYTHONPATH added via the .env file.

Expected behavior

Auto complete will list documentation, methods, functions, etc. from packages listed in PYTHONPATH.

Steps to reproduce:

  • Add paths to PYTHONPATH via the workspace .env file
  • Notice that pylint seems to pick up the extra paths just fine. But auto complete fails to work.
@DonJayamanne
Copy link

Please could you provide a sample (sample repo).
Also, have you tried reloading VS Code (currently you'll need to reload vscode after editingthe .env file)

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug labels Nov 28, 2017
@xgalaxy
Copy link
Author

xgalaxy commented Nov 29, 2017

Here is an example repo: https://github.com/xgalaxy/python_test

I created a .env file that exposes the libs folder modules to PYTHONPATH. While this exposes the libs path to the linters correctly, the autocompletion and cmd+click navigation and documentation for the modules in libs doesn't function unless you also add the libs path to python.autocomplete.extraPaths.

In my opinion I think the extra paths and .env system needs an overhaul. I shouldn't have to list the same paths in multiple places to get a complete functioning development environment.

I would remove the .env file completely and rename python.autocomplete.extraPaths to python.extraPaths and expose the paths in that setting to every python tool; the linters, autocompletion system, documentation system, debugger, etc.

@DonJayamanne
Copy link

Thanks for the sample repo.

In my opinion I think the extra paths and .env system needs an overhaul. I shouldn't have to list the same paths in multiple places to get a complete functioning development environment.

Agreed, this will be resolved with the issue #228.

Just confirming, this issue would get resolved along with #228. All you'll need to do is add the settings in .env. file (and you wouldn't need to reload vscode).

@brettcannon
Copy link
Member

I'm closing this as it has been over a month since we requested more info. If we do get the info at a later date we can re-open this issue.

DonJayamanne added a commit that referenced this issue Jan 3, 2018
Refactor how environment variables are parsed and used in tools, language server and debugger

Fixes #316 (PYTHONPATH not used as extra path for auto complete)
Fixes #183 (changes to .env file requires restarts of vscode)
Fixes #436 (Path variables not inherited when debugging)
Fixes #435 (Virtual environment name is same as the default environment file)
@DonJayamanne DonJayamanne added awaiting 4-validation and removed info-needed Issue requires more information from poster labels Jan 4, 2018
@DonJayamanne DonJayamanne added this to the January 2018 milestone Jan 4, 2018
@xgalaxy
Copy link
Author

xgalaxy commented Jan 6, 2018

Not sure what more info you needed. An example repo was requested and provided.

@brettcannon
Copy link
Member

@xgalaxy if you look at the last message from @DonJayamanne he asked you to test something out to verify if something would fix your issue.

@xgalaxy
Copy link
Author

xgalaxy commented Jan 12, 2018

No, adding those paths to env won't work. As is stated in the original ticket comments and the very title of this ticket. Am I misunderstanding something here?

@brettcannon
Copy link
Member

We have released a new version of the extension since you first reported this so we wanted you to validate for us whether the issue persisted for you as we think we fixed it.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants