Skip to content

Intellisense and Code navigation fails in New language when using package names #2153

@DonJayamanne

Description

@DonJayamanne

Environment data

  • VS Code version: Insiders
  • Extension version (available under the Extensions sidebar): Master
  • OS and version: Mac
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A

Actual behavior

  • Code navigation does not work
  • Intellisense does not work

Expected behavior

Code navigation should work.

Steps to reproduce:

  1. Open an empty folder in VSC
  2. Create a folder mypkg1
  3. Add empty __init__.py and __main__.py files in the above mypkg1 dir
  4. Add a file named bar.py in the above directory with the following contents:
def do_something():
   pass
  1. Create a file named foo.py in the above directory with the following contents:
from mypkg1.bar import do_something


do_something()
  1. Note, while typing from mypkg1. there's no auto completion (intellisense). This works in Jedi.
  2. Try to go to definition of do_something, will not go into bar.py file.
  3. Notice the squigglies under mymod1.bar.
  4. Message in Problems window is
    [Python (analysis)] Unable to resolve 'mymod1.bar'. IntelliSense may be missing for this module.

This works in Jedi, both intellisense and code navigation.

FYI - This was identified while working on PTVSD.

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions