Serve RBS stdlib pins before the gem cache builds - #1340
Closed
apiology wants to merge 1 commit into
Closed
Conversation
Until `solargraph gems` has run for a workspace, a gem with no combined pin cache entry contributes no pins at all, so completion and typechecking see none of its API until a build finishes. For the 15 of 82 gems in this bundle whose types come from the RBS standard library, 1,305 pins can be served immediately instead. Adds RbsMap#fallback_pins, returning nil on the base class because a combined cache entry merges RBS pins with separately-cached YARD pins, and dropping the YARD half is not safe in general. StdlibMap overrides it to return its own pins, which need no such merge, and DocMap#deserialize_combined_pin_cache consults it in the branch that previously returned nil. The fallback is deliberately not written to combined_pins_in_memory: that index is process-wide and keyed only by gem name and version, so a provisional set stored there would go on being served after the real build supersedes it. The gemspec also stays on the uncached lists, so `solargraph gems` still builds it.
Contributor
Author
|
Claude: Reopening this in apiology/solargraph#98. |
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: Until
solargraph gemshas run for a workspace, a gem with no combined pin cache entry contributes no pins at all, so completion and typechecking see none of its API — even where RBS already ships the types.On this machine that is 15 of 82 bundled gems, 1,305 pins, withheld until a build finishes.
Solution: Adds
RbsMap#fallback_pins— nil on the base class, since a combined entry merges RBS pins with separately-cached YARD pins and dropping the YARD half is not safe in general, withRbsMap::StdlibMapoverriding it to return its own pins, which need no merge — and serves it fromDocMap#deserialize_combined_pin_cachewhere that previously returned nil, without caching it in the process-wide index or marking the gem built.🤖 Generated with Claude Code