-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Resolve modules, type reference directives in context of referenced file #27560
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0ac9658
Resolve project references transitively
sheetalkamat 0e4b10d
Use resolution options of project reference if the file is from the p…
sheetalkamat 6923f2c
Handle caching of module resolution depending on project references
sheetalkamat 4d413a6
Fix the fileByName cache when program is used completely which breaks…
sheetalkamat d4e4b43
Verify that own config change in module resolution gets reflected
sheetalkamat 94df516
Handle resolution caching when referenced tsconfig changes
sheetalkamat 3e67cf4
Verify errors on transitively referenced files
sheetalkamat 2fb11d8
Test transitive references in folders side by side so that later we c…
sheetalkamat dd34314
Add tests for project updates with tsserver
sheetalkamat 88f79de
Merge branch 'master' into transitiveReferences
sheetalkamat ae1bd8b
Merge branch 'master' into transitiveReferences
sheetalkamat 578f8db
Add test cases for transitive reference with different module resolution
sheetalkamat b69622a
Merge branch 'master' into transitiveReferences
sheetalkamat bc72577
Merge branch 'master' into transitiveReferences
sheetalkamat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
when resolving module names in the root project, there will be no
ResolvedProjectReference
. Therefore a custom CompilerHost has no access to the CompilerOptions of that project.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.
That is not changed since it was original API as well. In general host already knows root compiler options. Eg. https://github.com/TypeStrong/ts-loader/blob/master/src/servicesHost.ts#L498
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.
Correct, although that only works when building exactly one project with that host. The current implementation of
tsbuild.ts
(I know it's still considered internal) uses the sameSolutionBuilderHost
to build all projects. That host cannot know about the compilerOptions of all projects. And since tsbuild can even handle multiple tsconfig.json files at once, there's no way the host could ever know the correct compilerOptions.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.
I don't think we want to change that. (the default compilerHost is for specific compilerOptions) Infact we want to change tsbuilder to create compiler host for each program separaterly but that's a todo for little later.