Skip to content

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

Closed

Description

@dangerouslyIl

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

Activity

  1. DonJayamanne commented on Nov 16, 2017

    @DonJayamanne

    Yes, this is the expected behavior.

  2. dangerouslyIl commented on Nov 16, 2017

    @dangerouslyIl
    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.

  3. gustavovalverde commented on Feb 26, 2018

    @gustavovalverde

    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

  4. gustavovalverde commented on Feb 26, 2018

    @gustavovalverde

    Could this be fixed by davidhalter/jedi#1005?

  5. brettcannon commented on Apr 5, 2018

    @brettcannon
    Member

    Closing this as a duplicate of #924

  6. locked as resolved and limited conversation to collaborators on Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions