solargraph 0.23.3 → 0.23.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/lib/solargraph/pin/attribute.rb +6 -0
- data/lib/solargraph/source.rb +15 -17
- data/lib/solargraph/source/mapper.rb +1 -1
- 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: 3d2dc2283964f7972f289ef9aa43a939948049b02d351f244ec522afc1033265
|
4
|
+
data.tar.gz: 8e60c7d6d9a3f7bd25fcbc66566c1ce795b3b8999572b454e6d07a027460ec4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ffd40c951fb253bef3653525c9cbf10362582c292c529559b59698a1636939ed589fe76d9eacb01b26f6e7340c4f854d557fff0bd94a34e4b9d277196c3e637
|
7
|
+
data.tar.gz: d589e62eb1024c07eb2bd15cde0f29552a07089fa812b2508c51ad701622b1ab59e783b69f2cb4bc40645044c514f6167e83f2b1c3064c7eea8c372aad95c380
|
data/lib/solargraph/source.rb
CHANGED
@@ -93,7 +93,7 @@ module Solargraph
|
|
93
93
|
# @param fqns [String] The namespace (nil for all)
|
94
94
|
# @return [Array<Solargraph::Pin::Method>]
|
95
95
|
def method_pins fqns = nil
|
96
|
-
pins.select{|pin| pin.kind == Solargraph::Pin::METHOD}
|
96
|
+
pins.select{|pin| pin.kind == Solargraph::Pin::METHOD or pin.kind == Solargraph::Pin::ATTRIBUTE}
|
97
97
|
end
|
98
98
|
|
99
99
|
# @return [Array<Solargraph::Pin::Attribute>]
|
@@ -162,17 +162,6 @@ module Solargraph
|
|
162
162
|
_locate_pin line, character, Pin::NAMESPACE, Pin::METHOD, Pin::BLOCK
|
163
163
|
end
|
164
164
|
|
165
|
-
def _locate_pin line, character, *kinds
|
166
|
-
position = Solargraph::Source::Position.new(line, character)
|
167
|
-
found = nil
|
168
|
-
pins.each do |pin|
|
169
|
-
found = pin if (kinds.empty? or kinds.include?(pin.kind)) and pin.location.range.contain?(position)
|
170
|
-
break if pin.location.range.start.line > line
|
171
|
-
end
|
172
|
-
# @todo Assuming the root pin is always valid
|
173
|
-
found || pins.first
|
174
|
-
end
|
175
|
-
|
176
165
|
# Get the nearest node that contains the specified index.
|
177
166
|
#
|
178
167
|
# @param line [Integer]
|
@@ -242,11 +231,9 @@ module Solargraph
|
|
242
231
|
end
|
243
232
|
|
244
233
|
def all_symbols
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
result.concat constant_pins
|
249
|
-
result
|
234
|
+
@all_symbols ||= pins.select{ |pin|
|
235
|
+
[Pin::ATTRIBUTE, Pin::CONSTANT, Pin::METHOD, Pin::NAMESPACE].include?(pin.kind)
|
236
|
+
}
|
250
237
|
end
|
251
238
|
|
252
239
|
def locate_pin location
|
@@ -265,6 +252,17 @@ module Solargraph
|
|
265
252
|
|
266
253
|
private
|
267
254
|
|
255
|
+
def _locate_pin line, character, *kinds
|
256
|
+
position = Solargraph::Source::Position.new(line, character)
|
257
|
+
found = nil
|
258
|
+
pins.each do |pin|
|
259
|
+
found = pin if (kinds.empty? or kinds.include?(pin.kind)) and pin.location.range.contain?(position)
|
260
|
+
break if pin.location.range.start.line > line
|
261
|
+
end
|
262
|
+
# @todo Assuming the root pin is always valid
|
263
|
+
found || pins.first
|
264
|
+
end
|
265
|
+
|
268
266
|
def inner_node_references name, top
|
269
267
|
result = []
|
270
268
|
if top.kind_of?(AST::Node)
|
@@ -154,7 +154,7 @@ module Solargraph
|
|
154
154
|
here = get_node_start_position(c)
|
155
155
|
block = get_block_pin(here)
|
156
156
|
pins.push Solargraph::Pin::Constant.new(get_node_location(c), fqn, c.children[1].to_s, docstring_for(c), resolve_node_signature(c.children[2]), infer_literal_node_type(c.children[2]), block, :public)
|
157
|
-
elsif c.type == :def
|
157
|
+
elsif c.type == :def
|
158
158
|
methpin = Solargraph::Pin::Method.new(get_node_location(c), fqn || '', c.children[(c.type == :def ? 0 : 1)].to_s, docstring_for(c), scope, visibility, get_method_args(c))
|
159
159
|
if methpin.name == 'initialize' and methpin.scope == :instance
|
160
160
|
pins.push Solargraph::Pin::Method.new(methpin.location, methpin.namespace, 'new', methpin.docstring, :class, :public, methpin.parameters)
|
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.23.
|
4
|
+
version: 0.23.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: 2018-07-
|
11
|
+
date: 2018-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|