Skip to content

Should prefer relative path first before index when it comes to suggestions #47040

Closed
@mmahalwy

Description

@mmahalwy

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.62.3
  • OS Version: Darwin arm64 20.6.0

Steps to Reproduce:

  1. Have a function that is exported from a file, call it './baseSchemas.ts'
  2. Have an index file that exports the contents of that file, export * as baseSchemas from './baseSchemas'
  3. Try to import that function in a file, see something like this:
    image

Expectation is the relative should be preferred over the index. When importing or default to index, it can cause a circular dependency if index is imported, which then index imports the same file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions