Skip to content
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] Some tweaking to handle project references for auto import #55955

Merged
merged 13 commits into from
Apr 18, 2024

Conversation

sheetalkamat
Copy link
Member

@sheetalkamat sheetalkamat commented Oct 2, 2023

  • 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

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 2, 2023
@sheetalkamat
Copy link
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
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 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 sheetalkamat marked this pull request as draft October 3, 2023 17:27
@andrewbranch
Copy link
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 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 sheetalkamat force-pushed the autoImportReferencedProject branch from 4856328 to 2836e26 Compare April 12, 2024 21:54
@sheetalkamat sheetalkamat marked this pull request as ready for review April 12, 2024 22:16
@sheetalkamat
Copy link
Member Author

@andrewbranch ready for review

src/server/project.ts Outdated Show resolved Hide resolved
…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 sheetalkamat force-pushed the autoImportReferencedProject branch from 42833f8 to 12f6c2e Compare April 17, 2024 23:39
@sheetalkamat
Copy link
Member Author

@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 sheetalkamat merged commit 5b3060d into main Apr 18, 2024
25 checks passed
@sheetalkamat sheetalkamat deleted the autoImportReferencedProject branch April 18, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
3 participants