solargraph 0.24.1 → 0.25.0

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/solargraph/api_map.rb +93 -46
  3. data/lib/solargraph/api_map/cache.rb +51 -0
  4. data/lib/solargraph/api_map/probe.rb +23 -12
  5. data/lib/solargraph/api_map/source_to_yard.rb +2 -2
  6. data/lib/solargraph/api_map/store.rb +20 -9
  7. data/lib/solargraph/complex_type.rb +10 -1
  8. data/lib/solargraph/diagnostics/require_not_found.rb +1 -1
  9. data/lib/solargraph/diagnostics/rubocop.rb +35 -27
  10. data/lib/solargraph/diagnostics/type_not_defined.rb +10 -13
  11. data/lib/solargraph/language_server/host.rb +11 -11
  12. data/lib/solargraph/language_server/message.rb +0 -1
  13. data/lib/solargraph/language_server/message/base.rb +24 -4
  14. data/lib/solargraph/language_server/message/text_document/completion.rb +9 -16
  15. data/lib/solargraph/language_server/message/text_document/did_change.rb +0 -2
  16. data/lib/solargraph/language_server/message/text_document/formatting.rb +1 -10
  17. data/lib/solargraph/language_server/transport/socket.rb +0 -1
  18. data/lib/solargraph/language_server/transport/stdio.rb +0 -1
  19. data/lib/solargraph/pin.rb +1 -1
  20. data/lib/solargraph/pin/attribute.rb +4 -7
  21. data/lib/solargraph/pin/base.rb +113 -8
  22. data/lib/solargraph/pin/base_variable.rb +17 -25
  23. data/lib/solargraph/pin/block.rb +2 -2
  24. data/lib/solargraph/pin/block_parameter.rb +8 -10
  25. data/lib/solargraph/pin/constant.rb +2 -2
  26. data/lib/solargraph/pin/conversions.rb +8 -0
  27. data/lib/solargraph/pin/documenting.rb +2 -2
  28. data/lib/solargraph/pin/duck_method.rb +0 -1
  29. data/lib/solargraph/pin/local_variable.rb +8 -2
  30. data/lib/solargraph/pin/method.rb +26 -16
  31. data/lib/solargraph/pin/method_parameter.rb +15 -8
  32. data/lib/solargraph/pin/namespace.rb +2 -2
  33. data/lib/solargraph/pin/reference.rb +7 -0
  34. data/lib/solargraph/pin/yard_pin.rb +10 -0
  35. data/lib/solargraph/pin/yard_pin/constant.rb +14 -0
  36. data/lib/solargraph/pin/yard_pin/method.rb +35 -0
  37. data/lib/solargraph/pin/yard_pin/namespace.rb +27 -0
  38. data/lib/solargraph/pin/yard_pin/yard_mixin.rb +18 -0
  39. data/lib/solargraph/source.rb +59 -15
  40. data/lib/solargraph/source/mapper.rb +46 -99
  41. data/lib/solargraph/version.rb +1 -1
  42. data/lib/solargraph/workspace.rb +11 -2
  43. data/lib/solargraph/workspace/config.rb +47 -1
  44. data/lib/solargraph/yard_map.rb +103 -278
  45. data/lib/solargraph/yard_map/cache.rb +13 -38
  46. metadata +7 -3
  47. data/lib/solargraph/pin/yard_object.rb +0 -119
@@ -1,3 +1,3 @@
1
1
  module Solargraph
2
- VERSION = '0.24.1'
2
+ VERSION = '0.25.0'
3
3
  end
@@ -9,8 +9,6 @@ module Solargraph
9
9
  # @return [String]
10
10
  attr_reader :directory
11
11
 
12
- MAX_WORKSPACE_SIZE = 5000
13
-
14
12
  # @param directory [String]
15
13
  def initialize directory, config = nil
16
14
  # @todo Convert to an absolute path?
@@ -20,6 +18,7 @@ module Solargraph
20
18
  load_sources
21
19
  end
22
20
 
21
+ # @param reload [Boolean] Force a reload of the config file
23
22
  # @return [Solargraph::Workspace::Config]
24
23
  def config reload = false
25
24
  @config = Solargraph::Workspace::Config.new(directory) if @config.nil? or reload
@@ -85,15 +84,25 @@ module Solargraph
85
84
  source_hash[filename]
86
85
  end
87
86
 
87
+ # The time of the last workspace synchronization.
88
+ #
89
+ # @return [Time]
88
90
  def stime
89
91
  return @stime if source_hash.empty?
90
92
  @stime = source_hash.values.sort{|a, b| a.stime <=> b.stime}.last.stime
91
93
  end
92
94
 
95
+ # The require paths associated with the workspace.
96
+ #
97
+ # @return [Array<String>]
93
98
  def require_paths
94
99
  @require_paths ||= generate_require_paths
95
100
  end
96
101
 
102
+ # True if the path resolves to a file in the workspace's require paths.
103
+ #
104
+ # @param path [String]
105
+ # @return [Boolean]
97
106
  def would_require? path
98
107
  require_paths.each do |rp|
99
108
  return true if File.exist?(File.join(rp, "#{path}.rb"))
@@ -3,6 +3,10 @@ require 'yaml'
3
3
  module Solargraph
4
4
  class Workspace
5
5
  class Config
6
+ # The maximum number of files that can be added to a workspace.
7
+ # The workspace's .solargraph.yml can override this value.
8
+ MAX_FILES = 5000
9
+
6
10
  # @return [String]
7
11
  attr_reader :workspace
8
12
 
@@ -30,7 +34,7 @@ module Solargraph
30
34
  @raw_data['domains'] ||= []
31
35
  @raw_data['reporters'] ||= %w[rubocop require_not_found]
32
36
  @raw_data['plugins'] ||= []
33
- @raw_data['max_files'] ||= Workspace::MAX_WORKSPACE_SIZE
37
+ @raw_data['max_files'] ||= MAX_FILES
34
38
  included
35
39
  excluded
36
40
  end
@@ -58,11 +62,18 @@ module Solargraph
58
62
  @calculated ||= included - excluded
59
63
  end
60
64
 
65
+ # An array of domains configured for the workspace.
66
+ # A domain is a namespace that the ApiMap should include in the global
67
+ # namespace. It's typically used to identify available DSLs.
68
+ #
61
69
  # @return [Array<String>]
62
70
  def domains
63
71
  raw_data['domains']
64
72
  end
65
73
 
74
+ # An array of required paths to add to the workspace.
75
+ #
76
+ # @return [Array<String>]
66
77
  def required
67
78
  raw_data['require']
68
79
  end
@@ -71,20 +82,33 @@ module Solargraph
71
82
  raw_data['require_paths'] || []
72
83
  end
73
84
 
85
+ # An array of Solargraph plugins to install.
86
+ #
87
+ # @return [Array<String>]
74
88
  def plugins
75
89
  raw_data['plugins']
76
90
  end
77
91
 
92
+ # An array of reporters to use for diagnostics.
93
+ #
94
+ # @return [Array<String>]
78
95
  def reporters
79
96
  raw_data['reporters']
80
97
  end
81
98
 
99
+ # The maximum number of files to parse from the workspace.
100
+ #
101
+ # @return [Integer]
82
102
  def max_files
83
103
  raw_data['max_files']
84
104
  end
85
105
 
86
106
  private
87
107
 
108
+ # Get an array of files from the provided globs.
109
+ #
110
+ # @param globs [Array<String>]
111
+ # @return [Array<String>]
88
112
  def process_globs globs
89
113
  result = []
90
114
  globs.each do |glob|
@@ -93,6 +117,11 @@ module Solargraph
93
117
  result
94
118
  end
95
119
 
120
+ # Modify the included files based on excluded directories and get an
121
+ # array of additional files to exclude.
122
+ #
123
+ # @param globs [Array<String>]
124
+ # @return [Array<String>]
96
125
  def process_exclusions globs
97
126
  remainder = globs.select do |glob|
98
127
  if glob_is_directory?(glob)
@@ -106,10 +135,27 @@ module Solargraph
106
135
  process_globs remainder
107
136
  end
108
137
 
138
+ # True if the glob translates to a whole directory.
139
+ #
140
+ # @example
141
+ # glob_is_directory?('path/to/dir') # => true
142
+ # glob_is_directory?('path/to/dir/**/*) # => true
143
+ # glob_is_directory?('path/to/file.txt') # => false
144
+ # glob_is_directory?('path/to/*.txt') # => false
145
+ #
146
+ # @param glob [String]
147
+ # @return [Boolean]
109
148
  def glob_is_directory? glob
110
149
  File.directory?(glob) or File.directory?(glob_to_directory(glob))
111
150
  end
112
151
 
152
+ # Translate a glob to a base directory if applicable
153
+ #
154
+ # @example
155
+ # glob_to_directory('path/to/dir/**/*') # => 'path/to/dir'
156
+ #
157
+ # @param glob [String]
158
+ # @return [String]
113
159
  def glob_to_directory glob
114
160
  glob.gsub(/(\/\*|\/\*\*\/\*\*?)$/, '')
115
161
  end
@@ -5,7 +5,7 @@ module Solargraph
5
5
  # stdlib, and gems.
6
6
  #
7
7
  class YardMap
8
- autoload :Cache, 'solargraph/yard_map/cache'
8
+ autoload :Cache, 'solargraph/yard_map/cache'
9
9
  autoload :CoreDocs, 'solargraph/yard_map/core_docs'
10
10
 
11
11
  CoreDocs.require_minimum
@@ -26,25 +26,21 @@ module Solargraph
26
26
  # @return [Array<String>]
27
27
  attr_reader :required
28
28
 
29
- def initialize required: [], workspace: nil
29
+ def initialize(required: [], workspace: nil)
30
30
  @workspace = workspace
31
31
  # HACK: YardMap needs its own copy of this array
32
32
  @required = required.clone
33
- @namespace_yardocs = {}
34
33
  @gem_paths = {}
35
34
  @stdlib_namespaces = []
36
35
  process_requires
37
- yardocs.push CoreDocs.yardoc_file
36
+ # yardocs.push CoreDocs.yardoc_file
38
37
  yardocs.uniq!
39
38
  yardocs.delete_if{ |y| y.start_with? workspace.directory } unless workspace.nil? or workspace.directory.nil?
40
- yardocs.each do |y|
41
- load_yardoc y
42
- YARD::Registry.all(:class, :module).each do |ns|
43
- @namespace_yardocs[ns.path] ||= []
44
- @namespace_yardocs[ns.path].push y
45
- end
46
- end
47
- cache_core
39
+ end
40
+
41
+ # @return [Array<Solargraph::Pin::Base>]
42
+ def pins
43
+ @pins ||= []
48
44
  end
49
45
 
50
46
  # @return [Array<String>]
@@ -73,281 +69,140 @@ module Solargraph
73
69
  end
74
70
  end
75
71
 
76
- # @param query [String]
77
- # @return [Array<String>]
78
- def search query
79
- found = []
80
- (yardocs + [@@stdlib_yardoc]).each { |y|
81
- yard = load_yardoc(y)
82
- unless yard.nil?
83
- yard.paths.each do |p|
84
- if found.empty? or (query.include?('.') or query.include?('#')) or !(p.include?('.') or p.include?('#'))
85
- found.push p if p.downcase.include?(query.downcase)
86
- end
87
- end
88
- end
89
- }
90
- found.uniq
91
- end
92
-
93
- # @param query [String]
94
- # @return [YARD::CodeObjects::Base]
95
- def document query
96
- found = []
97
- (yardocs + [@@stdlib_yardoc]).each { |y|
98
- yard = load_yardoc(y)
99
- unless yard.nil?
100
- obj = yard.at query
101
- found.push obj unless obj.nil?
102
- end
103
- }
104
- found
105
- end
106
-
107
- # @param namespace [String]
108
- # @param scope [String]
109
- # @return [Array<Solargraph::Pin::Base>]
110
- def get_constants namespace , scope = ''
111
- cached = cache.get_constants(namespace, scope)
112
- return cached unless cached.nil?
113
- consts = []
114
- result = []
115
- combined_namespaces(namespace, scope).each do |ns|
116
- yardocs_documenting(ns).each do |y|
117
- # @todo Getting constants from the stdlib works slightly differently
118
- # from methods
119
- next if y == @@stdlib_yardoc
120
- yard = load_yardoc(y)
121
- unless yard.nil?
122
- found = yard.at(ns)
123
- consts.concat found.children unless found.nil?
124
- end
125
- end
126
- consts.concat @stdlib_namespaces.select{|ns| ns.namespace.path == namespace}
72
+ # @param paths [Array<String>]
73
+ # @return [Boolean]
74
+ def change new_requires
75
+ if new_requires.uniq.sort == required.uniq.sort
76
+ false
77
+ else
78
+ required.clear
79
+ required.concat new_requires
80
+ process_requires
81
+ true
127
82
  end
128
- consts.each { |c|
129
- detail = nil
130
- kind = nil
131
- return_type = nil
132
- if c.kind_of?(YARD::CodeObjects::ClassObject)
133
- detail = 'Class'
134
- return_type = "Class<#{c.to_s}>"
135
- elsif c.kind_of?(YARD::CodeObjects::ModuleObject)
136
- detail = 'Module'
137
- return_type = "Module<#{c.to_s}>"
138
- elsif c.kind_of?(YARD::CodeObjects::ConstantObject)
139
- detail = 'Constant'
140
- else
141
- next
142
- end
143
- result.push Pin::YardObject.new(c, object_location(c))
144
- }
145
- cache.set_constants(namespace, scope, result)
146
- result
147
83
  end
148
84
 
149
- # @param namespace [String]
150
- # @param scope [String]
151
- # @param visibility [Array<Symbol>]
152
- # @return [Array<Solargraph::Pin::Base>]
153
- def get_methods namespace, scope = '', visibility: [:public]
154
- return [] if namespace == '' and scope == ''
155
- cached = cache.get_methods(namespace, scope, visibility)
156
- return cached unless cached.nil?
157
- meths = []
158
- combined_namespaces(namespace, scope).each do |ns|
159
- yardocs_documenting(ns).each do |y|
160
- yard = load_yardoc(y)
161
- unless yard.nil?
162
- ns = nil
163
- ns = find_first_resolved_object(yard, namespace, scope)
164
- unless ns.nil?
165
- has_new = false
166
- ns.meths(scope: :class, visibility: visibility).each { |m|
167
- has_new = true if m.name == 'new'
168
- meths.push Pin::YardObject.new(m, object_location(m))
169
- }
170
- # HACK: Convert #initialize to .new
171
- if visibility.include?(:public) and !has_new
172
- init = ns.meths(scope: :instance).select{|m| m.to_s.split(/[\.#]/).last == 'initialize'}.first
173
- unless init.nil?
174
- ip = Solargraph::Pin::YardObject.new(init, object_location(init))
175
- np = Solargraph::Pin::Method.new(ip.location, ip.namespace, 'new', ip.docstring, :class, :public, ip.parameters)
176
- meths.push np
177
- end
178
- end
179
- # Collect superclass methods
180
- if ns.kind_of?(YARD::CodeObjects::ClassObject) and !ns.superclass.nil?
181
- meths += get_methods ns.superclass.to_s, '', visibility: [:public, :protected] unless ['Object', 'BasicObject', ''].include?(ns.superclass.to_s)
182
- end
183
- end
184
- end
85
+ def core_pins
86
+ @@core_pins ||= begin
87
+ result = []
88
+ load_yardoc CoreDocs.yardoc_file
89
+ YARD::Registry.each do |o|
90
+ result.push generate_pin(o)
185
91
  end
92
+ result
186
93
  end
187
- cache.set_methods(namespace, scope, visibility, meths)
188
- meths
189
94
  end
190
95
 
191
- # @param namespace [String]
192
- # @param scope [String]
193
- # @param visibility [Array<Symbol>]
194
- # @return [Array<Solargraph::Pin::Base>]
195
- def get_instance_methods namespace, scope = '', visibility: [:public]
196
- return [] if namespace == '' and scope == ''
197
- cached = cache.get_instance_methods(namespace, scope, visibility)
198
- return cached unless cached.nil?
199
- meths = []
200
- combined_namespaces(namespace, scope).each do |ns|
201
- yardocs_documenting(ns).each do |y|
202
- yard = load_yardoc(y)
203
- unless yard.nil?
204
- ns = nil
205
- ns = find_first_resolved_object(yard, namespace, scope)
206
- unless ns.nil?
207
- ns.meths(scope: :instance, visibility: visibility).each do |m|
208
- n = m.to_s.split(/[\.#]/).last
209
- # HACK: Exception for Module#module_function in Class
210
- next if ns.name == :Class and m.path == 'Module#module_function'
211
- # HACK: Special treatment for #initialize
212
- next if n == 'initialize' and !visibility.include?(:private)
213
- if (namespace == 'Kernel' or !m.to_s.start_with?('Kernel#')) and !m.docstring.to_s.include?(':nodoc:')
214
- meths.push Pin::YardObject.new(m, object_location(m))
215
- end
216
- end
217
- if ns.kind_of?(YARD::CodeObjects::ClassObject) and namespace != 'Object'
218
- unless ns.nil?
219
- meths += get_instance_methods(ns.superclass.to_s)
220
- end
221
- end
222
- ns.instance_mixins.each do |m|
223
- meths += get_instance_methods(m.to_s) unless m.to_s == 'Kernel'
224
- end
225
- # HACK: Now get the #initialize method for private requests
226
- if visibility.include?(:private)
227
- init = ns.meths(scope: :instance).select{|m| m.to_s.split(/[\.#]/).last == 'initialize'}.first
228
- meths.push Pin::YardObject.new(init, object_location(init)) unless init.nil?
229
- end
230
- end
231
- end
232
- end
233
- end
234
- cache.set_instance_methods(namespace, scope, visibility, meths)
235
- meths
236
- end
96
+ private
237
97
 
238
- # @param namespace [String]
239
- # @param scope [String]
240
- # @return [String]
241
- def find_fully_qualified_namespace namespace, scope
242
- unless scope.nil? or scope.empty?
243
- parts = scope.split('::')
244
- while parts.length > 0
245
- here = "#{parts.join('::')}::#{namespace}"
246
- return here unless yardocs_documenting(here).empty?
247
- return here if @stdlib_namespaces.any?{|ns| ns.path == here}
248
- parts.pop
249
- end
250
- end
251
- return namespace unless yardocs_documenting(namespace).empty?
252
- return namespace if @stdlib_namespaces.any?{|ns| ns.path == namespace}
253
- nil
98
+ # @return [YardMap::Cache]
99
+ def cache
100
+ @cache ||= YardMap::Cache.new
254
101
  end
255
102
 
256
- # @param path [String]
257
- # @param space [String]
258
- # @return [Array<Pin::YardObject>]
259
- def objects path, space = ''
260
- cached = cache.get_objects(path, space)
261
- return cached unless cached.nil?
103
+ def recurse_namespace_object ns
262
104
  result = []
263
- yardocs.each { |y|
264
- yard = load_yardoc(y)
265
- unless yard.nil?
266
- obj = find_first_resolved_object(yard, path, space)
267
- unless obj.nil?
268
- result.push Pin::YardObject.new(obj, object_location(obj))
269
- end
270
- end
271
- }
272
- @stdlib_namespaces.each do |ns|
273
- result.push Pin::YardObject.new(ns, object_location(ns)) if ns.path == path
105
+ ns.children.each do |c|
106
+ result.push generate_pin(c)
107
+ result.concat recurse_namespace_object(c) if c.respond_to?(:children)
274
108
  end
275
- cache.set_objects(path, space, result)
276
109
  result
277
110
  end
278
111
 
279
- # @param fqns [String]
280
- # @return [Symbol] :class, :module, or nil
281
- def get_namespace_type(fqns)
282
- yardocs_documenting(fqns).each do |y|
283
- yard = load_yardoc y
284
- unless yard.nil?
285
- obj = yard.at(fqns)
286
- unless obj.nil?
287
- return :class if obj.kind_of?(YARD::CodeObjects::ClassObject)
288
- return :module if obj.kind_of?(YARD::CodeObjects::ModuleObject)
289
- return nil
290
- end
291
- end
292
- end
293
- nil
294
- end
295
-
296
- private
297
-
298
- # @return [Solargraph::YardMap::Cache]
299
- def cache
300
- @cache ||= Cache.new
301
- end
302
-
303
- def find_first_resolved_object yard, namespace, scope
304
- unless scope.nil?
305
- parts = scope.split('::')
306
- while parts.length > 0
307
- ns = yard.resolve(P(parts.join('::')), namespace, true)
308
- return ns unless ns.nil?
309
- parts.pop
310
- end
112
+ def generate_pin code_object
113
+ location = object_location(code_object)
114
+ if code_object.is_a?(YARD::CodeObjects::NamespaceObject)
115
+ Solargraph::Pin::YardPin::Namespace.new(code_object, location)
116
+ elsif code_object.is_a?(YARD::CodeObjects::MethodObject)
117
+ Solargraph::Pin::YardPin::Method.new(code_object, location)
118
+ elsif code_object.is_a?(YARD::CodeObjects::ConstantObject)
119
+ Solargraph::Pin::YardPin::Constant.new(code_object, location)
120
+ else
121
+ nil
311
122
  end
312
- yard.at(namespace)
313
- end
314
-
315
- def cache_core
316
- get_constants '', ''
317
123
  end
318
124
 
319
125
  def process_requires
320
- tried = []
126
+ pins.clear
321
127
  unresolved_requires.clear
128
+ stdnames = {}
322
129
  required.each do |r|
323
- next if r.nil?
130
+ next if r.nil? or r.empty?
324
131
  next if !workspace.nil? and workspace.would_require?(r)
132
+ cached = cache.get_path_pins(r)
133
+ unless cached.nil?
134
+ pins.concat cached
135
+ next
136
+ end
137
+ result = []
325
138
  begin
326
139
  spec = Gem::Specification.find_by_path(r) || Gem::Specification.find_by_name(r.split('/').first)
327
140
  ver = spec.version.to_s
328
141
  ver = ">= 0" if ver.empty?
329
- add_gem_dependencies spec
142
+ # @todo Ignoring dependencies for now
143
+ # add_gem_dependencies spec
330
144
  yd = YARD::Registry.yardoc_file_for_gem(spec.name, ver)
331
145
  @gem_paths[spec.name] = spec.full_gem_path
332
- unresolved_requires.push r if yd.nil?
333
- yardocs.unshift yd unless yd.nil? or yardocs.include?(yd)
146
+ if yd.nil?
147
+ unresolved_requires.push r
148
+ else
149
+ unless yardocs.include?(yd)
150
+ yardocs.unshift yd
151
+ # @todo Generate the pins
152
+ load_yardoc yd
153
+ YARD::Registry.each do |o|
154
+ result.push generate_pin(o)
155
+ end
156
+ end
157
+ end
334
158
  rescue Gem::LoadError => e
335
159
  next if !workspace.nil? and workspace.would_require?(r)
336
- stdnames = []
160
+ stdtmp = []
337
161
  @@stdlib_paths.each_pair do |path, objects|
338
- stdnames.concat objects if path == r or path.start_with?("#{r}/")
162
+ stdtmp.concat objects if path == r or path.start_with?("#{r}/")
339
163
  end
340
- @stdlib_namespaces.concat stdnames
341
- unresolved_requires.push r if stdnames.empty?
164
+ if stdtmp.empty?
165
+ unresolved_requires.push r
166
+ else
167
+ stdnames[r] = stdtmp
168
+ end
169
+ end
170
+ result.delete_if(&:nil?)
171
+ unless result.empty?
172
+ cache.set_path_pins r, result
173
+ pins.concat result
342
174
  end
343
175
  end
176
+ pins.concat process_stdlib(stdnames)
177
+ pins.concat core_pins
178
+ end
179
+
180
+ def process_stdlib required_namespaces
181
+ pins = []
182
+ unless required_namespaces.empty?
183
+ yard = load_yardoc @@stdlib_yardoc
184
+ done = []
185
+ required_namespaces.each_pair do |r, objects|
186
+ result = []
187
+ objects.each do |ns|
188
+ next if done.include?(ns.path)
189
+ done.push ns.path
190
+ result.push generate_pin(ns)
191
+ result.concat recurse_namespace_object(ns)
192
+ end
193
+ result.delete_if(&:nil?)
194
+ cache.set_path_pins(r, result) unless result.empty?
195
+ pins.concat result
196
+ end
197
+ end
198
+ pins
344
199
  end
345
200
 
346
201
  # @param spec [Gem::Specification]
347
202
  def add_gem_dependencies spec
348
203
  (spec.dependencies - spec.development_dependencies).each do |dep|
349
- spec = Gem::Specification.find_by_name(dep.name)
350
- @gem_paths[spec.name] = spec.full_gem_path unless spec.nil?
204
+ depspec = Gem::Specification.find_by_name(dep.name)
205
+ @gem_paths[spec.name] = depspec.full_gem_path unless depspec.nil?
351
206
  gy = YARD::Registry.yardoc_file_for_gem(dep.name)
352
207
  if gy.nil?
353
208
  unresolved_requires.push dep.name
@@ -357,36 +212,6 @@ module Solargraph
357
212
  end
358
213
  end
359
214
 
360
- # @param namespace [String]
361
- # @param scope [String]
362
- # @return [Array<String>]
363
- def combined_namespaces namespace, scope = ''
364
- combined = [namespace]
365
- unless scope.empty?
366
- parts = scope.split('::')
367
- until parts.empty?
368
- combined.unshift parts.join('::') + '::' + namespace
369
- parts.pop
370
- end
371
- end
372
- combined
373
- end
374
-
375
- # @param namespace [String]
376
- # @return [Array<String>]
377
- def yardocs_documenting namespace
378
- result = []
379
- if namespace == ''
380
- result.concat yardocs
381
- else
382
- result.concat @namespace_yardocs[namespace] unless @namespace_yardocs[namespace].nil?
383
- end
384
- if @stdlib_namespaces.map(&:path).include?(namespace)
385
- result.push @@stdlib_yardoc
386
- end
387
- result
388
- end
389
-
390
215
  # @param obj [YARD::CodeObjects::Base]
391
216
  # @return [Solargraph::Source::Location]
392
217
  def object_location obj