solargraph 0.54.5 → 0.55.4
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/typecheck.yml +1 -1
- data/CHANGELOG.md +27 -0
- data/lib/solargraph/api_map/store.rb +9 -4
- data/lib/solargraph/api_map.rb +116 -39
- data/lib/solargraph/complex_type/type_methods.rb +1 -0
- data/lib/solargraph/complex_type/unique_type.rb +91 -9
- data/lib/solargraph/complex_type.rb +35 -6
- 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 +101 -0
- data/lib/solargraph/convention.rb +1 -0
- data/lib/solargraph/doc_map.rb +83 -23
- data/lib/solargraph/gem_pins.rb +2 -1
- data/lib/solargraph/language_server/host/message_worker.rb +10 -7
- data/lib/solargraph/language_server/host.rb +3 -1
- data/lib/solargraph/language_server/message/extended/check_gem_version.rb +1 -0
- data/lib/solargraph/location.rb +8 -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.rb +3 -2
- data/lib/solargraph/parser/parser_gem/class_methods.rb +9 -0
- 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 +23 -2
- 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/namespace_node.rb +29 -6
- data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +41 -0
- data/lib/solargraph/parser/parser_gem/node_processors/resbody_node.rb +2 -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 +2 -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 +10 -0
- data/lib/solargraph/parser/region.rb +1 -1
- data/lib/solargraph/parser.rb +1 -0
- data/lib/solargraph/pin/base.rb +34 -5
- data/lib/solargraph/pin/base_variable.rb +7 -1
- data/lib/solargraph/pin/block.rb +2 -0
- data/lib/solargraph/pin/breakable.rb +9 -0
- data/lib/solargraph/pin/callable.rb +5 -3
- data/lib/solargraph/pin/closure.rb +6 -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 +7 -1
- data/lib/solargraph/pin/method.rb +34 -27
- data/lib/solargraph/pin/namespace.rb +17 -9
- data/lib/solargraph/pin/parameter.rb +17 -5
- 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 +4 -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/rbs_map/conversions.rb +172 -56
- data/lib/solargraph/rbs_map/core_fills.rb +32 -16
- data/lib/solargraph/rbs_map/core_map.rb +3 -2
- data/lib/solargraph/shell.rb +1 -0
- 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/type_checker/checks.rb +4 -0
- data/lib/solargraph/type_checker.rb +35 -8
- data/lib/solargraph/version.rb +1 -1
- data/lib/solargraph/yard_map/mapper/to_constant.rb +4 -2
- data/lib/solargraph/yard_map/mapper/to_method.rb +55 -15
- data/lib/solargraph/yard_map/mapper/to_namespace.rb +4 -2
- data/lib/solargraph/yard_map/mapper.rb +4 -3
- data/lib/solargraph/yard_map/to_method.rb +4 -2
- data/lib/solargraph.rb +20 -0
- data/rbs/fills/tuple.rbs +150 -0
- metadata +15 -2
@@ -10,6 +10,8 @@ module Solargraph
|
|
10
10
|
# @return [::Symbol] :public, :private, or :protected
|
11
11
|
attr_reader :visibility
|
12
12
|
|
13
|
+
attr_writer :signatures
|
14
|
+
|
13
15
|
# @return [Parser::AST::Node]
|
14
16
|
attr_reader :node
|
15
17
|
|
@@ -116,13 +118,16 @@ module Solargraph
|
|
116
118
|
name: name,
|
117
119
|
decl: decl,
|
118
120
|
presence: location ? location.range : nil,
|
119
|
-
return_type: ComplexType.try_parse(*p.types)
|
121
|
+
return_type: ComplexType.try_parse(*p.types),
|
122
|
+
source: source
|
120
123
|
)
|
121
124
|
end
|
122
125
|
yield_return_type = ComplexType.try_parse(*yieldreturn_tags.flat_map(&:types))
|
123
|
-
block = Signature.new(generics: generics, parameters: yield_parameters, return_type: yield_return_type)
|
126
|
+
block = Signature.new(generics: generics, parameters: yield_parameters, return_type: yield_return_type, source: source)
|
124
127
|
end
|
125
|
-
Signature.new(generics: generics, parameters: parameters, return_type: return_type, block: block)
|
128
|
+
signature = Signature.new(generics: generics, parameters: parameters, return_type: return_type, block: block, closure: self, source: source)
|
129
|
+
block.closure = signature if block
|
130
|
+
signature
|
126
131
|
end
|
127
132
|
|
128
133
|
# @return [::Array<Signature>]
|
@@ -163,12 +168,12 @@ module Solargraph
|
|
163
168
|
end
|
164
169
|
end
|
165
170
|
|
166
|
-
def
|
171
|
+
def inner_desc
|
167
172
|
# ensure the signatures line up when logged
|
168
173
|
if signatures.length > 1
|
169
|
-
"\n#{to_rbs}\n"
|
174
|
+
path + " \n#{to_rbs}\n"
|
170
175
|
else
|
171
|
-
|
176
|
+
super
|
172
177
|
end
|
173
178
|
end
|
174
179
|
|
@@ -196,13 +201,14 @@ module Solargraph
|
|
196
201
|
name.end_with?('?') ? ComplexType::BOOLEAN : ComplexType::UNDEFINED
|
197
202
|
end
|
198
203
|
|
204
|
+
# @sg-ignore
|
199
205
|
def documentation
|
200
206
|
if @documentation.nil?
|
201
|
-
|
207
|
+
method_docs ||= super || ''
|
202
208
|
param_tags = docstring.tags(:param)
|
203
209
|
unless param_tags.nil? or param_tags.empty?
|
204
|
-
|
205
|
-
|
210
|
+
method_docs += "\n\n" unless method_docs.empty?
|
211
|
+
method_docs += "Params:\n"
|
206
212
|
lines = []
|
207
213
|
param_tags.each do |p|
|
208
214
|
l = "* #{p.name}"
|
@@ -210,12 +216,12 @@ module Solargraph
|
|
210
216
|
l += " #{p.text}"
|
211
217
|
lines.push l
|
212
218
|
end
|
213
|
-
|
219
|
+
method_docs += lines.join("\n")
|
214
220
|
end
|
215
221
|
yieldparam_tags = docstring.tags(:yieldparam)
|
216
222
|
unless yieldparam_tags.nil? or yieldparam_tags.empty?
|
217
|
-
|
218
|
-
|
223
|
+
method_docs += "\n\n" unless method_docs.empty?
|
224
|
+
method_docs += "Block Params:\n"
|
219
225
|
lines = []
|
220
226
|
yieldparam_tags.each do |p|
|
221
227
|
l = "* #{p.name}"
|
@@ -223,12 +229,12 @@ module Solargraph
|
|
223
229
|
l += " #{p.text}"
|
224
230
|
lines.push l
|
225
231
|
end
|
226
|
-
|
232
|
+
method_docs += lines.join("\n")
|
227
233
|
end
|
228
234
|
yieldreturn_tags = docstring.tags(:yieldreturn)
|
229
235
|
unless yieldreturn_tags.empty?
|
230
|
-
|
231
|
-
|
236
|
+
method_docs += "\n\n" unless method_docs.empty?
|
237
|
+
method_docs += "Block Returns:\n"
|
232
238
|
lines = []
|
233
239
|
yieldreturn_tags.each do |r|
|
234
240
|
l = "*"
|
@@ -236,12 +242,12 @@ module Solargraph
|
|
236
242
|
l += " #{r.text}"
|
237
243
|
lines.push l
|
238
244
|
end
|
239
|
-
|
245
|
+
method_docs += lines.join("\n")
|
240
246
|
end
|
241
247
|
return_tags = docstring.tags(:return)
|
242
248
|
unless return_tags.empty?
|
243
|
-
|
244
|
-
|
249
|
+
method_docs += "\n\n" unless method_docs.empty?
|
250
|
+
method_docs += "Returns:\n"
|
245
251
|
lines = []
|
246
252
|
return_tags.each do |r|
|
247
253
|
l = "*"
|
@@ -249,10 +255,11 @@ module Solargraph
|
|
249
255
|
l += " #{r.text}"
|
250
256
|
lines.push l
|
251
257
|
end
|
252
|
-
|
258
|
+
method_docs += lines.join("\n")
|
253
259
|
end
|
254
|
-
|
255
|
-
|
260
|
+
method_docs += "\n\n" unless method_docs.empty?
|
261
|
+
method_docs += "Visibility: #{visibility}"
|
262
|
+
@documentation = method_docs
|
256
263
|
concat_example_tags
|
257
264
|
end
|
258
265
|
@documentation.to_s
|
@@ -302,10 +309,12 @@ module Solargraph
|
|
302
309
|
name: name,
|
303
310
|
decl: decl,
|
304
311
|
presence: location ? location.range : nil,
|
305
|
-
return_type: param_type_from_name(tag, src.first)
|
312
|
+
return_type: param_type_from_name(tag, src.first),
|
313
|
+
source: :overloads
|
306
314
|
)
|
307
315
|
end,
|
308
|
-
return_type: ComplexType.try_parse(*tag.docstring.tags(:return).flat_map(&:types))
|
316
|
+
return_type: ComplexType.try_parse(*tag.docstring.tags(:return).flat_map(&:types)),
|
317
|
+
source: :overloads,
|
309
318
|
)
|
310
319
|
end
|
311
320
|
@overloads
|
@@ -315,7 +324,7 @@ module Solargraph
|
|
315
324
|
@anon_splat
|
316
325
|
end
|
317
326
|
|
318
|
-
# @param [ApiMap]
|
327
|
+
# @param api_map [ApiMap]
|
319
328
|
# @return [self]
|
320
329
|
def resolve_ref_tag api_map
|
321
330
|
return self if @resolved_ref_tag
|
@@ -342,8 +351,6 @@ module Solargraph
|
|
342
351
|
|
343
352
|
attr_writer :block
|
344
353
|
|
345
|
-
attr_writer :signatures
|
346
|
-
|
347
354
|
attr_writer :signature_help
|
348
355
|
|
349
356
|
attr_writer :documentation
|
@@ -521,7 +528,7 @@ module Solargraph
|
|
521
528
|
|
522
529
|
protected
|
523
530
|
|
524
|
-
attr_writer :
|
531
|
+
attr_writer :return_type
|
525
532
|
end
|
526
533
|
end
|
527
534
|
end
|
@@ -11,44 +11,52 @@ module Solargraph
|
|
11
11
|
# @return [::Symbol] :class or :module
|
12
12
|
attr_reader :type
|
13
13
|
|
14
|
+
# does not assert like super, as a namespace without a closure
|
15
|
+
# may be the root level namespace, or it may not yet be
|
16
|
+
# qualified
|
17
|
+
attr_reader :closure
|
18
|
+
|
14
19
|
# @param type [::Symbol] :class or :module
|
15
20
|
# @param visibility [::Symbol] :public or :private
|
16
21
|
# @param gates [::Array<String>]
|
17
|
-
|
22
|
+
# @param name [String]
|
23
|
+
def initialize type: :class, visibility: :public, gates: [''], name: '', **splat
|
18
24
|
# super(location, namespace, name, comments)
|
19
|
-
super(**splat)
|
25
|
+
super(**splat, name: name)
|
20
26
|
@type = type
|
21
27
|
@visibility = visibility
|
22
28
|
if name.start_with?('::')
|
23
|
-
@
|
29
|
+
# @type [String]
|
30
|
+
name = name[2..-1] || ''
|
24
31
|
@closure = Solargraph::Pin::ROOT_PIN
|
25
32
|
end
|
26
33
|
@open_gates = gates
|
27
|
-
if
|
34
|
+
if name.include?('::')
|
28
35
|
# In this case, a chained namespace was opened (e.g., Foo::Bar)
|
29
36
|
# but Foo does not exist.
|
30
|
-
parts =
|
31
|
-
|
37
|
+
parts = name.split('::')
|
38
|
+
name = parts.pop
|
32
39
|
closure_name = if [Solargraph::Pin::ROOT_PIN, nil].include?(closure)
|
33
40
|
''
|
34
41
|
else
|
35
42
|
closure.full_context.namespace + '::'
|
36
43
|
end
|
37
44
|
closure_name += parts.join('::')
|
38
|
-
@closure = Pin::Namespace.new(name: closure_name, gates: [parts.join('::')])
|
45
|
+
@closure = Pin::Namespace.new(name: closure_name, gates: [parts.join('::')], source: :namespace)
|
39
46
|
@context = nil
|
40
47
|
end
|
48
|
+
@name = name
|
41
49
|
end
|
42
50
|
|
43
51
|
def to_rbs
|
44
52
|
"#{@type.to_s} #{return_type.all_params.first.to_rbs}#{rbs_generics}".strip
|
45
53
|
end
|
46
54
|
|
47
|
-
def
|
55
|
+
def inner_desc
|
48
56
|
if name.nil? || name.empty?
|
49
57
|
'(top-level)'
|
50
58
|
else
|
51
|
-
|
59
|
+
super
|
52
60
|
end
|
53
61
|
end
|
54
62
|
|
@@ -9,14 +9,16 @@ module Solargraph
|
|
9
9
|
# @return [String]
|
10
10
|
attr_reader :asgn_code
|
11
11
|
|
12
|
+
# allow this to be set to the method after the method itself has
|
13
|
+
# been created
|
14
|
+
attr_writer :closure
|
15
|
+
|
12
16
|
# @param decl [::Symbol] :arg, :optarg, :kwarg, :kwoptarg, :restarg, :kwrestarg, :block, :blockarg
|
13
17
|
# @param asgn_code [String, nil]
|
14
|
-
|
15
|
-
def initialize decl: :arg, asgn_code: nil, return_type: nil, **splat
|
18
|
+
def initialize decl: :arg, asgn_code: nil, **splat
|
16
19
|
super(**splat)
|
17
20
|
@asgn_code = asgn_code
|
18
21
|
@decl = decl
|
19
|
-
@return_type = return_type
|
20
22
|
end
|
21
23
|
|
22
24
|
def keyword?
|
@@ -115,6 +117,15 @@ module Solargraph
|
|
115
117
|
closure.is_a?(Pin::Block) ? typify_block_param(api_map) : typify_method_param(api_map)
|
116
118
|
end
|
117
119
|
|
120
|
+
# @param atype [ComplexType]
|
121
|
+
# @param api_map [ApiMap]
|
122
|
+
def compatible_arg?(atype, api_map)
|
123
|
+
# make sure we get types from up the method
|
124
|
+
# inheritance chain if we don't have them on this pin
|
125
|
+
ptype = typify api_map
|
126
|
+
ptype.undefined? || ptype.can_assign?(api_map, atype) || ptype.generic?
|
127
|
+
end
|
128
|
+
|
118
129
|
def documentation
|
119
130
|
tag = param_tag
|
120
131
|
return '' if tag.nil? || tag.text.nil?
|
@@ -141,8 +152,9 @@ module Solargraph
|
|
141
152
|
# @param api_map [ApiMap]
|
142
153
|
# @return [ComplexType]
|
143
154
|
def typify_block_param api_map
|
144
|
-
|
145
|
-
|
155
|
+
block_pin = closure
|
156
|
+
if block_pin.is_a?(Pin::Block) && block_pin.receiver
|
157
|
+
return block_pin.typify_parameters(api_map)[index]
|
146
158
|
end
|
147
159
|
ComplexType::UNDEFINED
|
148
160
|
end
|
@@ -4,24 +4,30 @@ module Solargraph
|
|
4
4
|
module Pin
|
5
5
|
class ProxyType < Base
|
6
6
|
# @param return_type [ComplexType]
|
7
|
-
def initialize return_type: ComplexType::UNDEFINED, **splat
|
7
|
+
def initialize return_type: ComplexType::UNDEFINED, binder: nil, **splat
|
8
8
|
super(**splat)
|
9
9
|
@return_type = return_type
|
10
|
+
@binder = binder if binder
|
10
11
|
end
|
11
12
|
|
12
13
|
def context
|
13
14
|
@return_type
|
14
15
|
end
|
15
16
|
|
16
|
-
# @param
|
17
|
+
# @param context [ComplexType, ComplexType::UniqueType] Used as context for this pin
|
18
|
+
# @param closure [Pin::Namespace, nil] Used as the closure for this pin
|
19
|
+
# @param binder [ComplexType, ComplexType::UniqueType, nil]
|
17
20
|
# @return [ProxyType]
|
18
|
-
def self.anonymous
|
19
|
-
|
20
|
-
|
21
|
+
def self.anonymous context, closure: nil, binder: nil, **kwargs
|
22
|
+
unless closure
|
23
|
+
parts = context.namespace.split('::')
|
24
|
+
namespace = parts[0..-2].join('::').to_s
|
25
|
+
closure = Solargraph::Pin::Namespace.new(name: namespace, source: :proxy_type)
|
26
|
+
end
|
21
27
|
# name = parts.last.to_s
|
22
28
|
# ProxyType.new(nil, namespace, name, return_type)
|
23
29
|
ProxyType.new(
|
24
|
-
closure:
|
30
|
+
closure: closure, return_type: context, binder: binder || context, **kwargs
|
25
31
|
)
|
26
32
|
end
|
27
33
|
end
|
@@ -10,18 +10,22 @@ module Solargraph
|
|
10
10
|
# @return [::Array<Symbol>]
|
11
11
|
attr_reader :delete
|
12
12
|
|
13
|
-
def
|
14
|
-
|
13
|
+
def closure
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize location, name, tags, delete = [], **splat
|
18
|
+
super(location: location, name: name, **splat)
|
15
19
|
@tags = tags
|
16
20
|
@delete = delete
|
17
21
|
end
|
18
22
|
|
19
|
-
def self.method_return name, *tags, delete: []
|
20
|
-
new(nil, name, [YARD::Tags::Tag.new('return', nil, tags)], delete)
|
23
|
+
def self.method_return name, *tags, delete: [], **splat
|
24
|
+
new(nil, name, [YARD::Tags::Tag.new('return', nil, tags)], delete, **splat)
|
21
25
|
end
|
22
26
|
|
23
|
-
def self.from_comment name, comment
|
24
|
-
new(nil, name, Solargraph::Source.parse_docstring(comment).to_docstring.tags)
|
27
|
+
def self.from_comment name, comment, **splat
|
28
|
+
new(nil, name, Solargraph::Source.parse_docstring(comment).to_docstring.tags, **splat)
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
@@ -4,9 +4,9 @@ module Solargraph
|
|
4
4
|
module Pin
|
5
5
|
class Reference
|
6
6
|
class Require < Reference
|
7
|
-
def initialize location, name
|
7
|
+
def initialize location, name, **splat
|
8
8
|
# super(location, '', name)
|
9
|
-
super(location: location, name: name)
|
9
|
+
super(location: location, name: name, closure: Pin::ROOT_PIN, **splat)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -5,8 +5,9 @@ module Solargraph
|
|
5
5
|
class Symbol < Base
|
6
6
|
# @param location [Solargraph::Location]
|
7
7
|
# @param name [String]
|
8
|
-
def initialize
|
9
|
-
|
8
|
+
def initialize(location, name, **kwargs)
|
9
|
+
# @sg-ignore "Unrecognized keyword argument kwargs to Solargraph::Pin::Base#initialize"
|
10
|
+
super(location: location, name: name, **kwargs)
|
10
11
|
# @name = name
|
11
12
|
# @location = location
|
12
13
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
module Pin
|
5
|
+
class Until < Base
|
6
|
+
include Breakable
|
7
|
+
|
8
|
+
# @param receiver [Parser::AST::Node, nil]
|
9
|
+
# @param node [Parser::AST::Node, nil]
|
10
|
+
# @param context [ComplexType, nil]
|
11
|
+
# @param args [::Array<Parameter>]
|
12
|
+
def initialize node: nil, **splat
|
13
|
+
super(**splat)
|
14
|
+
@node = node
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
module Pin
|
5
|
+
class While < Base
|
6
|
+
include Breakable
|
7
|
+
|
8
|
+
# @param receiver [Parser::AST::Node, nil]
|
9
|
+
# @param node [Parser::AST::Node, nil]
|
10
|
+
# @param context [ComplexType, nil]
|
11
|
+
# @param args [::Array<Parameter>]
|
12
|
+
def initialize node: nil, **splat
|
13
|
+
super(**splat)
|
14
|
+
@node = node
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/solargraph/pin.rb
CHANGED
@@ -34,8 +34,11 @@ module Solargraph
|
|
34
34
|
autoload :Singleton, 'solargraph/pin/singleton'
|
35
35
|
autoload :KeywordParam, 'solargraph/pin/keyword_param'
|
36
36
|
autoload :Search, 'solargraph/pin/search'
|
37
|
+
autoload :Breakable, 'solargraph/pin/breakable'
|
38
|
+
autoload :Until, 'solargraph/pin/until'
|
39
|
+
autoload :While, 'solargraph/pin/while'
|
37
40
|
autoload :Callable, 'solargraph/pin/callable'
|
38
41
|
|
39
|
-
ROOT_PIN = Pin::Namespace.new(type: :class, name: '', closure: nil)
|
42
|
+
ROOT_PIN = Pin::Namespace.new(type: :class, name: '', closure: nil, source: :pin_rb)
|
40
43
|
end
|
41
44
|
end
|