Ensure all dependencies in a multi-root project are cached#641
Open
dmakovec wants to merge 3 commits intofelixfbecker:masterfrom
Open
Ensure all dependencies in a multi-root project are cached#641dmakovec wants to merge 3 commits intofelixfbecker:masterfrom
dmakovec wants to merge 3 commits intofelixfbecker:masterfrom
Conversation
…e that all package dependencies are indexed and cached
Codecov Report
@@ Coverage Diff @@
## master #641 +/- ##
===========================================
- Coverage 81.52% 81.5% -0.02%
+ Complexity 912 884 -28
===========================================
Files 62 44 -18
Lines 2078 2001 -77
===========================================
- Hits 1694 1631 -63
+ Misses 384 370 -14
|
| } | ||
| $this->composerLock = $composerLock; | ||
| $this->composerLock->packages = $packages; | ||
| $this->composerLock->{'packages-dev'} = $packagesDev; |
Owner
There was a problem hiding this comment.
Hmm, are you sure aggregating all packages work? What if the same package appears with different versions, and then the cache key that is used for the index is not actually the package version that was indexed?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I've had issues with a multi-root project where CPU runs through the roof every time https://github.com/felixfbecker/vscode-php-intellisense is opened.
The reason for this was LanguageServer.php was arbitrarily choosing the first composer.lock that it came across within rootPath, then indexing and caching dependencies from it alone. Consequently, whenever VSCode restarts, php-language-server re-indexes all of the vendor packages in sub-folders that weren't associated with the selected composer.json/lock file.
My quick patch here simply iterates over all composer.lock files within the multi-root project, indexes then caches to disk every single dependency it uncovers. The result of this being that subsequent startup times are much faster and CPU no longer tanks.
This is my simple solution which I believe partially solves what #509 is attempting to address. Possibly related to #465