-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experiment: auto-import from yet-unimported referenced projects #47690
Experiment: auto-import from yet-unimported referenced projects #47690
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 |
@@ -360,7 +394,7 @@ namespace ts { | |||
} | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.ts
outputs but the referenced project will show us equivalent.ts
inputs?paths
)paths
module specifier resolutionFixes #39778