Skip to content
CAI
Software that uses CAICheck a score

castwide/solargraph

63.2

Adequate · 19 September 2026

23.7k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Solargraph is a Ruby language server that provides IDE integration features such as code completion, hover information, and diagnostics. It analyzes source code using a Prism-based parser and RBS type definitions to infer types and resolve symbols across workspaces. The system supports modern Ruby patterns, integrates with RuboCop for linting, and communicates with editors via the Language Server Protocol.

How it got here

2017–2018 — LSP implementation and core refactoring

40 changes.

This period focused on implementing a full Language Server Protocol (LSP) to enable IDE integration, including asynchronous diagnosis and modular message handling. The codebase underwent a major internal restructuring, introducing a new pin architecture, refined type inference engine, and comprehensive caching systems to improve performance and accuracy. These changes were supported by extensive test coverage and the adoption of modern dependencies like Prism and Kramdown.

2019–2021 — Parser rewrite and RBS integration

17 changes.

Solargraph replaced its legacy RubyVM parser with a new subsystem featuring flow-sensitive typing and a standardized node processing architecture. The project simultaneously integrated RBS declarations to improve type accuracy for Ruby's core and standard library, while adding dedicated conventions for modern Ruby patterns like Data and Structs. Extensive test coverage was added across the new parser, YARD map refactoring, and RBS mapping components to ensure stability.

2025 — Parser modernization and RBS expansion

5 changes.

The project modernized its core parsing infrastructure by switching to the Prism-based parser gem, enabling support for modern Ruby syntax and improved type inference. Concurrently, it expanded static analysis capabilities by adding comprehensive RBS type definitions for standard library modules and third-party dependencies, while enhancing support for Ruby Structs and related conventions.

Features

Add internal HTML documentation and environment pages

Solargraph now includes built-in ERB templates to render HTML views for method documentation, namespace overviews, search results, and environment diagnostics. Users can access these pages via the server's document and search endpoints, which display structured information such as parameters, return types, and visibility for methods, or list class and instance methods for namespaces. The environment page provides diagnostic details including the Ruby version, RuboCop version, and project configuration.

lib/solargraph/views · high confidence

Added RBS type definitions for Bundler, Open3, RubyGems, and third-party gems

This release adds comprehensive RBS type signatures to improve static analysis and IDE support. New type definitions are provided for standard library modules including Bundler, Open3, and RubyGems (covering BasicSpecification, Dependency, Errors, SpecFetcher, and Specification). Additionally, type shims have been added for third-party dependencies used by the parser, including AST, diff-lcs, Thor, and the Parser gem itself, ensuring consistent type checking across the project's external dependencies.

rbs · high confidence

Implementation of workspace-level LSP message handlers

Solargraph now handles key workspace-level Language Server Protocol messages, enabling dynamic capability registration and better file/folder management. Configuration changes (workspace/didChangeConfiguration) now trigger dynamic registration or unregistration of server capabilities (such as completion, hover, formatting, and symbol queries) based on the user's settings. File system changes (workspace/didChangeWatchedFiles) are processed to update the host's catalog, ensuring that newly created, modified, or deleted files are correctly reflected in the language server's index. Workspace folder changes (workspace/didChangeWorkspaceFolders) are handled to add or remove folders from the host's scope. Additionally, the workspace/symbol query now returns results with full location information (URI and range) and deprecation status, improving the accuracy of symbol search results for clients.

_lib/solargraph/language\server/message/workspace · high confidence

Initial language server protocol implementation

Solargraph now includes a functional Language Server Protocol (LSP) implementation, enabling IDE integration for features such as completions, diagnostics, hover information, and document symbols. The change introduces the core \Host\ class to manage workspace state and message processing, a \Message\ registry to handle LSP method routing, and supporting modules for URI handling, progress notifications, and protocol constants.

_lib/solargraph/language\server · high confidence

Introduction of specific reference pin types for Ruby language constructs

Solargraph now includes dedicated pin classes to represent specific Ruby language references, including Extend, Include, Prepend, Require, Superclass, TypeAlias, and Override. These new pin types allow the library to model structural relationships and type overrides more precisely, with the Override pin specifically supporting tag retention and deletion logic to refine how method signatures are handled during analysis.

lib/solargraph/pin/reference · high confidence

New YARD macro support and YardMap caching infrastructure

Solargraph now supports YARD macros (e.g., @!method) for DSL methods, allowing dynamic method signatures defined in comments to be recognized by the language server. This is enabled by a new macro processing system in lib/solargraph/yard\_map/macro.rb and directive handlers. Additionally, a new caching layer (lib/solargraph/yard\_map/cache.rb) has been introduced to store and retrieve YARD pins by path, improving performance. The mapper also includes a fix for a YARD bug involving open singleton classes to prevent incorrect pin overrides.

_lib/solargraph/yard\map · high confidence

New conventions for Ruby 3.4+ Data, Structs, and build files

Solargraph now includes dedicated convention plugins to better understand modern Ruby patterns and build files. It adds support for Ruby 3.4's \Data.define\ and standard \Struct\ definitions, correctly generating class, method, and attribute pins for these immutable value objects. Additionally, it introduces conventions for \Gemfile\, \Gemspec\, and \Rakefile\ to provide appropriate type context (e.g., \Bundler\, \Rake::DSL\) when analyzing these specific files.

lib/solargraph/convention · high confidence

New diagnostics framework with RuboCop, type checking, and require resolution

Solargraph introduces a new diagnostics reporting system that provides linting via RuboCop, type checking for undefined return types and invalid parameters, and detection of unresolved requires or missing YARD documentation. Users will now see syntax errors, RuboCop offenses, and type issues reported directly in their editor with severity levels mapped to the Language Server Protocol.

lib/solargraph/diagnostics · high confidence

New extended LSP methods for gem version checking, documentation, and environment info

Solargraph now supports several new custom LSP methods under the $/solargraph/ namespace. The $/solargraph/checkGemVersion method allows the server to check for and optionally update the Solargraph gem version, supporting both direct gem updates and Bundler-based updates. The $/solargraph/documentGems method enables updating YARD documentation for installed gems, with an option to rebuild existing documentation. The $/solargraph/environment method provides environment information including RuboCop version and workspace folder details. Additionally, $/solargraph/document and $/solargraph/search methods now render HTML pages for documentation and search results respectively, while $/solargraph/downloadCore has been deprecated in favor of RBS-based documentation.

_lib/solargraph/language\server/message/extended · high confidence

Architecture

Refactor YARD map mappers into dedicated modules

The YARD map mapper logic has been reorganized from monolithic classes into three distinct modules: ToConstant, ToMethod, and ToNamespace. This change extracts the creation of Constant, Method (including MethodAlias), and Namespace pins into separate, focused components. For users, this represents an internal architectural improvement that likely enhances maintainability and type-checking stability without altering the external API or the resulting pin data produced by Solargraph.

_lib/solargraph/yard\map/mapper · high confidence

Refactored LSP message handling into a modular class structure

The language server's message handling has been reorganized from a monolithic structure into a modular system of dedicated classes under \lib/solargraph/language\_server/message\. A new \Base\ class centralizes request parsing, response formatting, and cancellation logic, while specific LSP methods (such as \initialize\, \completion\, \hover\, and \shutdown\) are now handled by their own distinct classes. This change improves code maintainability and clarity for the server's internal protocol implementation.

_lib/solargraph/language\server/message · high confidence

Behavioural changes

Asynchronous diagnosis and threaded message handling

Solargraph now runs diagnostics asynchronously via a dedicated background thread (Host::Diagnoser) that processes a queue of file URIs, improving responsiveness by preventing blocking during analysis. Incoming LSP messages are now handled by a serial worker thread (Host::MessageWorker) that prioritizes document updates and cancellation requests, ensuring that state-changing operations are processed in order and stale requests can be cancelled. The Host::Sources class manages open file states and notifies observers of changes, while Host::Dispatch handles associating sources with libraries and triggering the new asynchronous diagnosis workflow.

_lib/solargraph/language\server/host · high confidence

Completion item resolution now merges documentation from multiple pins

The completionItem/resolve handler has been refactored to aggregate documentation from multiple pins rather than relying on a single source. When resolving a completion item, the system now combines documentation strings from all relevant pins, deduplicates links (respecting the enablePages option), and formats the final content as Markdown. This results in richer, more comprehensive documentation for completion items in the editor.

_lib/solargraph/language\_server/message/completion\item · high confidence

Improved type inference for method chains and local variables

Solargraph now infers return types for method chains from variables and resolves variable return types from assignments. This allows the language server to provide more accurate type information and completion suggestions when working with chained method calls and local variable assignments.

lib/solargraph · high confidence

Introduce new source analysis components: Chain, Cursor, Change, and Updater

Solargraph introduces a new internal architecture for source code analysis, replacing older fragment and call-chainer mechanisms with a more robust system. The new \Source::Chain\ class represents expressions as call chains, enabling more accurate type inference and completion. \Source::Cursor\ provides precise position and word context for code navigation. \Source::Change\ and \Source::Updater\ handle text modifications and synchronization, including repair logic for incomplete syntax. \SourceChainer\ orchestrates the creation of chains from source positions. These components work together to improve the reliability of type checking, completion, and definition lookup in the presence of unsynchronized or repaired source code.

lib/solargraph/source · high confidence

Introduces structured transport layer with JSON-RPC data parsing

Solargraph now includes a dedicated transport layer consisting of an Adapter and a DataReader. The Adapter manages the lifecycle of the language server host and delegates incoming data to the DataReader, which handles the parsing of raw JSON-RPC messages from the client stream. This change replaces previous ad-hoc handling with a structured approach that buffers data, parses JSON payloads, and routes them to the host for processing, while also logging parse errors.

_lib/solargraph/language\server/transport · high confidence

Introduction of base NodeProcessor class for AST parsing

A new base class, Solargraph::Parser::NodeProcessor::Base, has been added to the parser infrastructure. This class provides a standardized foundation for processing Ruby AST nodes, managing context such as source regions, existing pins, and local variables. It introduces methods for traversing child nodes and locating specific pin types (such as breakables, compound statements, and closures) within the current scope, enabling more consistent and maintainable node processing logic across the parser.

_lib/solargraph/parser/node\processor · high confidence

Major library restructuring and expanded API surface

The Solargraph library has undergone a significant internal restructuring, replacing the previous minimal entry point with a comprehensive module that explicitly defines numerous custom error classes (such as InvalidOffsetError, DiagnosticsError, and WorkspaceTooLargeError) and registers a wide array of autoloads for new or refactored components including RbsMap, PinCache, RbsTranslator, and TypeChecker. This change introduces new capabilities for RBS integration, improved logging via a dedicated Logging module, and robust environment handling through a compatibility wrapper for Bundler's environment methods, while also enforcing UTF-8 encoding by default to ensure consistent source parsing.

lib · high confidence

New SourceMap implementation with Clip-based completion and Mapper directive processing

Solargraph introduces a new internal SourceMap architecture that replaces the previous fragment-based system with a Cursor-driven 'Clip' model for static analysis. This change improves how the engine handles code completion, type inference, and local variable scoping by analyzing the cursor's position relative to its closure and local context. Additionally, the new Mapper component provides more robust processing of YARD comment directives (such as @!method and @!parse), ensuring that documentation tags are correctly mapped to code pins and that complex comment structures are parsed accurately.

_lib/solargraph/source\map · high confidence

New parser subsystem with flow-sensitive typing and comment ripper

Solargraph introduces a new parser implementation in lib/solargraph/parser that replaces the legacy RubyVM parser. This new system includes a CommentRipper for extracting comments, a Region class for tracking source context, and a NodeProcessor for generating pins. A key feature is FlowSensitiveTyping, which automatically refines variable types based on control flow (such as \is\_a?\ checks, \nil?\ checks, and \if\/\while\ conditions), providing more accurate type information for users.

lib/solargraph/parser · high confidence

New parser-gem node processors for AST handling

The parser-gem node processors have been rewritten to use the \parser\ gem's AST node types directly, replacing the previous internal node handling. This change introduces dedicated processors for various Ruby syntax elements, including method definitions (\def\/\defs\), control flow (\if\, \while\, \until\, \resbody\), variable assignments (local, instance, class, global, and mass assignments), and module/class structures (\namespace\, \sclass\). It also adds support for inline RBS superclass parameters, flow-sensitive typing for logical operators (\and\/\or\), and improved handling of method visibility and attribute generation.

_lib/solargraph/parser/parser\_gem/node\processors · high confidence

New workspace configuration and dependency resolution architecture

Solargraph introduces a new configuration system and workspace architecture to improve how it indexes and resolves code. The new \Config\ class centralizes workspace settings, allowing users to customize file inclusion/exclusion patterns, define additional require paths, and configure type-checking rules via \.solargraph.yml\. A new \RequirePaths\ class automatically extracts load paths from gemspec files, ensuring that library code is correctly indexed. Additionally, the \Gemspecs\ class provides more robust resolution of gem dependencies, fixing crashes when no Gemfile is present and better handling of Bundler specifications. These changes result in more accurate code completion and diagnostics, especially in complex projects with multiple gems or custom load paths.

lib/solargraph/workspace · high confidence

RBS-based type mapping for Ruby core and stdlib

Solargraph now uses RBS declarations to generate type information for Ruby's core classes and standard library. This change introduces a new conversion engine (lib/solargraph/rbs\_map/conversions.rb) that translates RBS types into Solargraph pins, along with dedicated mappers for core (lib/solargraph/rbs\_map/core\_map.rb) and stdlib (lib/solargraph/rbs\_map/stdlib\_map.rb) types. To ensure complete coverage, core\_fills.rb provides specific overrides and missing definitions (such as keywords and Errno classes) that are not fully represented in the RBS data. This results in more accurate type inference and documentation for standard Ruby APIs.

_lib/solargraph/rbs\map · high confidence

Refactored ApiMap internals with new caching and indexing components

The ApiMap subsystem has been restructured to improve performance and maintainability. A new ApiMap::Cache class has been introduced to store and retrieve method, constant, and namespace lookups, reducing redundant processing. The ApiMap::Index class now centralizes pin cataloging, managing hashes for namespaces, paths, and class-based lookups, as well as handling reference mapping (includes, extends, prepends, superclasses) and override application. Additionally, the ApiMap::Store class has been updated to manage multiple pinsets (core, gem, convention, workspace, and open files) with incremental updates, and the ApiMap::Constants class provides dedicated logic for resolving and qualifying constant names. The ApiMap::SourceToYard module has been refactored to generate YARD code objects directly from the store's pins, ensuring consistent documentation generation.

_lib/solargraph/api\map · high confidence

Refactored pin architecture with new base classes and flow-sensitive typing support

The pin system has been restructured to improve type inference and code organization. A new \Pin::Base\ class introduces a \combine\_priority\ attribute to control how pins from different sources (code, YARD, RBS) are merged, allowing higher-priority definitions to override others. \Pin::BaseVariable\ now supports mass assignments and intersection/exclusion types for more precise return type calculations. \Pin::Block\ includes logic to destructure yield types and rebind contexts based on receiver types. \Pin::Callable\ consolidates parameter and signature handling, while \Pin::DelegatedMethod\ enables dynamic method aliasing by resolving receiver chains at runtime. The \Pin::Documenting\ module now uses Kramdown and ReverseMarkdown for consistent Markdown conversion, and \Pin::CompoundStatement\ provides infrastructure for flow-sensitive typing by tracking statement execution sequences.

lib/solargraph/pin · high confidence

Refactored text document message handlers into a modular structure

The text document message handlers have been reorganized into individual classes within the \lib/solargraph/language\_server/message/text\_document\ directory, each inheriting from a new \Base\ class that standardizes URI-to-filename conversion. This change introduces dedicated implementations for LSP features including completion (with improved text edit formatting and cancellation handling), definition and type definition lookups, hover (now supporting markdown detail and documentation links), document symbols, folding ranges, and RuboCop-based formatting (which now runs in a synchronized thread to prevent conflicts). It also adds handlers for document highlights, on-type formatting (currently disabled), prepare-rename, rename, references, and document lifecycle events (open, change, save, close).

_lib/solargraph/language\_server/message/text\document · high confidence

The type inference system in \lib/solargraph/source/chain\ has been restructured into a modular set of link classes to improve how Solargraph resolves types for method calls, variables, and literals. New classes such as \Chain::Call\, \Chain::Constant\, \Chain::Variable\, and \Chain::Literal\ now handle specific resolution logic, replacing previous inline implementations. This change introduces more precise type inference for method overloads, local variables, and constants, while also adding support for safe navigation operators (\QCall\) and block variables (\BlockVariable\).

lib/solargraph/source/chain · high confidence

Refactored type system internals for improved strict checking and generics support

The internal type-checking engine has been restructured to support more robust strict type checking, including better handling of generics, mixins, and union types. A new Conformance class now manages type compatibility checks with support for variance (invariant, covariant, contravariant) and specific rules for interface matching and parameter stripping. The UniqueType class has been enhanced to better parse and represent parameterized types (like Hash and Array generics) and literal types, while TypeMethods provides shared functionality for accessing type data. These changes improve the accuracy of type inference and signature selection, particularly for complex generic scenarios and mixin inclusions.

_lib/solargraph/complex\type · high confidence

Renamed main executable and removed deprecated bin scripts

The main command-line entry point has been renamed from 'solargraph-ruby' to 'solargraph', with the script updated to suppress Ruby warning diagnostics. Additionally, several deprecated utility scripts located in the bin directory have been removed: 'resolve-gem.rb', 'resolve-require.rb', 'solargraph-live-parse', 'stub-current.rb', and 'stub-require.rb'.

bin · high confidence

Standardize development environment and CI quality gates

The project now enforces consistent line endings (LF) for Ruby and binary files via .gitattributes and normalizes existing line endings. Development workflows are standardized with new configuration files: .envrc sets the Solargraph version based on the current git branch, .overcommit.yml enables RuboCop and Solargraph checks on pre-commit (excluding specs), and .rubocop.yml sets the target Ruby version to 3.1, enables new cops, and configures specific style and metric thresholds. The Rakefile has been significantly expanded to include dedicated tasks for running the type checker at various strictness levels (typed, strict, strong, alpha), a comprehensive test suite with coverage reporting via Undercover and SimpleCov, and quality checks using Overcommit.

(repo-wide) · high confidence

Support for HTML definition lists and inline code in Markdown conversion

Solargraph now correctly converts HTML definition lists (\<dl\>, \<dt\>, \<dd\>) and inline code (\<tt\>) back into Markdown format. New converters handle the specific formatting requirements for definition terms, descriptions, and the list container, while the \<tt\> tag is mapped to the existing code converter to ensure consistent inline code representation.

lib/solargraph/converters · high confidence

Support for inline and inheritance-based Ruby Struct definitions

Solargraph now recognizes Ruby Structs defined via both class inheritance (e.g., \class MyStruct \< Struct.new(...)\) and constant assignment (e.g., \MyStruct = Struct.new(...)\). This change enables accurate type checking and completion for attributes and methods defined within these struct patterns, ensuring that inline struct definitions are properly analyzed.

_lib/solargraph/convention/struct\definition · high confidence

Switch to Prism-based parsing for improved Ruby syntax support

The parser gem integration now uses Prism (via \Prism::Translation::Parser\) instead of the legacy RubyVM parser, enabling better handling of modern Ruby syntax including Data.define, Structs, and flow-sensitive typing. This change introduces a new \FlawedBuilder\ to ignore encoding issues in literal strings, adds support for mass assignment (\a, b = \[...\]\), and improves type inference for reader methods using \\|\|=\. Users benefit from more accurate type checking, support for newer Ruby features, and fewer syntax errors during parsing.

_lib/solargraph/parser/parser\gem · high confidence

Test coverage

Added RDoc fixture for testing documentation conversion; Added comprehensive test coverage for Solargraph Pin classes; Added parser test coverage for flow-sensitive typing, node chaining, and node processing; Added test coverage for ApiMap components; Added test coverage for RBS map conversions, core, and stdlib handling; Added test coverage for SourceMap components; Added test coverage for diagnostics subsystem; Added test coverage for language server text document operations; Added test coverage for source analysis components; Added test coverage for the language server host, protocol, and URI utilities; Added test coverage for type checker strictness levels; Added test coverage for workspace configuration and gemspec resolution; Added test fixture for RuboCop unused variable error; Added test fixtures for YARD map edge cases; Added test fixtures for edge-case parsing scenarios; Added test fixtures for workspace folders; Added tests for ActiveSupport::Concern, Gemfile, and Struct conventions; Added tests for CheckGemVersion message handling; Added tests for Language Server initialization capabilities; Added tests for YARD map mapping logic; Added tests for YARD method parameter mapping; Added tests for completion item resolve behavior; Added tests for language server host components; Added tests for language server transport adapter and data reader; Added tests for type checker rule configurations; Added tests for workspace configuration and file watching handlers; Added unit tests for Source::Chain components; Expanded test coverage for Solargraph core components.

Dependencies

Solargraph gemspec updated for Ruby 3.1+ and modern dependencies

The Solargraph gemspec has been significantly updated to require Ruby 3.1 or higher and replaced legacy dependencies with modern equivalents. Key changes include switching the Markdown parser from Maruku to Kramdown (with GFM support), adopting the Prism parser instead of the older Parser gem, and updating RuboCop to version 1.76+. The gem now includes metadata for funding and bug tracking, and adds development dependencies for testing and CI stability, such as specific RuboCop plugins and SimpleCov.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 63.

Lenses

  • Code Health 87
  • Architecture 97
  • Maturity 59
  • Readiness 62
  • Security 68
  • Accessibility 65

Changes since last survey

  • 300 commits — 242 feature/other, 58 fixes

By area

  • lib/solargraph — 209 commits
  • (root) — 54 commits
  • .github/workflows — 12 commits
  • (repo) — 7 commits
  • spec/language_server — 4 commits
  • spec/convention — 2 commits
  • spec/pin — 2 commits
  • spec/source_map — 2 commits
  • lib/solargraph.rb — 1 commit
  • rbs/shims — 1 commit
  • spec/complex_type_spec.rb — 1 commit
  • spec/doc_map_spec.rb — 1 commit
  • spec/rbs_map — 1 commit
  • spec/type_checker — 1 commit
  • spec/workspace_spec.rb — 1 commit
  • spec/yard_map — 1 commit

Notable commits

  • fix: Add @sg-ignore tags to backlog future :strict typechecking fixes (#919)
  • fix: Add more regression tests (#908)
  • fix: Annotation fixes for strong typechecking (#1057)
  • fix: Fix 'all!' config to reporters (#1018)
  • fix: Fix 'solargraph pin --references ClassName' private method call (#1150)
  • fix: Fix @yieldparam type lost on multi-overload block-form methods (#1289) (#1290)
  • fix: Fix Chain#nullable? leaking nil from earlier &. into later calls (#1271)
  • fix: Fix Convention/Plugin pins not being updated on file change (#1028)
  • fix: Fix DocMap.all_rbs_collection_gems_in_memory return type (#1037)
  • fix: Fix Gemspecs#in_this_bundle? crash when no Gemfile is discoverable (#1225)
  • fix: Fix RuboCop linting errors in regular expressions (#1038)
  • fix: Fix a self-type-related false-positive in strict typechecking (#834)
  • fix: Fix array ordering failure
  • fix: Fix bad sexpr generation in op_asgn (#1089)
  • fix: Fix convention requires (#1008)
  • fix: Fix crash while generating activesupport pins (#1043)
  • fix: Fix duck_types_match? to check the inferred type's own duck interface (#1295)
  • fix: Fix exponential blowup in Pin::Method#combine_same_type_arity_signatures (#1238)
  • fix: Fix flakey spec (#1080)
  • fix: Fix flaky rename specs (#869)
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

castwide/solargraph was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 6dcb73338b372b25935406656e696c3ec1179e23 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.