Repository navigation
Conversation
The gem cache directory was process-global, keyed on every plugin gem loaded so far, so loading one workspace with plugin gems switched the directory for every other workspace in the process. CacheDir is now a class. Each Workspace owns an instance, created at init and filled by Config#require_plugins, which adds each plugin gem it loads; Convention.add_plugin_conventions then adds the registered conventions those plugin gems define. External, Collection::Gem, ApiMap.load_with_cache, Shell cache/uncache and the Library cache subprocess use the CacheDir of the workspace they serve. Path helpers that do not depend on plugins stay class methods. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEntZKsZwQHhzqcwG7MTqn
CacheDir#add_plugin already records each plugin gem name and version, so walking its conventions added nothing to the gem directory key. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEntZKsZwQHhzqcwG7MTqn
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEntZKsZwQHhzqcwG7MTqn
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.
Claude: This PR was written by Claude Code on behalf of @apiology.
Alternative to #260; same behavior, different design.
Problem
A workspace with plugins moves every other workspace to its gem cache:
In one language server, the plain workspace finds none of its cached gems and rebuilds them into the plugin directory, which castwide/solargraph#1407 introduced.
Solution
CacheDir becomes a class, and each Workspace owns an instance (
Workspace#cache_dir) thatConfig#require_pluginsfills with the plugin gems it loads, so the key lives in that object and Collection::Gem, External, ApiMap, the cache/uncache commands and the cache subprocess's--plugins=take it from the workspace they serve.Convention.registerno longer touches the key, because it runs once per process;Convention.add_plugin_conventions(cache_dir, plugin_gems)instead adds the registered conventions defined by that workspace's plugin gems.A plugin loaded by plain
requireinto a workspace without config is no longer part of any key; it reads and writes the plaingemsdirectory.