-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Expand auto-import to all package.json dependencies #38923
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
andrewbranch
merged 63 commits into
microsoft:master
from
andrewbranch:experiment/auto-import/program-per-package-json
Jun 22, 2020
Merged
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
f67fb5b
Start experiment
andrewbranch 8e128d8
Add logging
andrewbranch 23f72c7
Go back to a single program
andrewbranch 913c380
Fix forEachExternalModuleToImportFrom
andrewbranch c1d1721
Move auxiliary program to language service
andrewbranch feb719a
Add logging
andrewbranch 3bad9ee
Don’t use resolution cache
andrewbranch d0c2d50
Fix(?) containingProjects for ScriptInfo in auxiliary program
andrewbranch 3554044
Fix ScriptInfo project inclusion
andrewbranch 3d03027
Add test for default project of auto-importable ScriptInfo
andrewbranch bba64e2
Add fourslash server test
andrewbranch 304b8a3
Don’t create auto import provider inside node_modules
andrewbranch 4fed93d
Add monorepo-like test
andrewbranch 958adc0
WIP
andrewbranch 1ff2db5
Naively ensure autoImportProvider is up to date after package.json ch…
andrewbranch af64cd2
Start limiting when auto update provider gets updated
andrewbranch 3d07e97
Respond to changes in node_modules
andrewbranch 936763a
Don’t create auto-import provider until a file is open that would use it
andrewbranch c0066b3
Merge branch 'master' into experiment/auto-import/program-per-package…
andrewbranch 86151e1
Clean up naming, @internal marking, and fix empty project creation bug
andrewbranch 9c946d6
Drop devDependencies, include peerDependencies
andrewbranch d3c6785
Add additional compiler options
andrewbranch 9882aeb
Merge branch 'master' into experiment/auto-import/program-per-package…
andrewbranch 6b0441e
Fix interaction with importSuggestionsCache
andrewbranch 40d6363
Move option to UserPreferences, allow inclusion of devDependencies
andrewbranch d4800ab
Don’t filter out peerDependencies
andrewbranch dd7240e
Watch unparseable package.jsons
andrewbranch 8823473
But don’t filter packages out due to an invalid package.json
andrewbranch 00b57e3
Update test
andrewbranch 242127d
Merge branch 'master' into experiment/auto-import/program-per-package…
andrewbranch 8d59f50
Don’t use autoImportProvider in codefixes where it can never be used …
andrewbranch 0d4fff9
Add CompletionEntry property for telemetry
andrewbranch e9c7f6a
Add assertion for isPackageJsonImport to fourslash
andrewbranch 6448144
Fix missing pushSymbol argument
andrewbranch 955edbc
Add isPackageJsonImport to tests and API baselines
andrewbranch fb8fb38
Fix unit test
andrewbranch 75f12f5
Host auto import provider in new Project kind
andrewbranch 327efa9
Fix InferredProject attaching on AutoImportProvider-included files, l…
andrewbranch f638d46
Update Public APIs
andrewbranch b788b05
Simplify PackageJsonCache host
andrewbranch 01a0e44
Merge branch 'master' into experiment/auto-import/program-per-package…
andrewbranch b6ac999
Remove unneeded markAsDirty
andrewbranch 6e6a71d
Defer project finished event until after AutoImportProvider is created
andrewbranch c11a701
Make AutoImportProviderProject always report isOrphan = true
andrewbranch 4dc2ed2
Close and remove AutoImportProviderProject when host project closes
andrewbranch e360fa1
Don’t set pendingEnsureProjectForOpenFiles
andrewbranch 0c05e3a
Use hasAddedOrRemovedFiles instead of hasNewProgram
andrewbranch e480830
Use host-wide watchOptions for package.json watching
andrewbranch 0cf3cf6
Add to `printProjects`
andrewbranch 83fc465
Clean up
andrewbranch 00e1707
Get autoImportProvider directly from LanguageServiceHost
andrewbranch 737f2ed
Clean up
andrewbranch f957bd4
Clean up
andrewbranch 8f0ad77
Close auto import provider on disableLanguageService
andrewbranch f7b6946
Move AutoImportProvider preload to project updateGraph
andrewbranch e9557ff
Clear auto import suggestion cache when provider program changes
andrewbranch bd15ac4
Merge branch 'master' into experiment/auto-import/program-per-package…
andrewbranch 3f1821e
Fix tests
andrewbranch b2d8e34
Revert yet-unneeded change
andrewbranch 4a667e3
Use projectService host for module resolution host
andrewbranch 3ed641d
Don’t re-resolve type directives if nothing has changed
andrewbranch 7b1aaf4
Update src/server/project.ts
andrewbranch 85c6938
Use ts.emptyArray
andrewbranch 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
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.
You dont need to pass moduleResolutionHost here but instead you want this to also handle trace (if logging enabled going to log) and currentDIrectory
ModuleResolutionHost = hostProject.projectService ?
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 I understand the suggestion—
ProjectService
isn’t assignable toModuleResolutionHost
.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.
Merging for the beta, feel free to follow up with me
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.
You want it to be {
boundMethods from hostProject.projectService.host
getCurrentDirectory : () => hostProject.getCurrentDirectory(),
trace: mayBeBind(hostProject, hostProject.trace)
}
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.
Is there a realistic example of why
hostProject
itself wouldn’t work? If it wants to mimic the existence of some files, why shouldn’t it be allowed to do that during type directive resolution?