solargraph 0.56.0 → 0.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f8c351394fab745041193e5d33cd582f0131e6d0f2d30f210767bd273376f24
4
- data.tar.gz: 9d7a3c46740bd9fa040190d00f0e17cab638bde681da5998337dd41e6a924ff6
3
+ metadata.gz: ed69bea4d42d6605dab61eb153507927ac3104946f39eb1ff8380676df9d0cbc
4
+ data.tar.gz: 569b85b0c73b81135d93d814db90ffbb861a0c752515c689edaa60742d0d0f81
5
5
  SHA512:
6
- metadata.gz: 0fefbe369014891f339463c19a198ab0b9c1d918fb70662b496d90f79871e7ab03d3b4e7bf853fee19f7bbd467817690b29e506ca340518156667e986685c92e
7
- data.tar.gz: e92af09e57129e47e6c4b685642460c514bc7c26a015f93c7eb81d917b12717cfac0621181fc36dcc481770ce6b3d93a611f5acd5aee64b1730c8dde4b63b949
6
+ metadata.gz: 84ed3ec4cd5c58a28311964b7f201dc98c2aeaff25e383e96cf9b05a8d90a9a65552b818ee033c5a16a45d4c584069696c90299d5bc831b85985ae14f823718b
7
+ data.tar.gz: e1eb56a9f697e2cc3873ab1e60eec0608cec014d599b3ac40b832c96d3e9a90fdba4a3846127b4dc6c1270cf94344721fe0bf2d79d0db4db57cde999c418f4b2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
+ ## 0.56.1 - July 13, 2025
2
+ - Library avoids blocking on pending yardoc caches (#990)
3
+ - DocMap checks for default Gemfile (#989)
4
+ - [Bug fix] Fixed an error in rbs/fills/tuple.rbs (#993)
5
+
1
6
  ## 0.56.0 - July 1, 2025
2
- - [regression] Gem caching perf and logging fixes #983
7
+ - [regression] Gem caching perf and logging fixes #983
3
8
 
4
9
  ## 0.55.5 - July 1, 2025
5
10
  - Flatten results of DocMap external bundle query (#981)
@@ -21,8 +21,9 @@ module Solargraph
21
21
 
22
22
  # @return [Array<Gem::Specification>]
23
23
  def uncached_gemspecs
24
- (uncached_yard_gemspecs + uncached_rbs_collection_gemspecs).sort.
25
- uniq { |gemspec| "#{gemspec.name}:#{gemspec.version}" }
24
+ uncached_yard_gemspecs.concat(uncached_rbs_collection_gemspecs)
25
+ .sort
26
+ .uniq { |gemspec| "#{gemspec.name}:#{gemspec.version}" }
26
27
  end
27
28
 
28
29
  # @return [Array<Gem::Specification>]
@@ -355,7 +356,10 @@ module Solargraph
355
356
  end
356
357
 
357
358
  def gemspecs_required_from_bundler
358
- if workspace&.directory && Bundler.definition&.lockfile&.to_s&.start_with?(workspace.directory)
359
+ # @todo Handle projects with custom Bundler/Gemfile setups
360
+ return unless workspace.gemfile?
361
+
362
+ if workspace.gemfile? && Bundler.definition&.lockfile&.to_s&.start_with?(workspace.directory)
359
363
  # Find only the gems bundler is now using
360
364
  Bundler.definition.locked_gems.specs.flat_map do |lazy_spec|
361
365
  logger.info "Handling #{lazy_spec.name}:#{lazy_spec.version}"
@@ -396,8 +400,7 @@ module Solargraph
396
400
  next specs
397
401
  end.compact
398
402
  else
399
- Solargraph.logger.warn e
400
- raise BundleNotFoundError, "Failed to load gems from bundle at #{workspace&.directory}"
403
+ Solargraph.logger.warn "Failed to load gems from bundle at #{workspace&.directory}: #{e}"
401
404
  end
402
405
  end
403
406
  end
@@ -588,29 +588,53 @@ module Solargraph
588
588
  # @return [void]
589
589
  def cache_next_gemspec
590
590
  return if @cache_progress
591
- spec = (api_map.uncached_yard_gemspecs + api_map.uncached_rbs_collection_gemspecs).
592
- find { |spec| !cache_errors.include?(spec) }
591
+
592
+ spec = cacheable_specs.first
593
593
  return end_cache_progress unless spec
594
594
 
595
595
  pending = api_map.uncached_gemspecs.length - cache_errors.length - 1
596
- logger.info "Caching #{spec.name} #{spec.version}"
597
- Thread.new do
598
- cache_pid = Process.spawn(workspace.command_path, 'cache', spec.name, spec.version.to_s)
599
- report_cache_progress spec.name, pending
600
- Process.wait(cache_pid)
601
- logger.info "Cached #{spec.name} #{spec.version}"
602
- rescue Errno::EINVAL => _e
603
- logger.info "Cached #{spec.name} #{spec.version} with EINVAL"
604
- rescue StandardError => e
605
- cache_errors.add spec
606
- Solargraph.logger.warn "Error caching gemspec #{spec.name} #{spec.version}: [#{e.class}] #{e.message}"
607
- ensure
608
- end_cache_progress
596
+
597
+ if Yardoc.processing?(spec)
598
+ logger.info "Enqueuing cache of #{spec.name} #{spec.version} (already being processed)"
599
+ queued_gemspec_cache.push(spec)
600
+ return if pending - queued_gemspec_cache.length < 1
601
+
609
602
  catalog
610
603
  sync_catalog
604
+ else
605
+ logger.info "Caching #{spec.name} #{spec.version}"
606
+ Thread.new do
607
+ cache_pid = Process.spawn(workspace.command_path, 'cache', spec.name, spec.version.to_s)
608
+ report_cache_progress spec.name, pending
609
+ Process.wait(cache_pid)
610
+ logger.info "Cached #{spec.name} #{spec.version}"
611
+ rescue Errno::EINVAL => _e
612
+ logger.info "Cached #{spec.name} #{spec.version} with EINVAL"
613
+ rescue StandardError => e
614
+ cache_errors.add spec
615
+ Solargraph.logger.warn "Error caching gemspec #{spec.name} #{spec.version}: [#{e.class}] #{e.message}"
616
+ ensure
617
+ end_cache_progress
618
+ catalog
619
+ sync_catalog
620
+ end
611
621
  end
612
622
  end
613
623
 
624
+ def cacheable_specs
625
+ cacheable = api_map.uncached_yard_gemspecs +
626
+ api_map.uncached_rbs_collection_gemspecs -
627
+ queued_gemspec_cache -
628
+ cache_errors.to_a
629
+ return cacheable unless cacheable.empty?
630
+
631
+ queued_gemspec_cache
632
+ end
633
+
634
+ def queued_gemspec_cache
635
+ @queued_gemspec_cache ||= []
636
+ end
637
+
614
638
  # @param gem_name [String]
615
639
  # @param pending [Integer]
616
640
  # @return [void]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.56.0'
4
+ VERSION = '0.56.1'
5
5
  end
@@ -155,6 +155,14 @@ module Solargraph
155
155
  server['commandPath'] || 'solargraph'
156
156
  end
157
157
 
158
+ # True if the workspace has a root Gemfile.
159
+ #
160
+ # @todo Handle projects with custom Bundler/Gemfile setups (see DocMap#gemspecs_required_from_bundler)
161
+ #
162
+ def gemfile?
163
+ directory && File.file?(File.join(directory, 'Gemfile'))
164
+ end
165
+
158
166
  private
159
167
 
160
168
  # The language server configuration (or an empty hash if the workspace was
@@ -30,6 +30,8 @@ module Solargraph
30
30
  File.exist?(yardoc)
31
31
  end
32
32
 
33
+ # True if another process is currently building the yardoc cache.
34
+ #
33
35
  def processing?(gemspec)
34
36
  yardoc = File.join(PinCache.yardoc_path(gemspec), 'processing')
35
37
  File.exist?(yardoc)
data/solargraph.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
35
35
  s.add_runtime_dependency 'ostruct', '~> 0.6'
36
36
  s.add_runtime_dependency 'parser', '~> 3.0'
37
37
  s.add_runtime_dependency 'prism', '~> 1.4'
38
- s.add_runtime_dependency 'rbs', '~> 3.3'
38
+ s.add_runtime_dependency 'rbs', '~> 3.6.1'
39
39
  s.add_runtime_dependency 'reverse_markdown', '~> 3.0'
40
40
  s.add_runtime_dependency 'rubocop', '~> 1.38'
41
41
  s.add_runtime_dependency 'thor', '~> 1.0'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solargraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.0
4
+ version: 0.56.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-01 00:00:00.000000000 Z
10
+ date: 2025-07-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: backport
@@ -189,14 +189,14 @@ dependencies:
189
189
  requirements:
190
190
  - - "~>"
191
191
  - !ruby/object:Gem::Version
192
- version: '3.3'
192
+ version: 3.6.1
193
193
  type: :runtime
194
194
  prerelease: false
195
195
  version_requirements: !ruby/object:Gem::Requirement
196
196
  requirements:
197
197
  - - "~>"
198
198
  - !ruby/object:Gem::Version
199
- version: '3.3'
199
+ version: 3.6.1
200
200
  - !ruby/object:Gem::Dependency
201
201
  name: reverse_markdown
202
202
  requirement: !ruby/object:Gem::Requirement