Skip to content

[Experiment] Some tweaking to handle project references for auto import - #55955

Merged
Sheetal Nandi (sheetalkamat) merged 13 commits into
mainfrom
autoImportReferencedProject
Apr 18, 2024
Merged

[Experiment] Some tweaking to handle project references for auto import#55955
Sheetal Nandi (sheetalkamat) merged 13 commits into
mainfrom
autoImportReferencedProject

Conversation

@sheetalkamat

@sheetalkamat Sheetal Nandi (sheetalkamat) commented Oct 2, 2023

Copy link
Copy Markdown
Member
  • Add directly referenced project's root files to the auto import provider if "paths" are setup in options which kind of indicates willingness to use module resolution
  • Allow auto import if paths is present in options or symlink cache has any symlinks discovered (as part of say calculating auto import root names)

Fixes #55879

@sheetalkamat

Copy link
Copy Markdown
Member Author

May be we also need some tweaking if referenced project was discovered while node_modules were detected and we ignored everything but entry point.

@sheetalkamat

Copy link
Copy Markdown
Member Author

We also could get info from opened referenced project instead of adding to auto import provider but I wanted to first check if we want something like this which understands referenced project or not before adding anything more to this experiment

@sheetalkamat Sheetal Nandi (sheetalkamat) changed the title Some tweaking to handle project references for auto import [Experiment] Some tweaking to handle project references for auto import Oct 3, 2023
@sheetalkamat
Sheetal Nandi (sheetalkamat) marked this pull request as draft October 3, 2023 17:27
@andrewbranch

Copy link
Copy Markdown
Member

We also could get info from opened referenced project instead of adding to auto import provider

This was the approach I took in #47690 which ended up being problematic for the export info and module specifier caches. I forgot about this distinction when we talked the other day. I think using the AutoImportProvider is slightly less efficient but avoids these caching pitfalls, and is overall a more promising approach. I spent a little while trying to break the export info cache invalidation on this branch and it looked good. That said, exportMapCache.ts and moduleSpecifierCache.ts could be updated to exercise this new functionality.

@typescript-bot TypeScript Bot (typescript-bot) added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Apr 11, 2024
@sheetalkamat
Sheetal Nandi (sheetalkamat) marked this pull request as ready for review April 12, 2024 22:16
@sheetalkamat

Copy link
Copy Markdown
Member Author

Andrew Branch (@andrewbranch) ready for review

Comment thread src/server/project.ts Outdated
…orts

This also adds output file instead of input file names so that there is no deduplication needed and the correct paths are used for completions
@sheetalkamat

Copy link
Copy Markdown
Member Author

Andrew Branch (@andrewbranch) i had missed the editor services to update to check for same flag when i first pushed commit .. didn’t realize you already looked at it or I would I have made separate commit .. i will also add a test when that option is not set in host preferences just for completeness when I get to desk

@sheetalkamat
Sheetal Nandi (sheetalkamat) deleted the autoImportReferencedProject branch April 18, 2024 18:41
@joeuy

joeuy commented Jul 3, 2025

Copy link
Copy Markdown

Sheetal Nandi (@sheetalkamat) Andrew Branch (@andrewbranch) I am having the problem that autoimport is not working for project references.

Example: project A -> project B
however inside project A autoimport is not finding dependencies inside project B.

Can you point me to some reference /explain how to get this to work?

@andrewbranch

Copy link
Copy Markdown
Member

joeuy please file a new issue with full repro steps. Thanks!

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Jan 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto import suggestion across referenced composite projects

4 participants