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.
- checksums.yaml +4 -4
- data/.github/workflows/plugins.yml +2 -0
- data/.github/workflows/typecheck.yml +3 -1
- data/.gitignore +2 -0
- data/CHANGELOG.md +62 -0
- data/README.md +13 -3
- data/lib/solargraph/api_map/index.rb +24 -16
- data/lib/solargraph/api_map/store.rb +48 -23
- data/lib/solargraph/api_map.rb +175 -77
- data/lib/solargraph/bench.rb +17 -1
- data/lib/solargraph/complex_type/type_methods.rb +6 -1
- data/lib/solargraph/complex_type/unique_type.rb +98 -9
- data/lib/solargraph/complex_type.rb +35 -6
- data/lib/solargraph/convention/base.rb +3 -3
- data/lib/solargraph/convention/data_definition/data_assignment_node.rb +60 -0
- data/lib/solargraph/convention/data_definition/data_definition_node.rb +89 -0
- data/lib/solargraph/convention/data_definition.rb +104 -0
- data/lib/solargraph/convention/gemspec.rb +2 -1
- data/lib/solargraph/convention/struct_definition/struct_assignment_node.rb +60 -0
- data/lib/solargraph/convention/struct_definition/struct_definition_node.rb +100 -0
- data/lib/solargraph/convention/struct_definition.rb +141 -0
- data/lib/solargraph/convention.rb +5 -3
- data/lib/solargraph/doc_map.rb +277 -57
- data/lib/solargraph/gem_pins.rb +53 -37
- data/lib/solargraph/language_server/host/message_worker.rb +10 -7
- data/lib/solargraph/language_server/host.rb +12 -2
- data/lib/solargraph/language_server/message/extended/check_gem_version.rb +2 -0
- data/lib/solargraph/language_server/message/extended/document.rb +5 -2
- data/lib/solargraph/language_server/message/extended/document_gems.rb +3 -3
- data/lib/solargraph/library.rb +45 -17
- data/lib/solargraph/location.rb +21 -0
- data/lib/solargraph/logging.rb +1 -0
- data/lib/solargraph/parser/comment_ripper.rb +12 -6
- data/lib/solargraph/parser/flow_sensitive_typing.rb +227 -0
- data/lib/solargraph/parser/node_methods.rb +14 -0
- data/lib/solargraph/parser/node_processor/base.rb +9 -4
- data/lib/solargraph/parser/node_processor.rb +21 -8
- data/lib/solargraph/parser/parser_gem/class_methods.rb +16 -14
- data/lib/solargraph/parser/parser_gem/node_chainer.rb +10 -10
- data/lib/solargraph/parser/parser_gem/node_methods.rb +4 -2
- data/lib/solargraph/parser/parser_gem/node_processors/alias_node.rb +2 -1
- data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +21 -0
- data/lib/solargraph/parser/parser_gem/node_processors/args_node.rb +4 -2
- data/lib/solargraph/parser/parser_gem/node_processors/block_node.rb +4 -2
- data/lib/solargraph/parser/parser_gem/node_processors/casgn_node.rb +2 -1
- data/lib/solargraph/parser/parser_gem/node_processors/cvasgn_node.rb +2 -1
- data/lib/solargraph/parser/parser_gem/node_processors/def_node.rb +6 -3
- data/lib/solargraph/parser/parser_gem/node_processors/defs_node.rb +2 -1
- data/lib/solargraph/parser/parser_gem/node_processors/gvasgn_node.rb +2 -1
- data/lib/solargraph/parser/parser_gem/node_processors/if_node.rb +21 -0
- data/lib/solargraph/parser/parser_gem/node_processors/ivasgn_node.rb +4 -2
- data/lib/solargraph/parser/parser_gem/node_processors/lvasgn_node.rb +2 -1
- data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +4 -1
- data/lib/solargraph/parser/parser_gem/node_processors/namespace_node.rb +8 -7
- data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +42 -0
- data/lib/solargraph/parser/parser_gem/node_processors/orasgn_node.rb +1 -0
- data/lib/solargraph/parser/parser_gem/node_processors/resbody_node.rb +3 -1
- data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +4 -3
- data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +28 -16
- data/lib/solargraph/parser/parser_gem/node_processors/sym_node.rb +3 -1
- data/lib/solargraph/parser/parser_gem/node_processors/until_node.rb +29 -0
- data/lib/solargraph/parser/parser_gem/node_processors/while_node.rb +29 -0
- data/lib/solargraph/parser/parser_gem/node_processors.rb +14 -0
- data/lib/solargraph/parser/region.rb +1 -1
- data/lib/solargraph/parser.rb +1 -0
- data/lib/solargraph/pin/base.rb +316 -28
- data/lib/solargraph/pin/base_variable.rb +16 -9
- data/lib/solargraph/pin/block.rb +2 -0
- data/lib/solargraph/pin/breakable.rb +9 -0
- data/lib/solargraph/pin/callable.rb +74 -3
- data/lib/solargraph/pin/closure.rb +18 -1
- data/lib/solargraph/pin/common.rb +5 -0
- data/lib/solargraph/pin/delegated_method.rb +20 -1
- data/lib/solargraph/pin/documenting.rb +16 -0
- data/lib/solargraph/pin/keyword.rb +7 -2
- data/lib/solargraph/pin/local_variable.rb +15 -6
- data/lib/solargraph/pin/method.rb +169 -43
- data/lib/solargraph/pin/namespace.rb +17 -9
- data/lib/solargraph/pin/parameter.rb +60 -11
- data/lib/solargraph/pin/proxy_type.rb +12 -6
- data/lib/solargraph/pin/reference/override.rb +10 -6
- data/lib/solargraph/pin/reference/require.rb +2 -2
- data/lib/solargraph/pin/signature.rb +42 -0
- data/lib/solargraph/pin/singleton.rb +1 -1
- data/lib/solargraph/pin/symbol.rb +3 -2
- data/lib/solargraph/pin/until.rb +18 -0
- data/lib/solargraph/pin/while.rb +18 -0
- data/lib/solargraph/pin.rb +4 -1
- data/lib/solargraph/pin_cache.rb +185 -0
- data/lib/solargraph/position.rb +9 -0
- data/lib/solargraph/range.rb +9 -0
- data/lib/solargraph/rbs_map/conversions.rb +221 -67
- data/lib/solargraph/rbs_map/core_fills.rb +32 -16
- data/lib/solargraph/rbs_map/core_map.rb +34 -11
- data/lib/solargraph/rbs_map/stdlib_map.rb +15 -5
- data/lib/solargraph/rbs_map.rb +74 -17
- data/lib/solargraph/shell.rb +17 -18
- data/lib/solargraph/source/chain/array.rb +11 -7
- data/lib/solargraph/source/chain/block_symbol.rb +1 -1
- data/lib/solargraph/source/chain/block_variable.rb +1 -1
- data/lib/solargraph/source/chain/call.rb +53 -23
- data/lib/solargraph/source/chain/constant.rb +1 -1
- data/lib/solargraph/source/chain/hash.rb +4 -3
- data/lib/solargraph/source/chain/head.rb +1 -1
- data/lib/solargraph/source/chain/if.rb +1 -1
- data/lib/solargraph/source/chain/link.rb +2 -0
- data/lib/solargraph/source/chain/literal.rb +22 -2
- data/lib/solargraph/source/chain/or.rb +1 -1
- data/lib/solargraph/source/chain/z_super.rb +1 -1
- data/lib/solargraph/source/chain.rb +78 -48
- data/lib/solargraph/source/source_chainer.rb +2 -2
- data/lib/solargraph/source_map/clip.rb +3 -1
- data/lib/solargraph/source_map/mapper.rb +9 -5
- data/lib/solargraph/source_map.rb +0 -17
- data/lib/solargraph/type_checker/checks.rb +4 -0
- data/lib/solargraph/type_checker.rb +35 -8
- data/lib/solargraph/version.rb +1 -1
- data/lib/solargraph/views/_method.erb +10 -10
- data/lib/solargraph/views/_namespace.erb +3 -3
- data/lib/solargraph/views/document.erb +10 -10
- data/lib/solargraph/workspace/config.rb +1 -1
- data/lib/solargraph/workspace.rb +23 -5
- data/lib/solargraph/yard_map/helpers.rb +29 -1
- data/lib/solargraph/yard_map/mapper/to_constant.rb +7 -5
- data/lib/solargraph/yard_map/mapper/to_method.rb +53 -18
- data/lib/solargraph/yard_map/mapper/to_namespace.rb +9 -7
- data/lib/solargraph/yard_map/mapper.rb +4 -3
- data/lib/solargraph/yard_map/to_method.rb +4 -2
- data/lib/solargraph/yardoc.rb +7 -8
- data/lib/solargraph.rb +32 -1
- data/rbs/fills/tuple.rbs +150 -0
- data/rbs_collection.yaml +19 -0
- data/solargraph.gemspec +2 -1
- metadata +37 -9
- data/lib/solargraph/cache.rb +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82754cd0869fed91a86a2bfb08ca0f54d6468f942620cddd3148bad99724ad88
|
4
|
+
data.tar.gz: 4e017a78936b0d24eaa6d5db7edcd01ea2b43d6cb365eb5b4892576a141ca2b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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.
|
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
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
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
|
11
|
-
|
12
|
-
|
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
|
24
|
-
# @
|
25
|
-
def update
|
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
|
29
|
-
|
30
|
-
|
31
|
-
@
|
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
|
-
|
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
|
70
|
+
# @param fq_tag [String]
|
66
71
|
# @return [String, nil]
|
67
|
-
def get_superclass
|
68
|
-
raise "Do not prefix fully qualified
|
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
|
-
|
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
|