-
Couldn't load subscription status.
- Fork 187
Cache source packages when reference/revision is available #367
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
Conversation
Codecov Report
@@ Coverage Diff @@ ## master #367 +/- ## ============================================ + Coverage 84.33% 86.95% +2.61% - Complexity 834 835 +1 ============================================ Files 59 59 Lines 1724 1732 +8 ============================================ + Hits 1454 1506 +52 + Misses 270 226 -44
|
Regarding testing for this change, I'm still wrapping my head around the code. I think it can be accomplished by including a composer.json and composer.lock within fixtures to mock a faux install. I'm going to look into this further.
src/Indexer.php
Outdated
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.
package name is checked in both conditions
src/Indexer.php
Outdated
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.
space between else if
LGTM overall.
Testing with a fake composer.json and composer.lock sounds like a good approach. Ideally this would be a unit test for the Indexer that asserts a stubbed Cache is called
I've made changes based off your feedback, and modified tests for the two current package caching strategies.
I think this is ready for another review.
Could you do the tests as a unit test for the Indexer?
54831bc to
ee5a7d7
Compare
I'd be willing to give it a shot.
umpirsky
commented
Jul 6, 2017
Any updates on this?
Uh oh!
There was an error while loading. Please reload this page.
Fixes #366
For projects that use specific revisions for packages (e.g. if a bug fix has not made it to a tagged release yet), the PHP language server would reparse the package's files every time the server started, even if the package had not changed. This change introduces caching support for packages that are checked out from source, by using the revision as part of the cache key.