Experiment: auto-import from yet-unimported referenced projects#47690
Experiment: auto-import from yet-unimported referenced projects#47690andrewbranch wants to merge 10 commits intomicrosoft:mainfrom
Conversation
|
@typescript-bot pack this |
|
Heya @andrewbranch, I've started to run the tarball bundle task on this PR at cba8f31. You can monitor the build here. |
|
@typescript-bot pack this |
|
Heya @andrewbranch, I've started to run the tarball bundle task on this PR at 38def47. You can monitor the build here. |
|
Hey @andrewbranch, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
| } | ||
|
|
||
| export function getExportInfoMap(importingFile: SourceFile, host: LanguageServiceHost, program: Program, cancellationToken: CancellationToken | undefined): ExportInfoMap { | ||
| export function getExportInfoMap(importingFile: SourceFile, host: LanguageServiceHost, program: Program, cancellationToken: CancellationToken | undefined, preferences: UserPreferences): ExportInfoMap { |
There was a problem hiding this comment.
Nit: I think the cancellationToken is usually the last parameter.
|
So it turns out that in TS Server, referenced project changes do not trigger any kind of notification / update / reload of the referencing project, so cache invalidation here doesn’t automatically work. Probably the best thing for this feature will be not to add any referenced-project exports into the ExportMapCache. Seeing as there’s been zero feedback since I’ve started working on this, I’m going to table it for now. |
|
I come from #39778 and I tried this patch but I was not lucky. None suggestions of referenced projects unless I do the first import. |
Still to-do:
useSourceOfProjectReferenceRedirect? Are there cases where the main program will directly contain.d.tsoutputs but the referenced project will show us equivalent.tsinputs?paths)pathsmodule specifier resolutionFixes #39778