solargraph 0.39.13 → 0.39.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/solargraph/convention.rb +1 -1
- data/lib/solargraph/core_fills.rb +1 -0
- data/lib/solargraph/parser/rubyvm/node_methods.rb +1 -1
- data/lib/solargraph/parser/rubyvm/node_processors.rb +1 -0
- data/lib/solargraph/parser/rubyvm/node_processors/args_node.rb +34 -10
- data/lib/solargraph/shell.rb +1 -0
- data/lib/solargraph/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ec8cbe63061b570e7d0fb984e1a4a15ed40c265e34fb6bd7d027f859d32a4d4
|
4
|
+
data.tar.gz: 93e53c212c5c608b0ecdea34ce7771213b92c75917cf110673e5a4fa1f3f785e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0e7c03a9f231ebe695cf95150402a525fe0e3abfedb82dc6cd275e58e64170814dde79a24c03f02ff4f2477dacfef7a64ed71006a54e5b30abd5b27a7d7afcd
|
7
|
+
data.tar.gz: b78c8f4bf6f7f0f291391fdc1e9c6a95376f51801426efdb7a17b6c0eed380056074df02321dd61a34d1afb82ccae52ba97fba383388d962ede99bd9e3e753ed
|
@@ -197,7 +197,7 @@ module Solargraph
|
|
197
197
|
result.push node
|
198
198
|
result.concat get_return_nodes_only(node.children[1])
|
199
199
|
elsif node.type == :CASE
|
200
|
-
node.children.each do |cc|
|
200
|
+
node.children[1..-1].each do |cc|
|
201
201
|
result.concat reduce_to_value_nodes(cc.children[1..-1])
|
202
202
|
end
|
203
203
|
else
|
@@ -54,6 +54,7 @@ module Solargraph
|
|
54
54
|
register :KW_ARG, Rubyvm::NodeProcessors::KwArgNode
|
55
55
|
register :ITER, Rubyvm::NodeProcessors::BlockNode
|
56
56
|
register :LAMBDA, Rubyvm::NodeProcessors::BlockNode
|
57
|
+
register :FOR, Rubyvm::NodeProcessors::BlockNode
|
57
58
|
register :OP_ASGN_OR, Rubyvm::NodeProcessors::OrasgnNode
|
58
59
|
register :LIT, Rubyvm::NodeProcessors::LitNode
|
59
60
|
end
|
@@ -7,16 +7,30 @@ module Solargraph
|
|
7
7
|
class ArgsNode < Parser::NodeProcessor::Base
|
8
8
|
def process
|
9
9
|
if region.closure.is_a?(Pin::BaseMethod) || region.closure.is_a?(Pin::Block)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
if region.lvars[0].nil?
|
11
|
+
node.children[0].times do |i|
|
12
|
+
locals.push Solargraph::Pin::Parameter.new(
|
13
|
+
location: region.closure.location,
|
14
|
+
closure: region.closure,
|
15
|
+
comments: comments_for(node),
|
16
|
+
name: extract_name(node.children[i + 1]),
|
17
|
+
presence: region.closure.location.range,
|
18
|
+
decl: :arg
|
19
|
+
)
|
20
|
+
region.closure.parameters.push locals.last
|
21
|
+
end
|
22
|
+
else
|
23
|
+
node.children[0].times do |i|
|
24
|
+
locals.push Solargraph::Pin::Parameter.new(
|
25
|
+
location: region.closure.location,
|
26
|
+
closure: region.closure,
|
27
|
+
comments: comments_for(node),
|
28
|
+
name: region.lvars[i].to_s,
|
29
|
+
presence: region.closure.location.range,
|
30
|
+
decl: :arg
|
31
|
+
)
|
32
|
+
region.closure.parameters.push locals.last
|
33
|
+
end
|
20
34
|
end
|
21
35
|
# @todo Optional args, keyword args, etc.
|
22
36
|
if node.children[6]
|
@@ -55,6 +69,16 @@ module Solargraph
|
|
55
69
|
end
|
56
70
|
process_children
|
57
71
|
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
def extract_name var
|
76
|
+
if Parser.is_ast_node?(var)
|
77
|
+
var.children[0].to_s
|
78
|
+
else
|
79
|
+
var.to_s
|
80
|
+
end
|
81
|
+
end
|
58
82
|
end
|
59
83
|
end
|
60
84
|
end
|
data/lib/solargraph/shell.rb
CHANGED
@@ -153,6 +153,7 @@ module Solargraph
|
|
153
153
|
probcount += problems.length
|
154
154
|
end
|
155
155
|
puts "#{probcount} problem#{probcount != 1 ? 's' : ''} found#{files.length != 1 ? " in #{filecount} of #{files.length} files" : ''}."
|
156
|
+
exit 1 if probcount.positive?
|
156
157
|
end
|
157
158
|
|
158
159
|
desc 'scan', 'Test the workspace for problems'
|
data/lib/solargraph/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solargraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.39.
|
4
|
+
version: 0.39.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Snyder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backport
|