solargraph 0.23.5 → 0.23.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/solargraph +0 -0
- data/bin/solargraph-runtime +0 -0
- data/lib/solargraph.rb +0 -0
- data/lib/solargraph/api_map.rb +0 -0
- data/lib/solargraph/api_map/probe.rb +1 -1
- data/lib/solargraph/api_map/source_to_yard.rb +1 -6
- data/lib/solargraph/language_server/message/initialize.rb +5 -1
- data/lib/solargraph/language_server/message/text_document/did_save.rb +3 -1
- data/lib/solargraph/pin/attribute.rb +5 -0
- data/lib/solargraph/pin/yard_object.rb +1 -2
- data/lib/solargraph/shell.rb +0 -0
- data/lib/solargraph/source.rb +24 -13
- data/lib/solargraph/source/fragment.rb +1 -1
- data/lib/solargraph/version.rb +1 -1
- data/lib/solargraph/yard_map.rb +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5b6ac3cd79425340ddf486c9b3447115553a374a3c782d8c8a103825b4461b9
|
4
|
+
data.tar.gz: 4561568bb8075f955777c2a17a2a19a91c14b198df6c8f5798168b01abdeac19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489953a5c791e8475b217b4033a502196a1d0aa0112f5d778ce2dba9ed488e773b867fb596ca02a1f81a6143b426d54007ab0448f979d1c9ad98344034fa96a1
|
7
|
+
data.tar.gz: 390e4c2bf98f7733232f551749114229afb6e4f7271ac1792e2034cd223de6e0b636ab001281ad225b7f8267b0a8e1e48e927be0a88bab63a4ded3c7779e3bc3
|
data/bin/solargraph
CHANGED
File without changes
|
data/bin/solargraph-runtime
CHANGED
File without changes
|
data/lib/solargraph.rb
CHANGED
File without changes
|
data/lib/solargraph/api_map.rb
CHANGED
File without changes
|
@@ -48,7 +48,7 @@ module Solargraph
|
|
48
48
|
def infer_signature_type signature, context_pin, locals
|
49
49
|
pins = infer_signature_pins(signature, context_pin, locals)
|
50
50
|
pins.each do |pin|
|
51
|
-
return pin.return_type unless pin.return_type.nil?
|
51
|
+
return qualify(pin.return_type, pin.named_context) unless pin.return_type.nil?
|
52
52
|
type = resolve_pin_type(pin, locals - [pin])
|
53
53
|
return qualify(type, pin.named_context) unless type.nil?
|
54
54
|
end
|
@@ -32,15 +32,10 @@ module Solargraph
|
|
32
32
|
code_object_map[pin.path].instance_mixins.push code_object_map[ref.name] unless code_object_map[ref.name].nil? or code_object_map[pin.path].nil?
|
33
33
|
end
|
34
34
|
end
|
35
|
-
s.attribute_pins.each do |pin|
|
36
|
-
code_object_map[pin.path] ||= YARD::CodeObjects::MethodObject.new(code_object_at(pin.namespace), pin.name, :instance)
|
37
|
-
code_object_map[pin.path].docstring = pin.docstring unless pin.docstring.nil?
|
38
|
-
code_object_map[pin.path].files.push pin.location.filename
|
39
|
-
#code_object_map[pin.path].parameters = []
|
40
|
-
end
|
41
35
|
s.method_pins.each do |pin|
|
42
36
|
code_object_map[pin.path] ||= YARD::CodeObjects::MethodObject.new(code_object_at(pin.namespace), pin.name, pin.scope)
|
43
37
|
code_object_map[pin.path].docstring = pin.docstring unless pin.docstring.nil?
|
38
|
+
code_object_map[pin.path].visibility = pin.visibility || :public
|
44
39
|
code_object_map[pin.path].files.push pin.location.filename
|
45
40
|
code_object_map[pin.path].parameters = pin.parameters.map do |p|
|
46
41
|
n = p.match(/^[a-z0-9_]*:?/i)[0]
|
@@ -4,7 +4,11 @@ module Solargraph
|
|
4
4
|
class Initialize < Base
|
5
5
|
def process
|
6
6
|
host.configure params['initializationOptions']
|
7
|
-
|
7
|
+
if params['rootUri']
|
8
|
+
host.prepare UriHelpers.uri_to_file(params['rootUri'])
|
9
|
+
else
|
10
|
+
host.prepare params['rootPath']
|
11
|
+
end
|
8
12
|
result = {
|
9
13
|
capabilities: {
|
10
14
|
textDocumentSync: 2, # @todo What should this be?
|
@@ -4,7 +4,9 @@ module Solargraph
|
|
4
4
|
module TextDocument
|
5
5
|
class DidSave < Base
|
6
6
|
def process
|
7
|
-
|
7
|
+
# @todo The server might not need to do anything in response to
|
8
|
+
# this notification. See https://github.com/castwide/solargraph/issues/73
|
9
|
+
# host.save params
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
@@ -42,7 +42,6 @@ module Solargraph
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def return_type
|
45
|
-
# @todo Get the return type
|
46
45
|
if @return_type.nil?
|
47
46
|
if code_object.kind_of?(YARD::CodeObjects::ClassObject)
|
48
47
|
@return_type ||= "Class<#{path}>"
|
@@ -51,7 +50,7 @@ module Solargraph
|
|
51
50
|
if code_object.kind_of?(YARD::CodeObjects::ModuleObject)
|
52
51
|
@return_type ||= "Module<#{path}>"
|
53
52
|
return @return_type
|
54
|
-
end
|
53
|
+
end
|
55
54
|
if Solargraph::CoreFills::CUSTOM_RETURN_TYPES.has_key?(path)
|
56
55
|
@return_type = Solargraph::CoreFills::CUSTOM_RETURN_TYPES[path]
|
57
56
|
else
|
data/lib/solargraph/shell.rb
CHANGED
File without changes
|
data/lib/solargraph/source.rb
CHANGED
@@ -49,10 +49,13 @@ module Solargraph
|
|
49
49
|
|
50
50
|
attr_reader :domains
|
51
51
|
|
52
|
+
# @return [Array<Solargraph::Pin::Base>]
|
52
53
|
attr_reader :locals
|
53
54
|
|
54
55
|
include NodeMethods
|
55
56
|
|
57
|
+
# @param code [String]
|
58
|
+
# @param filename [String]
|
56
59
|
def initialize code, filename = nil
|
57
60
|
begin
|
58
61
|
@code = code
|
@@ -141,6 +144,7 @@ module Solargraph
|
|
141
144
|
symbol_pins
|
142
145
|
end
|
143
146
|
|
147
|
+
# @param name [String]
|
144
148
|
# @return [Array<Source::Location>]
|
145
149
|
def references name
|
146
150
|
inner_node_references(name, node).map do |n|
|
@@ -202,19 +206,7 @@ module Solargraph
|
|
202
206
|
stack
|
203
207
|
end
|
204
208
|
|
205
|
-
|
206
|
-
return if node.nil?
|
207
|
-
stack.unshift node
|
208
|
-
node.children.each do |c|
|
209
|
-
next unless c.is_a?(AST::Node)
|
210
|
-
next if c.loc.expression.nil?
|
211
|
-
if offset >= c.loc.expression.begin_pos and offset < c.loc.expression.end_pos
|
212
|
-
inner_tree_at(c, offset, stack)
|
213
|
-
break
|
214
|
-
end
|
215
|
-
end
|
216
|
-
end
|
217
|
-
|
209
|
+
# @param updater [Source::Updater]
|
218
210
|
def synchronize updater
|
219
211
|
raise 'Invalid synchronization' unless updater.filename == filename
|
220
212
|
original_code = @code
|
@@ -236,12 +228,15 @@ module Solargraph
|
|
236
228
|
end
|
237
229
|
end
|
238
230
|
|
231
|
+
# @param query [String]
|
232
|
+
# @return [Array<Solargraph::Pin::Base>]
|
239
233
|
def query_symbols query
|
240
234
|
return [] if query.empty?
|
241
235
|
down = query.downcase
|
242
236
|
all_symbols.select{|p| p.path.downcase.include?(down)}
|
243
237
|
end
|
244
238
|
|
239
|
+
# @return [Array<Solargraph::Pin::Base>]
|
245
240
|
def all_symbols
|
246
241
|
@all_symbols ||= pins.select{ |pin|
|
247
242
|
[Pin::ATTRIBUTE, Pin::CONSTANT, Pin::METHOD, Pin::NAMESPACE].include?(pin.kind) and !pin.name.empty?
|
@@ -286,6 +281,19 @@ module Solargraph
|
|
286
281
|
result
|
287
282
|
end
|
288
283
|
|
284
|
+
def inner_tree_at node, offset, stack
|
285
|
+
return if node.nil?
|
286
|
+
stack.unshift node
|
287
|
+
node.children.each do |c|
|
288
|
+
next unless c.is_a?(AST::Node)
|
289
|
+
next if c.loc.expression.nil?
|
290
|
+
if offset >= c.loc.expression.begin_pos and offset < c.loc.expression.end_pos
|
291
|
+
inner_tree_at(c, offset, stack)
|
292
|
+
break
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
289
297
|
def parse
|
290
298
|
node, comments = inner_parse(@fixed, filename)
|
291
299
|
@node = node
|
@@ -318,12 +326,15 @@ module Solargraph
|
|
318
326
|
end
|
319
327
|
|
320
328
|
class << self
|
329
|
+
# @param filename [String]
|
321
330
|
# @return [Solargraph::Source]
|
322
331
|
def load filename
|
323
332
|
code = File.read(filename)
|
324
333
|
Source.load_string(code, filename)
|
325
334
|
end
|
326
335
|
|
336
|
+
# @param code [String]
|
337
|
+
# @param filename [String]
|
327
338
|
# @return [Solargraph::Source]
|
328
339
|
def load_string code, filename = nil
|
329
340
|
Source.new code, filename
|
@@ -319,7 +319,7 @@ module Solargraph
|
|
319
319
|
brackets += 1
|
320
320
|
elsif char == '['
|
321
321
|
squares += 1
|
322
|
-
signature = ".[]#{signature}" if
|
322
|
+
signature = ".[]#{signature}" if parens.zero? and brackets.zero? and squares.zero? and @code[index-2] != '%'
|
323
323
|
end
|
324
324
|
if brackets.zero? and parens.zero? and squares.zero?
|
325
325
|
break if ['"', "'", ',', ';', '%'].include?(char)
|
data/lib/solargraph/version.rb
CHANGED
data/lib/solargraph/yard_map.rb
CHANGED
File without changes
|
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.6
|
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-
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -376,7 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
376
376
|
version: '0'
|
377
377
|
requirements: []
|
378
378
|
rubyforge_project:
|
379
|
-
rubygems_version: 2.7.
|
379
|
+
rubygems_version: 2.7.6
|
380
380
|
signing_key:
|
381
381
|
specification_version: 4
|
382
382
|
summary: Solargraph for Ruby
|