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

Intellisense expects project packages in root folder: bug or feature? #244

Closed
dangerouslyIl opened this issue Nov 16, 2017 · 5 comments
Closed
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality

Comments

@dangerouslyIl
Copy link

dangerouslyIl commented Nov 16, 2017

Environment data

VS Code version: 1.18.0
Python Extension version: 0.8.0
Python Version: Python 2.7.14
OS and version: Mac Sierra - Python 2.7.14

Steps to reproduce:

the setup of my project is

.
├── setup.py
├── docker stuff, etc...
├── src
│   └── foo
│       ├── __init__.py
│       └── bar 

etc...

Actual behavior

in a source subdirectory, I import from foo.bar, intellisense recognizes the foo module, but not the bar module or any other sub module

However, if I add this to my settings.json, all is well:
"python.autoComplete.extraPaths": [ "${workspaceRoot}/src"]

I'm not a python expert, but this is how my company structures python projects, which may be non-standard

Expected behavior

I was expecting intellisense to scan my workspace recursively and find the modules in non root folders without any help

@DonJayamanne
Copy link

Yes, this is the expected behavior.

@DonJayamanne DonJayamanne added area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality labels Nov 16, 2017
@dangerouslyIl
Copy link
Author

While I think recursively scanning would be a nice perk, I did struggle a bit to figure it out the setting to tweak.
I think it would be great to document that in the setting up Intellisense tutorial or in an FAQ that to include project modules, you need to include the root modules's directory in python.autoComplete.extraPaths to save others that pain.

@brettcannon brettcannon added this to the December 2017 milestone Nov 16, 2017
@brettcannon brettcannon removed this from the December 2017 milestone Nov 29, 2017
@gustavovalverde
Copy link

gustavovalverde commented Feb 26, 2018

Also agree that the recursive scanning would be a nice feature.

I for example work on an Open Source project github.com/odoo/odoo which under this circumstances implies that I have to add more than 40 paths from odoo/addons to python.autoComplete.extraPaths so this feature can fully work

@gustavovalverde
Copy link

Could this be fixed by davidhalter/jedi#1005?

@brettcannon
Copy link
Member

Closing this as a duplicate of #924

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 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. feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants