Skip to content

Issues trying to auto-import across project boundaries  #29605

@MLoughry

Description

@MLoughry

TypeScript Version: 3.2.2, 3.3.0-rc

Search Terms: autoimport, project references, autocomplete

Code
Full minimal repro: https://github.com/MLoughry/typescript-repro

See src/a/lib/index.ts

// If another file in the project already has an import from the other project,
//   then attempting to auto-import `bar` will prompt you to import from 'obj/b/lib'
// If no other import is found within the project, no auto-import suggestions are found
console.log(bar);

Expected behavior:
Auto-import should work across project boundaries when an outDir is specified (with or without paths specified in tsconfig.json)

Actual behavior:

  • If there is already a cross-project import within the project: The auto-import attempts to import from the outDir.
    image
  • If there is no other cross-project import within the project: No import suggestions are found.
    image

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions