solargraph
Advanced tools
+6
-1
@@ -0,3 +1,8 @@ | ||
| ## 0.56.1 - July 13, 2025 | ||
| - Library avoids blocking on pending yardoc caches (#990) | ||
| - DocMap checks for default Gemfile (#989) | ||
| - [Bug fix] Fixed an error in rbs/fills/tuple.rbs (#993) | ||
| ## 0.56.0 - July 1, 2025 | ||
| - [regression] Gem caching perf and logging fixes #983 | ||
| - [regression] Gem caching perf and logging fixes #983 | ||
@@ -4,0 +9,0 @@ ## 0.55.5 - July 1, 2025 |
@@ -24,4 +24,5 @@ # frozen_string_literal: true | ||
| def uncached_gemspecs | ||
| (uncached_yard_gemspecs + uncached_rbs_collection_gemspecs).sort. | ||
| uniq { |gemspec| "#{gemspec.name}:#{gemspec.version}" } | ||
| uncached_yard_gemspecs.concat(uncached_rbs_collection_gemspecs) | ||
| .sort | ||
| .uniq { |gemspec| "#{gemspec.name}:#{gemspec.version}" } | ||
| end | ||
@@ -359,3 +360,6 @@ | ||
| def gemspecs_required_from_bundler | ||
| if workspace&.directory && Bundler.definition&.lockfile&.to_s&.start_with?(workspace.directory) | ||
| # @todo Handle projects with custom Bundler/Gemfile setups | ||
| return unless workspace.gemfile? | ||
| if workspace.gemfile? && Bundler.definition&.lockfile&.to_s&.start_with?(workspace.directory) | ||
| # Find only the gems bundler is now using | ||
@@ -401,4 +405,3 @@ Bundler.definition.locked_gems.specs.flat_map do |lazy_spec| | ||
| else | ||
| Solargraph.logger.warn e | ||
| raise BundleNotFoundError, "Failed to load gems from bundle at #{workspace&.directory}" | ||
| Solargraph.logger.warn "Failed to load gems from bundle at #{workspace&.directory}: #{e}" | ||
| end | ||
@@ -405,0 +408,0 @@ end |
@@ -591,25 +591,49 @@ # frozen_string_literal: true | ||
| return if @cache_progress | ||
| spec = (api_map.uncached_yard_gemspecs + api_map.uncached_rbs_collection_gemspecs). | ||
| find { |spec| !cache_errors.include?(spec) } | ||
| spec = cacheable_specs.first | ||
| return end_cache_progress unless spec | ||
| pending = api_map.uncached_gemspecs.length - cache_errors.length - 1 | ||
| logger.info "Caching #{spec.name} #{spec.version}" | ||
| Thread.new do | ||
| cache_pid = Process.spawn(workspace.command_path, 'cache', spec.name, spec.version.to_s) | ||
| report_cache_progress spec.name, pending | ||
| Process.wait(cache_pid) | ||
| logger.info "Cached #{spec.name} #{spec.version}" | ||
| rescue Errno::EINVAL => _e | ||
| logger.info "Cached #{spec.name} #{spec.version} with EINVAL" | ||
| rescue StandardError => e | ||
| cache_errors.add spec | ||
| Solargraph.logger.warn "Error caching gemspec #{spec.name} #{spec.version}: [#{e.class}] #{e.message}" | ||
| ensure | ||
| end_cache_progress | ||
| if Yardoc.processing?(spec) | ||
| logger.info "Enqueuing cache of #{spec.name} #{spec.version} (already being processed)" | ||
| queued_gemspec_cache.push(spec) | ||
| return if pending - queued_gemspec_cache.length < 1 | ||
| catalog | ||
| sync_catalog | ||
| else | ||
| logger.info "Caching #{spec.name} #{spec.version}" | ||
| Thread.new do | ||
| cache_pid = Process.spawn(workspace.command_path, 'cache', spec.name, spec.version.to_s) | ||
| report_cache_progress spec.name, pending | ||
| Process.wait(cache_pid) | ||
| logger.info "Cached #{spec.name} #{spec.version}" | ||
| rescue Errno::EINVAL => _e | ||
| logger.info "Cached #{spec.name} #{spec.version} with EINVAL" | ||
| rescue StandardError => e | ||
| cache_errors.add spec | ||
| Solargraph.logger.warn "Error caching gemspec #{spec.name} #{spec.version}: [#{e.class}] #{e.message}" | ||
| ensure | ||
| end_cache_progress | ||
| catalog | ||
| sync_catalog | ||
| end | ||
| end | ||
| end | ||
| def cacheable_specs | ||
| cacheable = api_map.uncached_yard_gemspecs + | ||
| api_map.uncached_rbs_collection_gemspecs - | ||
| queued_gemspec_cache - | ||
| cache_errors.to_a | ||
| return cacheable unless cacheable.empty? | ||
| queued_gemspec_cache | ||
| end | ||
| def queued_gemspec_cache | ||
| @queued_gemspec_cache ||= [] | ||
| end | ||
| # @param gem_name [String] | ||
@@ -616,0 +640,0 @@ # @param pending [Integer] |
| # frozen_string_literal: true | ||
| module Solargraph | ||
| VERSION = '0.56.0' | ||
| VERSION = '0.56.1' | ||
| end |
@@ -158,2 +158,10 @@ # frozen_string_literal: true | ||
| # True if the workspace has a root Gemfile. | ||
| # | ||
| # @todo Handle projects with custom Bundler/Gemfile setups (see DocMap#gemspecs_required_from_bundler) | ||
| # | ||
| def gemfile? | ||
| directory && File.file?(File.join(directory, 'Gemfile')) | ||
| end | ||
| private | ||
@@ -160,0 +168,0 @@ |
@@ -33,2 +33,4 @@ # frozen_string_literal: true | ||
| # True if another process is currently building the yardoc cache. | ||
| # | ||
| def processing?(gemspec) | ||
@@ -35,0 +37,0 @@ yardoc = File.join(PinCache.yardoc_path(gemspec), 'processing') |
@@ -38,3 +38,3 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' | ||
| s.add_runtime_dependency 'prism', '~> 1.4' | ||
| s.add_runtime_dependency 'rbs', '~> 3.3' | ||
| s.add_runtime_dependency 'rbs', '~> 3.6.1' | ||
| s.add_runtime_dependency 'reverse_markdown', '~> 3.0' | ||
@@ -41,0 +41,0 @@ s.add_runtime_dependency 'rubocop', '~> 1.38' |