solargraph 0.29.1 → 0.29.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be265fd0b2ea3120f015047342056b5f09b4b94f24ff2929c951932055d03ed1
|
4
|
+
data.tar.gz: 963b915e3bd728fe9e6664ca124855d72eb219c9008b4a30b212703cbd32314f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 318104cf900c2f984a03a31a35034dae0552a0a097731c1cf0b62af95d871b717984502dc0cfccbeb28f6745290f1c6188efd06483597b24b99d7fd7355cdc6f
|
7
|
+
data.tar.gz: ecf023d2a603e78970ed3770fc0f7054701845dd6f0874173308c2243c618ec52664e1c839b2a0fc035f0a28782244ab972cb24530e7d32efddf620b10b146e2
|
data/lib/solargraph/api_map.rb
CHANGED
@@ -39,10 +39,7 @@ module Solargraph
|
|
39
39
|
@store = Store.new(pins + YardMap.new.pins)
|
40
40
|
@unresolved_requires = []
|
41
41
|
}
|
42
|
-
|
43
|
-
unless resolved.nil?
|
44
|
-
@mutex.synchronize { @store = Store.new(resolved) }
|
45
|
-
end
|
42
|
+
resolve_method_aliases
|
46
43
|
self
|
47
44
|
end
|
48
45
|
|
@@ -65,7 +62,8 @@ module Solargraph
|
|
65
62
|
# @return [self]
|
66
63
|
def catalog bundle
|
67
64
|
new_map_hash = {}
|
68
|
-
|
65
|
+
# Bundle always needs to be merged if it adds or removes sources
|
66
|
+
merged = (bundle.sources.length == source_map_hash.values.length)
|
69
67
|
bundle.sources.each do |source|
|
70
68
|
if source_map_hash.has_key?(source.filename)
|
71
69
|
if source_map_hash[source.filename].code == source.code
|
@@ -76,16 +74,16 @@ module Solargraph
|
|
76
74
|
new_map_hash[source.filename] = source_map_hash[source.filename]
|
77
75
|
else
|
78
76
|
new_map_hash[source.filename] = map
|
79
|
-
|
77
|
+
merged = false
|
80
78
|
end
|
81
79
|
end
|
82
80
|
else
|
83
81
|
map = Solargraph::SourceMap.map(source)
|
84
82
|
new_map_hash[source.filename] = map
|
85
|
-
|
83
|
+
merged = false
|
86
84
|
end
|
87
85
|
end
|
88
|
-
return self
|
86
|
+
return self if merged
|
89
87
|
pins = []
|
90
88
|
reqs = []
|
91
89
|
# @param map [SourceMap]
|
@@ -114,10 +112,7 @@ module Solargraph
|
|
114
112
|
@store = new_store
|
115
113
|
@unresolved_requires = yard_map.unresolved_requires
|
116
114
|
}
|
117
|
-
|
118
|
-
unless resolved.nil?
|
119
|
-
@mutex.synchronize { @store = Store.new(resolved) }
|
120
|
-
end
|
115
|
+
resolve_method_aliases
|
121
116
|
self
|
122
117
|
end
|
123
118
|
|
@@ -641,7 +636,7 @@ module Solargraph
|
|
641
636
|
false
|
642
637
|
end
|
643
638
|
|
644
|
-
# @return [
|
639
|
+
# @return [void]
|
645
640
|
def resolve_method_aliases
|
646
641
|
aliased = false
|
647
642
|
result = pins.map do |pin|
|
@@ -652,7 +647,7 @@ module Solargraph
|
|
652
647
|
Pin::Method.new(pin.location, pin.namespace, pin.name, origin.comments, origin.scope, origin.visibility, origin.parameters)
|
653
648
|
end
|
654
649
|
return nil unless aliased
|
655
|
-
result
|
650
|
+
@mutex.synchronize { @store = Store.new(result) }
|
656
651
|
end
|
657
652
|
end
|
658
653
|
end
|
@@ -4,65 +4,68 @@ module Solargraph
|
|
4
4
|
# parser nodes.
|
5
5
|
#
|
6
6
|
module NodeProcessor
|
7
|
-
autoload :Base,
|
8
|
-
autoload :BeginNode,
|
9
|
-
autoload :DefNode,
|
10
|
-
autoload :DefsNode,
|
11
|
-
autoload :SendNode,
|
12
|
-
autoload :NamespaceNode,
|
13
|
-
autoload :SclassNode,
|
14
|
-
autoload :ModuleNode,
|
15
|
-
autoload :IvasgnNode,
|
16
|
-
autoload :CvasgnNode,
|
17
|
-
autoload :LvasgnNode,
|
18
|
-
autoload :GvasgnNode,
|
19
|
-
autoload :CasgnNode,
|
20
|
-
autoload :AliasNode,
|
21
|
-
autoload :ArgsNode,
|
22
|
-
autoload :BlockNode,
|
23
|
-
autoload :OrasgnNode,
|
24
|
-
autoload :SymNode,
|
7
|
+
autoload :Base, 'solargraph/source_map/node_processor/base'
|
8
|
+
autoload :BeginNode, 'solargraph/source_map/node_processor/begin_node'
|
9
|
+
autoload :DefNode, 'solargraph/source_map/node_processor/def_node'
|
10
|
+
autoload :DefsNode, 'solargraph/source_map/node_processor/defs_node'
|
11
|
+
autoload :SendNode, 'solargraph/source_map/node_processor/send_node'
|
12
|
+
autoload :NamespaceNode, 'solargraph/source_map/node_processor/namespace_node'
|
13
|
+
autoload :SclassNode, 'solargraph/source_map/node_processor/sclass_node'
|
14
|
+
autoload :ModuleNode, 'solargraph/source_map/node_processor/module_node'
|
15
|
+
autoload :IvasgnNode, 'solargraph/source_map/node_processor/ivasgn_node'
|
16
|
+
autoload :CvasgnNode, 'solargraph/source_map/node_processor/cvasgn_node'
|
17
|
+
autoload :LvasgnNode, 'solargraph/source_map/node_processor/lvasgn_node'
|
18
|
+
autoload :GvasgnNode, 'solargraph/source_map/node_processor/gvasgn_node'
|
19
|
+
autoload :CasgnNode, 'solargraph/source_map/node_processor/casgn_node'
|
20
|
+
autoload :AliasNode, 'solargraph/source_map/node_processor/alias_node'
|
21
|
+
autoload :ArgsNode, 'solargraph/source_map/node_processor/args_node'
|
22
|
+
autoload :BlockNode, 'solargraph/source_map/node_processor/block_node'
|
23
|
+
autoload :OrasgnNode, 'solargraph/source_map/node_processor/orasgn_node'
|
24
|
+
autoload :SymNode, 'solargraph/source_map/node_processor/sym_node'
|
25
25
|
|
26
26
|
class << self
|
27
27
|
@@processors ||= {}
|
28
28
|
|
29
29
|
private
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
# Register a processor for a node type.
|
32
|
+
#
|
33
|
+
# @param type [Symbol]
|
34
|
+
# @param cls [Class<NodeProcessor::Base>]
|
35
|
+
# @return [Class<NodeProcessor::Base>]
|
36
|
+
def register type, cls
|
37
|
+
@@processors[type] = cls
|
33
38
|
end
|
34
39
|
end
|
35
40
|
|
36
|
-
register :source,
|
37
|
-
register :begin,
|
41
|
+
register :source, BeginNode
|
42
|
+
register :begin, BeginNode
|
38
43
|
register :kwbegin, BeginNode
|
39
44
|
# # @todo Is this the best way to handle rescue nodes?
|
40
|
-
register :rescue,
|
45
|
+
register :rescue, BeginNode
|
41
46
|
register :resbody, BeginNode
|
42
|
-
register :def,
|
43
|
-
register :defs,
|
44
|
-
register :send,
|
45
|
-
register :class,
|
46
|
-
register :module,
|
47
|
-
register :sclass,
|
48
|
-
register :ivasgn,
|
49
|
-
register :cvasgn,
|
50
|
-
register :lvasgn,
|
51
|
-
register :gvasgn,
|
52
|
-
register :casgn,
|
53
|
-
register :alias,
|
54
|
-
register :args,
|
55
|
-
register :block,
|
47
|
+
register :def, DefNode
|
48
|
+
register :defs, DefsNode
|
49
|
+
register :send, SendNode
|
50
|
+
register :class, NamespaceNode
|
51
|
+
register :module, NamespaceNode
|
52
|
+
register :sclass, SclassNode
|
53
|
+
register :ivasgn, IvasgnNode
|
54
|
+
register :cvasgn, CvasgnNode
|
55
|
+
register :lvasgn, LvasgnNode
|
56
|
+
register :gvasgn, GvasgnNode
|
57
|
+
register :casgn, CasgnNode
|
58
|
+
register :alias, AliasNode
|
59
|
+
register :args, ArgsNode
|
60
|
+
register :block, BlockNode
|
56
61
|
register :or_asgn, OrasgnNode
|
57
|
-
register :sym,
|
58
|
-
|
59
|
-
module_function
|
62
|
+
register :sym, SymNode
|
60
63
|
|
61
64
|
# @param node [Parser::AST::Node]
|
62
65
|
# @param region [Region]
|
63
66
|
# @param pins [Array<Pin::Base>]
|
64
67
|
# @return [Array<Pin::Base>]
|
65
|
-
def process node, region = Region.new(nil, '', :instance, :public, []), pins = []
|
68
|
+
def self.process node, region = Region.new(nil, '', :instance, :public, []), pins = []
|
66
69
|
pins.push Pin::Namespace.new(region.source.location, '', '', nil, :class, :public) if pins.empty?
|
67
70
|
return pins unless node.is_a?(Parser::AST::Node) #&& @@processors.key?(node.type)
|
68
71
|
klass = @@processors[node.type] || BeginNode
|
@@ -82,7 +82,7 @@ module Solargraph
|
|
82
82
|
# @todo What to do about references?
|
83
83
|
node.children[2..-1].each do |x|
|
84
84
|
cn = x.children[0].to_s
|
85
|
-
ref = pins.select{|p| p.namespace == region.namespace
|
85
|
+
ref = pins.select{|p| [Solargraph::Pin::Method, Solargraph::Pin::Attribute].include?(p.class) && p.namespace == region.namespace && p.name == cn}.first
|
86
86
|
unless ref.nil?
|
87
87
|
pins.delete ref
|
88
88
|
mm = Solargraph::Pin::Method.new(ref.location, ref.namespace, ref.name, ref.comments, :class, :public, ref.parameters, ref.node)
|
@@ -104,7 +104,7 @@ module Solargraph
|
|
104
104
|
if node.children[2] && (node.children[2].type == :sym || node.children[2].type == :str)
|
105
105
|
# @todo What to do about references?
|
106
106
|
cn = node.children[2].children[0].to_s
|
107
|
-
ref = pins.select{|p| p.namespace == region.namespace
|
107
|
+
ref = pins.select{|p| [Solargraph::Pin::Namespace, Solargraph::Pin::Constant].include?(p.class) && p.namespace == region.namespace && p.name == cn}.first
|
108
108
|
unless ref.nil?
|
109
109
|
pins.delete ref
|
110
110
|
# Might be either a namespace or constant
|
@@ -133,7 +133,7 @@ module Solargraph
|
|
133
133
|
|
134
134
|
def process_private_class_method
|
135
135
|
if node.children[2].type == :sym || node.children[2].type == :str
|
136
|
-
ref = pins.select{|p| p.namespace == region.namespace
|
136
|
+
ref = pins.select{|p| [Solargraph::Pin::Method, Solargraph::Pin::Attribute].include?(p.class) && p.namespace == region.namespace && p.name == node.children[2].children[0].to_s}.first
|
137
137
|
unless ref.nil?
|
138
138
|
pins.delete ref
|
139
139
|
pins.push Solargraph::Pin::Method.new(ref.location, ref.namespace, ref.name, ref.comments, ref.scope, :private, ref.parameters, ref.node)
|
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.29.
|
4
|
+
version: 0.29.2
|
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-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|