solargraph 0.40.3 → 0.40.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/CHANGELOG.md +5 -0
- data/lib/solargraph/api_map/store.rb +5 -0
- data/lib/solargraph/parser/rubyvm/node_processors/args_node.rb +11 -11
- data/lib/solargraph/parser/rubyvm/node_processors/opt_arg_node.rb +1 -6
- data/lib/solargraph/source.rb +1 -1
- data/lib/solargraph/source/source_chainer.rb +1 -1
- data/lib/solargraph/type_checker.rb +2 -2
- 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: eff7d664014ae6d25990957afb4328baafe88ff76ef892db8b3d50791860845e
|
4
|
+
data.tar.gz: 8038c884a63ce269f1a0faaf635e4c295fadd61c456ba2665c84a17b4f03a031
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7b95e2ba342b191642a1d5ea228243a60b9211f6c05cab2acf09ddcaab3efb25cef488ca910964e0ac1c32edacc2f0ced4eef09fa819b03d2919af4ac734ca7
|
7
|
+
data.tar.gz: 6990c07591d43fdb583484c00fc5221d228850fa75e12b5cd2632413a21c1984f634ce2655371d9be7016a035e23fe622469418779bf3285f03a087a38c394ae
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 0.40.4 - March 3, 2021
|
2
|
+
- Fix optarg and blockarg ordering
|
3
|
+
- Override specialization for #initialize
|
4
|
+
- Find definitions with cursor after double colon
|
5
|
+
|
1
6
|
## 0.40.3 - February 7, 2021
|
2
7
|
- Simplify and allow to configure rubocop formatter (#403)
|
3
8
|
- Type checker shows tag in param type errors (#398)
|
@@ -238,11 +238,16 @@ module Solargraph
|
|
238
238
|
pins_by_class(Pin::Reference::Override).each do |ovr|
|
239
239
|
pin = get_path_pins(ovr.name).first
|
240
240
|
next if pin.nil?
|
241
|
+
new_pin = if pin.path.end_with?('#initialize')
|
242
|
+
get_path_pins(pin.path.sub(/#initialize/, '.new')).first
|
243
|
+
end
|
241
244
|
(ovr.tags.map(&:tag_name) + ovr.delete).uniq.each do |tag|
|
242
245
|
pin.docstring.delete_tags tag.to_sym
|
246
|
+
new_pin.docstring.delete_tags tag.to_sym if new_pin
|
243
247
|
end
|
244
248
|
ovr.tags.each do |tag|
|
245
249
|
pin.docstring.add_tag(tag)
|
250
|
+
new_pin.docstring.add_tag(tag) if new_pin
|
246
251
|
end
|
247
252
|
end
|
248
253
|
end
|
@@ -55,19 +55,19 @@ module Solargraph
|
|
55
55
|
)
|
56
56
|
region.closure.parameters.push locals.last
|
57
57
|
end
|
58
|
-
if node.children.last
|
59
|
-
locals.push Solargraph::Pin::Parameter.new(
|
60
|
-
location: region.closure.location,
|
61
|
-
closure: region.closure,
|
62
|
-
comments: comments_for(node),
|
63
|
-
name: node.children.last.to_s,
|
64
|
-
presence: region.closure.location.range,
|
65
|
-
decl: :blockarg
|
66
|
-
)
|
67
|
-
region.closure.parameters.push locals.last
|
68
|
-
end
|
69
58
|
end
|
70
59
|
process_children
|
60
|
+
if node.children.last
|
61
|
+
locals.push Solargraph::Pin::Parameter.new(
|
62
|
+
location: region.closure.location,
|
63
|
+
closure: region.closure,
|
64
|
+
comments: comments_for(node),
|
65
|
+
name: node.children.last.to_s,
|
66
|
+
presence: region.closure.location.range,
|
67
|
+
decl: :blockarg
|
68
|
+
)
|
69
|
+
region.closure.parameters.push locals.last
|
70
|
+
end
|
71
71
|
end
|
72
72
|
|
73
73
|
private
|
@@ -16,12 +16,7 @@ module Solargraph
|
|
16
16
|
presence: region.closure.location.range,
|
17
17
|
decl: :optarg
|
18
18
|
)
|
19
|
-
|
20
|
-
if idx
|
21
|
-
region.closure.parameters.insert idx, locals.last
|
22
|
-
else
|
23
|
-
region.closure.parameters.push locals.last
|
24
|
-
end
|
19
|
+
region.closure.parameters.push locals.last
|
25
20
|
node.children[1] && NodeProcessor.process(node.children[1], region, pins, locals)
|
26
21
|
end
|
27
22
|
end
|
data/lib/solargraph/source.rb
CHANGED
@@ -64,7 +64,7 @@ module Solargraph
|
|
64
64
|
elsif end_of_phrase.strip == '::'
|
65
65
|
chain.links.push Chain::UNDEFINED_CONSTANT
|
66
66
|
end
|
67
|
-
elsif chain.links.last.is_a?(Source::Chain::Constant) && end_of_phrase.strip == '::'
|
67
|
+
elsif chain.links.last.is_a?(Source::Chain::Constant) && end_of_phrase.strip == '::' && !source.code[Position.to_offset(source.code, position)].match?(/[a-z]/i)
|
68
68
|
chain.links.push Source::Chain::UNDEFINED_CONSTANT
|
69
69
|
end
|
70
70
|
chain
|
@@ -95,7 +95,7 @@ module Solargraph
|
|
95
95
|
result.push Problem.new(pin.location, "Untyped method #{pin.path} could not be inferred")
|
96
96
|
end
|
97
97
|
elsif rules.validate_tags?
|
98
|
-
unless pin.node.nil? || declared.void? ||
|
98
|
+
unless pin.node.nil? || declared.void? || virtual_pin?(pin) || abstract?(pin)
|
99
99
|
inferred = pin.probe(api_map).self_to(pin.full_context.namespace)
|
100
100
|
if inferred.undefined?
|
101
101
|
unless rules.ignore_all_undefined? || external?(pin)
|
@@ -111,7 +111,7 @@ module Solargraph
|
|
111
111
|
result
|
112
112
|
end
|
113
113
|
|
114
|
-
def
|
114
|
+
def virtual_pin? pin
|
115
115
|
pin.location && source_map.source.comment_at?(pin.location.range.ending)
|
116
116
|
end
|
117
117
|
|
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.40.
|
4
|
+
version: 0.40.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Snyder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backport
|