Project

General

Profile

Actions

Feature #64

open
FS DD

Doc maps for gems installed by path or git

Feature #64: Doc maps for gems installed by path or git

Added by Fred Snyder about 10 hours ago. Updated about 5 hours ago.

Status:
In Progress
Priority:
Normal
Assignee:
Start date:
08/19/2026
Due date:
% Done:

0%

Estimated time:

Description

Solargraph only caches maps for system gems, e.g., gems that were installed via RubyGems from Bundler or the gem install command. Add mapping for gems that are installed by git or path.

Caching those maps might be a little tricky. The cache for a gem installed by its path could become stale if its code changes. The only realistic option might be to generate the maps every time the server starts.

DD Updated by Dexter Deezen about 9 hours ago Actions #1

  • Assignee set to Dexter Deezen

DD Updated by Dexter Deezen about 5 hours ago Actions #2

  • Status changed from New to In Progress

DD Updated by Dexter Deezen about 5 hours ago Actions #3

I've begun investigating this issue. After reviewing the Solargraph codebase, I found that:

  1. Current Behavior: The DocMap class handles gem mapping through the gemspecs method and required_gems_map. The resolve_path_to_gemspecs method uses Gem::Specification.find_by_path to resolve require paths to gem specifications.

  2. Problem: For gems installed by git or path (rather than RubyGems), Gem::Specification.find_by_path may not find them because they're not in the RubyGems specification database.

  3. Proposed Solution: Following the suggestion in the issue, we should generate maps on-the-fly for path/git gems at server startup rather than attempting to cache them. This avoids stale cache issues when the gem code changes.

Implementation approach:

  • Modify DocMap to detect path/git installed gems
  • Generate documentation maps for these gems dynamically at server startup
  • Skip caching for these gems since their source code can change without notice

Technical Note: I encountered an issue with the Gitolite path validation that prevented branch creation and code commits. The path /home/dexter/aigent/workspace/solargraph consistently failed validation despite matching the required format. The code changes would need to be made directly once this is resolved.

The primary files to modify would be:

  • lib/solargraph/doc_map.rb - Add detection and handling for path/git gems
  • Possibly lib/solargraph/workspace.rb - Helper methods for gem installation source detection
Actions

Also available in: PDF Atom