project-references-demo icon indicating copy to clipboard operation
project-references-demo copied to clipboard

Is there anyway to get the auto import feature from VS Code to work with project reference?

Open sunniejai opened this issue 5 years ago • 2 comments

Currently, it looks like the auto-import will work for any files are already referenced, so if i add a bark function to dog.ts, you can immediately import that in zoo.ts

However, let's say I add a new file, cat.ts, and a meow function in it. There's no way to auto-import that function into zoo.ts.

I tried this with tsc -b -w running and the declarations are being created, but VS code still doesn't pick that up

sunniejai avatar Dec 30 '19 23:12 sunniejai

I've been puzzling over this for a few days. Should we expect to be able to auto-import from referenced projects? I'm not able to get this to work in VS Code.

Example:

  1. Open zoo/zoo.ts.
  2. Remove the import statement for Dog.
  3. Observe that you are unable to auto-import Dog.

Tested with 3.9.0-dev.20200212 and 3.7.5.

cymptom avatar Feb 12 '20 17:02 cymptom

If anyone is interested why, there is an issue open to solve this https://github.com/microsoft/TypeScript/issues/39778.

matuella avatar Jul 28 '21 16:07 matuella