solargraph 0.54.4 → 0.56.2

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.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/plugins.yml +2 -0
  3. data/.github/workflows/typecheck.yml +3 -1
  4. data/.gitignore +2 -0
  5. data/CHANGELOG.md +62 -0
  6. data/README.md +13 -3
  7. data/lib/solargraph/api_map/index.rb +24 -16
  8. data/lib/solargraph/api_map/store.rb +48 -23
  9. data/lib/solargraph/api_map.rb +175 -77
  10. data/lib/solargraph/bench.rb +17 -1
  11. data/lib/solargraph/complex_type/type_methods.rb +6 -1
  12. data/lib/solargraph/complex_type/unique_type.rb +98 -9
  13. data/lib/solargraph/complex_type.rb +35 -6
  14. data/lib/solargraph/convention/base.rb +3 -3
  15. data/lib/solargraph/convention/data_definition/data_assignment_node.rb +60 -0
  16. data/lib/solargraph/convention/data_definition/data_definition_node.rb +89 -0
  17. data/lib/solargraph/convention/data_definition.rb +104 -0
  18. data/lib/solargraph/convention/gemspec.rb +2 -1
  19. data/lib/solargraph/convention/struct_definition/struct_assignment_node.rb +60 -0
  20. data/lib/solargraph/convention/struct_definition/struct_definition_node.rb +100 -0
  21. data/lib/solargraph/convention/struct_definition.rb +141 -0
  22. data/lib/solargraph/convention.rb +5 -3
  23. data/lib/solargraph/doc_map.rb +277 -57
  24. data/lib/solargraph/gem_pins.rb +53 -37
  25. data/lib/solargraph/language_server/host/message_worker.rb +10 -7
  26. data/lib/solargraph/language_server/host.rb +12 -2
  27. data/lib/solargraph/language_server/message/extended/check_gem_version.rb +2 -0
  28. data/lib/solargraph/language_server/message/extended/document.rb +5 -2
  29. data/lib/solargraph/language_server/message/extended/document_gems.rb +3 -3
  30. data/lib/solargraph/library.rb +45 -17
  31. data/lib/solargraph/location.rb +21 -0
  32. data/lib/solargraph/logging.rb +1 -0
  33. data/lib/solargraph/parser/comment_ripper.rb +12 -6
  34. data/lib/solargraph/parser/flow_sensitive_typing.rb +227 -0
  35. data/lib/solargraph/parser/node_methods.rb +14 -0
  36. data/lib/solargraph/parser/node_processor/base.rb +9 -4
  37. data/lib/solargraph/parser/node_processor.rb +21 -8
  38. data/lib/solargraph/parser/parser_gem/class_methods.rb +16 -14
  39. data/lib/solargraph/parser/parser_gem/node_chainer.rb +10 -10
  40. data/lib/solargraph/parser/parser_gem/node_methods.rb +4 -2
  41. data/lib/solargraph/parser/parser_gem/node_processors/alias_node.rb +2 -1
  42. data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +21 -0
  43. data/lib/solargraph/parser/parser_gem/node_processors/args_node.rb +4 -2
  44. data/lib/solargraph/parser/parser_gem/node_processors/block_node.rb +4 -2
  45. data/lib/solargraph/parser/parser_gem/node_processors/casgn_node.rb +2 -1
  46. data/lib/solargraph/parser/parser_gem/node_processors/cvasgn_node.rb +2 -1
  47. data/lib/solargraph/parser/parser_gem/node_processors/def_node.rb +6 -3
  48. data/lib/solargraph/parser/parser_gem/node_processors/defs_node.rb +2 -1
  49. data/lib/solargraph/parser/parser_gem/node_processors/gvasgn_node.rb +2 -1
  50. data/lib/solargraph/parser/parser_gem/node_processors/if_node.rb +21 -0
  51. data/lib/solargraph/parser/parser_gem/node_processors/ivasgn_node.rb +4 -2
  52. data/lib/solargraph/parser/parser_gem/node_processors/lvasgn_node.rb +2 -1
  53. data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +4 -1
  54. data/lib/solargraph/parser/parser_gem/node_processors/namespace_node.rb +8 -7
  55. data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +42 -0
  56. data/lib/solargraph/parser/parser_gem/node_processors/orasgn_node.rb +1 -0
  57. data/lib/solargraph/parser/parser_gem/node_processors/resbody_node.rb +3 -1
  58. data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +4 -3
  59. data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +28 -16
  60. data/lib/solargraph/parser/parser_gem/node_processors/sym_node.rb +3 -1
  61. data/lib/solargraph/parser/parser_gem/node_processors/until_node.rb +29 -0
  62. data/lib/solargraph/parser/parser_gem/node_processors/while_node.rb +29 -0
  63. data/lib/solargraph/parser/parser_gem/node_processors.rb +14 -0
  64. data/lib/solargraph/parser/region.rb +1 -1
  65. data/lib/solargraph/parser.rb +1 -0
  66. data/lib/solargraph/pin/base.rb +316 -28
  67. data/lib/solargraph/pin/base_variable.rb +16 -9
  68. data/lib/solargraph/pin/block.rb +2 -0
  69. data/lib/solargraph/pin/breakable.rb +9 -0
  70. data/lib/solargraph/pin/callable.rb +74 -3
  71. data/lib/solargraph/pin/closure.rb +18 -1
  72. data/lib/solargraph/pin/common.rb +5 -0
  73. data/lib/solargraph/pin/delegated_method.rb +20 -1
  74. data/lib/solargraph/pin/documenting.rb +16 -0
  75. data/lib/solargraph/pin/keyword.rb +7 -2
  76. data/lib/solargraph/pin/local_variable.rb +15 -6
  77. data/lib/solargraph/pin/method.rb +169 -43
  78. data/lib/solargraph/pin/namespace.rb +17 -9
  79. data/lib/solargraph/pin/parameter.rb +60 -11
  80. data/lib/solargraph/pin/proxy_type.rb +12 -6
  81. data/lib/solargraph/pin/reference/override.rb +10 -6
  82. data/lib/solargraph/pin/reference/require.rb +2 -2
  83. data/lib/solargraph/pin/signature.rb +42 -0
  84. data/lib/solargraph/pin/singleton.rb +1 -1
  85. data/lib/solargraph/pin/symbol.rb +3 -2
  86. data/lib/solargraph/pin/until.rb +18 -0
  87. data/lib/solargraph/pin/while.rb +18 -0
  88. data/lib/solargraph/pin.rb +4 -1
  89. data/lib/solargraph/pin_cache.rb +185 -0
  90. data/lib/solargraph/position.rb +9 -0
  91. data/lib/solargraph/range.rb +9 -0
  92. data/lib/solargraph/rbs_map/conversions.rb +221 -67
  93. data/lib/solargraph/rbs_map/core_fills.rb +32 -16
  94. data/lib/solargraph/rbs_map/core_map.rb +34 -11
  95. data/lib/solargraph/rbs_map/stdlib_map.rb +15 -5
  96. data/lib/solargraph/rbs_map.rb +74 -17
  97. data/lib/solargraph/shell.rb +17 -18
  98. data/lib/solargraph/source/chain/array.rb +11 -7
  99. data/lib/solargraph/source/chain/block_symbol.rb +1 -1
  100. data/lib/solargraph/source/chain/block_variable.rb +1 -1
  101. data/lib/solargraph/source/chain/call.rb +53 -23
  102. data/lib/solargraph/source/chain/constant.rb +1 -1
  103. data/lib/solargraph/source/chain/hash.rb +4 -3
  104. data/lib/solargraph/source/chain/head.rb +1 -1
  105. data/lib/solargraph/source/chain/if.rb +1 -1
  106. data/lib/solargraph/source/chain/link.rb +2 -0
  107. data/lib/solargraph/source/chain/literal.rb +22 -2
  108. data/lib/solargraph/source/chain/or.rb +1 -1
  109. data/lib/solargraph/source/chain/z_super.rb +1 -1
  110. data/lib/solargraph/source/chain.rb +78 -48
  111. data/lib/solargraph/source/source_chainer.rb +2 -2
  112. data/lib/solargraph/source_map/clip.rb +3 -1
  113. data/lib/solargraph/source_map/mapper.rb +9 -5
  114. data/lib/solargraph/source_map.rb +0 -17
  115. data/lib/solargraph/type_checker/checks.rb +4 -0
  116. data/lib/solargraph/type_checker.rb +35 -8
  117. data/lib/solargraph/version.rb +1 -1
  118. data/lib/solargraph/views/_method.erb +10 -10
  119. data/lib/solargraph/views/_namespace.erb +3 -3
  120. data/lib/solargraph/views/document.erb +10 -10
  121. data/lib/solargraph/workspace/config.rb +1 -1
  122. data/lib/solargraph/workspace.rb +23 -5
  123. data/lib/solargraph/yard_map/helpers.rb +29 -1
  124. data/lib/solargraph/yard_map/mapper/to_constant.rb +7 -5
  125. data/lib/solargraph/yard_map/mapper/to_method.rb +53 -18
  126. data/lib/solargraph/yard_map/mapper/to_namespace.rb +9 -7
  127. data/lib/solargraph/yard_map/mapper.rb +4 -3
  128. data/lib/solargraph/yard_map/to_method.rb +4 -2
  129. data/lib/solargraph/yardoc.rb +7 -8
  130. data/lib/solargraph.rb +32 -1
  131. data/rbs/fills/tuple.rbs +150 -0
  132. data/rbs_collection.yaml +19 -0
  133. data/solargraph.gemspec +2 -1
  134. metadata +37 -9
  135. data/lib/solargraph/cache.rb +0 -77
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 469236908941a1221785c7add8041544e118731b99e8a81b766856b96acbb307
4
- data.tar.gz: 6f2cf614a67abd04e53bb3a30a5ce2bc51b6b9cac16c474818e959c1e4c582ab
3
+ metadata.gz: 82754cd0869fed91a86a2bfb08ca0f54d6468f942620cddd3148bad99724ad88
4
+ data.tar.gz: 4e017a78936b0d24eaa6d5db7edcd01ea2b43d6cb365eb5b4892576a141ca2b7
5
5
  SHA512:
6
- metadata.gz: 22777792098e88c264a08e8a9785df73e00b1ed20fbfb4efe0988f9cb8aa5deec93ae520961672f2848ac7b2bf02fefccbb83a14e0c9092c2e18bd861d938f0b
7
- data.tar.gz: f154c4badced68ac0ab43bfe43c380009787c424f909801da183fdaf63e9a818daf62eb7ddb904172b9f91957d634758732460aab317235bf163c9d26921f452
6
+ metadata.gz: 304fb86181925f916d7119da44b85a3753fc33d961da8a61c5525dbcb8d814a87baeeb9767d17b7ec6548c3ffe725bfda6eafbfd7ea75e8bdddf3f1a1a5c103b
7
+ data.tar.gz: 73d437e753be70628008f09a7846cba5e16fd47d045017b41c0b301d8a5b34ca04a45127a37c6eada4e61287944ca1af659ecab8df4681bab42a8ecc37d73bc4
@@ -34,6 +34,8 @@ jobs:
34
34
  bundle exec solargraph config
35
35
  yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml
36
36
  yq -yi '.plugins += ["solargraph-rspec"]' .solargraph.yml
37
+ - name: Install gem types
38
+ run: bundle exec rbs collection install
37
39
  - name: Ensure typechecking still works
38
40
  run: bundle exec solargraph typecheck --level typed
39
41
  - name: Ensure specs still run
@@ -30,5 +30,7 @@ jobs:
30
30
  bundler-cache: false
31
31
  - name: Install gems
32
32
  run: bundle install
33
+ - name: Install gem types
34
+ run: bundle exec rbs collection install
33
35
  - name: Typecheck self
34
- run: bundle exec solargraph typecheck --level typed
36
+ run: SOLARGRAPH_ASSERTS=on bundle exec solargraph typecheck --level typed
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
+ /.gem_rbs_collection
2
+ /rbs_collection.lock.yaml
1
3
  /Gemfile.lock
2
4
  .Gemfile
3
5
  .idea
data/CHANGELOG.md CHANGED
@@ -1,3 +1,65 @@
1
+ ## 0.56.2 - July 29, 2025
2
+ - Add support for Ruby Data.define (#970)
3
+ - Ensure that pin locations are always populated (#965)
4
+ - Improve struct support (#992)
5
+ - Include Rakefile, Gemfile, and gemspec files in config by default (#984)
6
+ - Use Open3 to cache gemspecs (#1000)
7
+ - Eager load node processors (#1002)
8
+
9
+ ## 0.56.1 - July 13, 2025
10
+ - Library avoids blocking on pending yardoc caches (#990)
11
+ - DocMap checks for default Gemfile (#989)
12
+ - [Bug fix] Fixed an error in rbs/fills/tuple.rbs (#993)
13
+
14
+ ## 0.56.0 - July 1, 2025
15
+ - [regression] Gem caching perf and logging fixes #983
16
+
17
+ ## 0.55.5 - July 1, 2025
18
+ - Flatten results of DocMap external bundle query (#981)
19
+ - [breaking] Reimplement global conventions (#877)
20
+ - GemPins pin merging improvements (#946)
21
+ - Support class-scoped aliases and attributes from RBS (#952)
22
+ - Restructure ComplexType specs towards YARD doc compliance (#969)
23
+ - Use Prism (#974)
24
+ - Document pages (#977)
25
+ - Enable disabled-but-working specs (#978)
26
+ - Map RBS 'untyped' type (RBS::Types::Bases::Any) to 'undefined' (#979)
27
+ - Re-enable support for .gem_rbs_collection directories (#942)
28
+ - [breaking] Comply with YARD documentation on Hash tag format (#968)
29
+ - Ignore directory paths in Workspace#would_require? (#988)
30
+
31
+ ## 0.55.4 - June 27, 2025
32
+ - Flatten results of DocMap external bundle query (#981)
33
+
34
+ ## 0.55.3 - June 25, 2025
35
+ - Nil guards in flow-sensitive typing (patch release) (#980)
36
+
37
+ ## 0.55.2 - June 21, 2025
38
+ - Require external bundle (#972)
39
+
40
+ ## 0.55.1 - June 8, 2025
41
+ - Fix inline Struct definition (#962)
42
+ - Ensure DocMap requires bundler when loading gemspecs (#963)
43
+ - DelegatedMethod improvements (#953)
44
+
45
+ ## 0.55.0 - June 3, 2025
46
+ - Flow-sensitive typing - automatically downcast from is_a? calls (#856)
47
+ - Tuple enabler: infer literal types and use them for signature selection (#836)
48
+ - Signature selection improvements (#907)
49
+ - Add support for Ruby Structs (#939)
50
+ - [regression] Fix interface change breaking solargraph-rails (#940)
51
+ - [regression] Add back bundler/require support for solargraph-rails (#941)
52
+ - Add specs for initialize capabilities (#955)
53
+ - Create MethodAlias pins from YARD (#945)
54
+ - MessageWorker prioritizes synchronization (#956)
55
+ - initialize/new method pin cleanups (#949)
56
+ - Clip rebinds blocks when cursor is not part of receiver (#958)
57
+
58
+ ## 0.54.5 - May 17, 2025
59
+ - Repair unknown encoding errors (#936, #935)
60
+ - Index arbitrary pinsets (#937)
61
+ - Separate YARD cache from doc map cache (#938)
62
+
1
63
  ## 0.54.4 - May 14, 2025
2
64
  - Delete files from Library hash (#932)
3
65
  - Clip#define returns variable pins (#934, #933)
data/README.md CHANGED
@@ -63,12 +63,22 @@ The RSpec framework is supported via [solargraph-rspec](https://github.com/lekem
63
63
 
64
64
  **Note: Before version 0.53.0, it was recommended to run `yard gems` periodically or automate it with `yard config` to ensure that Solargraph had access to gem documentation. These steps are no longer necessary. Solargraph maintains its own gem documentation cache independent of the yardocs in your gem installations.**
65
65
 
66
- Solargraph automatically generates code maps from installed gems. You can also manage your cached gem documentation with the `solargraph gems` command.
67
-
68
- When editing code, a `require` call that references a gem will pull the documentation into the code maps and include the gem's API in code completion and intellisense.
66
+ When editing code, a `require` call that references a gem will pull the documentation into the code maps and include the gem's API in code completion and intellisense. Solargraph automatically generates code maps from installed gems, based on the YARD or RBS type information inside the gem. You can also eagerly cache gem documentation with the `solargraph gems` command.
69
67
 
70
68
  If your project automatically requires bundled gems (e.g., `require 'bundler/require'`), Solargraph will add all of the Gemfile's default dependencies to the map.
71
69
 
70
+ To ensure you have types for gems which contain neither RBS nor YARD
71
+ information, use
72
+ [gem\_rbs\_collection](https://github.com/ruby/gem_rbs_collection) to
73
+ install a community-supported set of RBS types for various gems:
74
+
75
+ ```sh
76
+ bundle exec rbs collection init
77
+ bundle exec rbs collection install
78
+ ```
79
+
80
+ Once installed, you can also insert your own local overrides and definitions in RBS in a directory configured in the `rbs_collection.yaml` that the above commands create.
81
+
72
82
  ### Type Checking
73
83
 
74
84
  As of version 0.33.0, Solargraph includes a [type checker](https://github.com/castwide/solargraph/issues/192) that uses a combination of YARD tags and code analysis to report missing type definitions. In strict mode, it performs type inference to determine whether the tags match the types it detects from code.
@@ -3,8 +3,10 @@
3
3
  module Solargraph
4
4
  class ApiMap
5
5
  class Index
6
+ include Logging
7
+
6
8
  # @param pins [Array<Pin::Base>]
7
- def initialize pins
9
+ def initialize pins = []
8
10
  catalog pins
9
11
  end
10
12
 
@@ -132,21 +134,24 @@ module Solargraph
132
134
  # @return [void]
133
135
  def map_overrides
134
136
  pins_by_class(Pin::Reference::Override).each do |ovr|
135
- pin = path_pin_hash[ovr.name].first
136
- next if pin.nil?
137
- new_pin = if pin.path.end_with?('#initialize')
138
- path_pin_hash[pin.path.sub(/#initialize/, '.new')].first
139
- end
140
- (ovr.tags.map(&:tag_name) + ovr.delete).uniq.each do |tag|
141
- pin.docstring.delete_tags tag
142
- new_pin.docstring.delete_tags tag if new_pin
143
- end
144
- ovr.tags.each do |tag|
145
- pin.docstring.add_tag(tag)
146
- redefine_return_type pin, tag
147
- if new_pin
148
- new_pin.docstring.add_tag(tag)
149
- redefine_return_type new_pin, tag
137
+ logger.debug { "ApiMap::Index#map_overrides: Looking at override #{ovr} for #{ovr.name}" }
138
+ pins = path_pin_hash[ovr.name]
139
+ logger.debug { "ApiMap::Index#map_overrides: pins for path=#{ovr.name}: #{pins}" }
140
+ pins.each do |pin|
141
+ new_pin = if pin.path.end_with?('#initialize')
142
+ path_pin_hash[pin.path.sub(/#initialize/, '.new')].first
143
+ end
144
+ (ovr.tags.map(&:tag_name) + ovr.delete).uniq.each do |tag|
145
+ pin.docstring.delete_tags tag
146
+ new_pin.docstring.delete_tags tag if new_pin
147
+ end
148
+ ovr.tags.each do |tag|
149
+ pin.docstring.add_tag(tag)
150
+ redefine_return_type pin, tag
151
+ if new_pin
152
+ new_pin.docstring.add_tag(tag)
153
+ redefine_return_type new_pin, tag
154
+ end
150
155
  end
151
156
  end
152
157
  end
@@ -156,11 +161,14 @@ module Solargraph
156
161
  # @param tag [YARD::Tags::Tag]
157
162
  # @return [void]
158
163
  def redefine_return_type pin, tag
164
+ # @todo can this be made to not mutate existing pins and use
165
+ # proxy() / proxy_with_signatures() instead?
159
166
  return unless pin && tag.tag_name == 'return'
160
167
  pin.instance_variable_set(:@return_type, ComplexType.try_parse(tag.type))
161
168
  pin.signatures.each do |sig|
162
169
  sig.instance_variable_set(:@return_type, ComplexType.try_parse(tag.type))
163
170
  end
171
+ pin.reset_generated!
164
172
  end
165
173
  end
166
174
  end
@@ -1,18 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
-
4
3
  module Solargraph
5
4
  class ApiMap
6
5
  # Queryable collection of Pins representing a Workspace, gems and the Ruby
7
6
  # core.
8
7
  #
9
8
  class Store
10
- # @param static [Enumerable<Pin::Base>]
11
- # @param dynamic [Enumerable<Pin::Base>]
12
- def initialize static = [], dynamic = []
13
- @static_index = Index.new(static)
14
- @dynamic = dynamic
15
- @index = @static_index.merge(dynamic)
9
+ # @param pinsets [Array<Enumerable<Pin::Base>>]
10
+ def initialize *pinsets
11
+ catalog pinsets
16
12
  end
17
13
 
18
14
  # @return [Array<Solargraph::Pin::Base>]
@@ -20,19 +16,27 @@ module Solargraph
20
16
  index.pins
21
17
  end
22
18
 
23
- # @param static [Enumerable<Pin::Base>]
24
- # @param dynamic [Enumerable<Pin::Base>]
25
- def update! static = [], dynamic = []
19
+ # @param pinsets [Array<Enumerable<Pin::Base>>]
20
+ # @return [Boolean] True if the index was updated
21
+ def update *pinsets
22
+ return catalog(pinsets) if pinsets.length != @pinsets.length
23
+
24
+ changed = pinsets.find_index.with_index { |pinset, idx| @pinsets[idx] != pinset }
25
+ return false unless changed
26
+
26
27
  # @todo Fix this map
27
28
  @fqns_pins_map = nil
28
- if @static_index.pins == static
29
- return self if @dynamic == dynamic
30
- else
31
- @static_index = Index.new(static)
29
+ return catalog(pinsets) if changed == 0
30
+
31
+ pinsets[changed..].each_with_index do |pins, idx|
32
+ @pinsets[changed + idx] = pins
33
+ @indexes[changed + idx] = if pins.empty?
34
+ @indexes[changed + idx - 1]
35
+ else
36
+ @indexes[changed + idx - 1].merge(pins)
37
+ end
32
38
  end
33
- @dynamic = dynamic
34
- @index = @static_index.merge(dynamic)
35
- self
39
+ true
36
40
  end
37
41
 
38
42
  def to_s
@@ -57,18 +61,24 @@ module Solargraph
57
61
  # @param visibility [Array<Symbol>]
58
62
  # @return [Enumerable<Solargraph::Pin::Method>]
59
63
  def get_methods fqns, scope: :instance, visibility: [:public]
60
- namespace_children(fqns).select do |pin|
64
+ all_pins = namespace_children(fqns).select do |pin|
61
65
  pin.is_a?(Pin::Method) && pin.scope == scope && visibility.include?(pin.visibility)
62
66
  end
67
+ GemPins.combine_method_pins_by_path(all_pins)
63
68
  end
64
69
 
65
- # @param fqns [String]
70
+ # @param fq_tag [String]
66
71
  # @return [String, nil]
67
- def get_superclass fqns
68
- raise "Do not prefix fully qualified namespaces with '::' - #{fqns.inspect}" if fqns.start_with?('::')
72
+ def get_superclass fq_tag
73
+ raise "Do not prefix fully qualified tags with '::' - #{fq_tag.inspect}" if fq_tag.start_with?('::')
74
+ sub = ComplexType.parse(fq_tag)
75
+ fqns = sub.namespace
76
+ return superclass_references[fq_tag].first if superclass_references.key?(fq_tag)
69
77
  return superclass_references[fqns].first if superclass_references.key?(fqns)
70
78
  return 'Object' if fqns != 'BasicObject' && namespace_exists?(fqns)
71
79
  return 'Object' if fqns == 'Boolean'
80
+ simplified_literal_name = ComplexType.parse("#{fqns}").simplify_literals.name
81
+ return simplified_literal_name if simplified_literal_name != fqns
72
82
  nil
73
83
  end
74
84
 
@@ -108,7 +118,7 @@ module Solargraph
108
118
  # @param fqns [String]
109
119
  # @return [Enumerable<Solargraph::Pin::Base>]
110
120
  def get_class_variables(fqns)
111
- namespace_children(fqns).select{|pin| pin.is_a?(Pin::ClassVariable)}
121
+ namespace_children(fqns).select { |pin| pin.is_a?(Pin::ClassVariable)}
112
122
  end
113
123
 
114
124
  # @return [Enumerable<Solargraph::Pin::Base>]
@@ -190,7 +200,22 @@ module Solargraph
190
200
 
191
201
  private
192
202
 
193
- attr_reader :index
203
+ def index
204
+ @indexes.last
205
+ end
206
+
207
+ def catalog pinsets
208
+ @pinsets = pinsets
209
+ @indexes = []
210
+ pinsets.each do |pins|
211
+ if @indexes.last && pins.empty?
212
+ @indexes.push @indexes.last
213
+ else
214
+ @indexes.push(@indexes.last&.merge(pins) || Solargraph::ApiMap::Index.new(pins))
215
+ end
216
+ end
217
+ true
218
+ end
194
219
 
195
220
  # @return [Hash{::Array(String, String) => ::Array<Pin::Namespace>}]
196
221
  def fqns_pins_map