Skip to content

Intellisense doesn't autocomplete if package names are repeated in different packages #178

Description

From Kostub Deshmukh (@kostub) on September 13, 2017 22:10

Environment data

VS Code version: 1.16.0
Python Extension version: 0.7.0
Python Version: 2.7.12
OS and version: MacOS Sierra 10.12.6

Steps to reproduce:

  • Create a directory with two packages foo and test
  • Inside foo create a file bar.py
  • Inside the test directory create another package foo
  • Inside test/foo create a file gaz.py

So the directory structure is like:

foo
|--> __init__.py
|--> bar.py
test
|-->__init__.py
|--> foo
     |--> __init__.py
     |--> gaz.py

Open a new file in test/foo directory. Say test/foo/run.py

Add the following code:

from __future__ import absolute_import

Start typing import foo.

Actual behavior

The only autocomplete option shown is gaz

Expected behavior

Expected bar to be shown in the dropdown. Especially when absolute import is being used.
In fact import foo.gaz is probably incorrect since it is not a valid relative import either.

Logs

Output from Python output panel
None

Output from Console window (Help->Developer Tools menu)
None

Copied from original issue: DonJayamanne/pythonVSCode#1211

Activity

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.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions