Fix crash in solargraph gems core - #1346
Open
apiology wants to merge 2 commits into
Open
Conversation
Shell#gems called PinCache.cache_core, which does not exist, so
`solargraph gems core` died with a NoMethodError before caching
anything. cache_core is defined on RbsMap::CoreMap, so call it there.
PinCache only computes cache paths and serializes, and RbsMap::CoreMap
already depends on it, so delegating from PinCache would make that
dependency circular.
The @sg-ignore above the call claimed cache_core and core? were
dynamically defined. pin_cache.rb has no method_missing or
define_method, and core? exists nowhere, so the comment and the
commented-out `if !PinCache.core?` guard go with it.
The "caches core without erroring out" example sat under `describe
'gems'` but called shell.cache('core'), which takes the gem-lookup
path and never reached this line. It now calls shell.gems('core')
with RbsMap::CoreMap stubbed.
The previous commit rewrote `caches core without erroring out` rather than adding to it, dropping the coverage it gave `uncache core` and `cache core`. Put that example back as it was and keep the new assertion as its own example. Only the new one depends on the fix: reverting the lib change leaves the restored example passing and fails just `caches core pins from the gems command`.
apiology
marked this pull request as ready for review
September 7, 2026 15:33
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.
Problem:
solargraph gems corecrashes instead of caching core pins.cache_coreis an instance method onRbsMap::CoreMap; nothing defines it, orcore?, onPinCache. The@sg-ignoreabove the call asserting that both are dynamically defined is simply wrong, so the marker was suppressing a genuine error rather than a tooling gap.Solution: Call
RbsMap::CoreMap.new.cache_coreand drop the false marker.🤖 Generated with Claude Code