Skip to content

Intellisense is broken in the presence of relative imports #949

@zjturner

Description

@zjturner

If you type this:

from . import foo

PTVS doesn't seem to understand this syntax. After you write the . (note the space) you get an intellisense popup suggesting module names, so as you continue typing import it selects importlib and you end up with

from . importlib foo

The modules that its suggesting in this intellisense popup are not located in the specified directory either it just seems to be all the modules in the search paths. So I think PTVS simply has no concept of relative imports.

If you actually go and type out a valid relative import, it is able to resolve it. So something like

from ..foo import bar

if it is a valid module, you will have working intellisense on bar and no squigglies. The problem seems to be isolated only to the case of typing the import statement.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions