solargraph 0.47.2 → 0.49.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.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/rspec.yml +1 -1
- data/CHANGELOG.md +20 -0
- data/LICENSE +1 -1
- data/README.md +8 -0
- data/SPONSORS.md +2 -4
- data/lib/solargraph/api_map/store.rb +13 -1
- data/lib/solargraph/api_map.rb +30 -12
- data/lib/solargraph/cache.rb +51 -0
- data/lib/solargraph/complex_type/type_methods.rb +10 -6
- data/lib/solargraph/complex_type/unique_type.rb +57 -0
- data/lib/solargraph/complex_type.rb +30 -1
- data/lib/solargraph/convention/rakefile.rb +17 -0
- data/lib/solargraph/convention.rb +2 -0
- data/lib/solargraph/diagnostics/rubocop.rb +17 -3
- data/lib/solargraph/diagnostics/rubocop_helpers.rb +3 -1
- data/lib/solargraph/language_server/host.rb +22 -18
- data/lib/solargraph/language_server/message/extended/download_core.rb +1 -5
- data/lib/solargraph/language_server/message/initialize.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/formatting.rb +1 -1
- data/lib/solargraph/language_server/message/text_document/signature_help.rb +1 -6
- data/lib/solargraph/language_server/message/workspace/did_change_watched_files.rb +10 -3
- data/lib/solargraph/library.rb +21 -20
- data/lib/solargraph/parser/legacy/node_processors/casgn_node.rb +12 -2
- data/lib/solargraph/parser/legacy/node_processors/sclass_node.rb +24 -3
- data/lib/solargraph/parser/rubyvm/class_methods.rb +6 -1
- data/lib/solargraph/parser/rubyvm/node_processors/casgn_node.rb +13 -2
- data/lib/solargraph/parser/rubyvm/node_processors/def_node.rb +20 -8
- data/lib/solargraph/parser/rubyvm/node_processors/defs_node.rb +14 -3
- data/lib/solargraph/parser/rubyvm/node_processors/sclass_node.rb +14 -3
- data/lib/solargraph/parser/rubyvm/node_processors/send_node.rb +4 -2
- data/lib/solargraph/parser/rubyvm/node_wrapper.rb +47 -0
- data/lib/solargraph/pin/base.rb +5 -2
- data/lib/solargraph/pin/conversions.rb +2 -6
- data/lib/solargraph/pin/method.rb +100 -10
- data/lib/solargraph/pin/namespace.rb +4 -1
- data/lib/solargraph/pin/parameter.rb +8 -3
- data/lib/solargraph/pin/signature.rb +23 -0
- data/lib/solargraph/pin.rb +1 -0
- data/lib/solargraph/rbs_map/conversions.rb +394 -0
- data/lib/solargraph/rbs_map/core_fills.rb +61 -0
- data/lib/solargraph/rbs_map/core_map.rb +38 -0
- data/lib/solargraph/rbs_map/core_signs.rb +33 -0
- data/lib/solargraph/rbs_map/stdlib_map.rb +36 -0
- data/lib/solargraph/rbs_map.rb +73 -0
- data/lib/solargraph/shell.rb +38 -30
- data/lib/solargraph/source/chain/call.rb +34 -23
- data/lib/solargraph/source/chain.rb +21 -6
- data/lib/solargraph/source_map/clip.rb +5 -0
- data/lib/solargraph/source_map/mapper.rb +2 -0
- data/lib/solargraph/type_checker.rb +71 -65
- data/lib/solargraph/version.rb +1 -1
- data/lib/solargraph/views/environment.erb +2 -2
- data/lib/solargraph/workspace.rb +11 -14
- data/lib/solargraph/yard_map/mapper/to_method.rb +7 -4
- data/lib/solargraph/yard_map.rb +34 -193
- data/lib/solargraph.rb +2 -2
- data/solargraph.gemspec +8 -6
- metadata +43 -36
- data/lib/solargraph/compat.rb +0 -37
- data/lib/solargraph/yard_map/core_docs.rb +0 -170
- data/lib/solargraph/yard_map/core_fills.rb +0 -208
- data/lib/solargraph/yard_map/core_gen.rb +0 -76
- data/lib/solargraph/yard_map/rdoc_to_yard.rb +0 -140
- data/lib/solargraph/yard_map/stdlib_fills.rb +0 -43
- data/yardoc/2.2.2.tar.gz +0 -0
data/lib/solargraph/workspace.rb
CHANGED
|
@@ -46,24 +46,21 @@ module Solargraph
|
|
|
46
46
|
#
|
|
47
47
|
# @param source [Solargraph::Source]
|
|
48
48
|
# @return [Boolean] True if the source was added to the workspace
|
|
49
|
-
def merge
|
|
50
|
-
unless directory == '*' || source_hash.key?(source.filename)
|
|
49
|
+
def merge *sources
|
|
50
|
+
unless directory == '*' || sources.all? { |source| source_hash.key?(source.filename) }
|
|
51
51
|
# Reload the config to determine if a new source should be included
|
|
52
52
|
@config = Solargraph::Workspace::Config.new(directory)
|
|
53
|
-
return false unless config.calculated.include?(source.filename)
|
|
54
53
|
end
|
|
55
|
-
source_hash[source.filename] = source
|
|
56
|
-
true
|
|
57
|
-
end
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
includes_any = false
|
|
56
|
+
sources.each do |source|
|
|
57
|
+
if directory == "*" || config.calculated.include?(source.filename)
|
|
58
|
+
source_hash[source.filename] = source
|
|
59
|
+
includes_any = true
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
includes_any
|
|
67
64
|
end
|
|
68
65
|
|
|
69
66
|
# Remove a source from the workspace. The source will not be removed if
|
|
@@ -13,16 +13,19 @@ module Solargraph
|
|
|
13
13
|
)
|
|
14
14
|
location = object_location(code_object, spec)
|
|
15
15
|
comments = code_object.docstring ? code_object.docstring.all.to_s : ''
|
|
16
|
-
Pin::Method.new(
|
|
16
|
+
pin = Pin::Method.new(
|
|
17
17
|
location: location,
|
|
18
18
|
closure: closure,
|
|
19
19
|
name: name || code_object.name.to_s,
|
|
20
20
|
comments: comments,
|
|
21
21
|
scope: scope || code_object.scope,
|
|
22
22
|
visibility: visibility || code_object.visibility,
|
|
23
|
-
|
|
23
|
+
# @todo Might need to convert overloads to signatures
|
|
24
|
+
parameters: [],
|
|
24
25
|
explicit: code_object.is_explicit?
|
|
25
26
|
)
|
|
27
|
+
pin.parameters.concat get_parameters(code_object, location, comments, pin)
|
|
28
|
+
pin
|
|
26
29
|
end
|
|
27
30
|
|
|
28
31
|
class << self
|
|
@@ -30,7 +33,7 @@ module Solargraph
|
|
|
30
33
|
|
|
31
34
|
# @param code_object [YARD::CodeObjects::Base]
|
|
32
35
|
# @return [Array<Solargraph::Pin::Parameter>]
|
|
33
|
-
def get_parameters code_object, location, comments
|
|
36
|
+
def get_parameters code_object, location, comments, pin
|
|
34
37
|
return [] unless code_object.is_a?(YARD::CodeObjects::MethodObject)
|
|
35
38
|
# HACK: Skip `nil` and `self` parameters that are sometimes emitted
|
|
36
39
|
# for methods defined in C
|
|
@@ -38,7 +41,7 @@ module Solargraph
|
|
|
38
41
|
code_object.parameters.select { |a| a[0] && a[0] != 'self' }.map do |a|
|
|
39
42
|
Solargraph::Pin::Parameter.new(
|
|
40
43
|
location: location,
|
|
41
|
-
closure:
|
|
44
|
+
closure: pin,
|
|
42
45
|
comments: comments,
|
|
43
46
|
name: arg_name(a),
|
|
44
47
|
presence: nil,
|
data/lib/solargraph/yard_map.rb
CHANGED
|
@@ -13,34 +13,13 @@ module Solargraph
|
|
|
13
13
|
class NoYardocError < StandardError; end
|
|
14
14
|
|
|
15
15
|
autoload :Cache, 'solargraph/yard_map/cache'
|
|
16
|
-
autoload :CoreDocs, 'solargraph/yard_map/core_docs'
|
|
17
|
-
autoload :CoreGen, 'solargraph/yard_map/core_gen'
|
|
18
16
|
autoload :Mapper, 'solargraph/yard_map/mapper'
|
|
19
17
|
autoload :RdocToYard, 'solargraph/yard_map/rdoc_to_yard'
|
|
20
|
-
autoload :CoreFills, 'solargraph/yard_map/core_fills'
|
|
21
|
-
autoload :StdlibFills, 'solargraph/yard_map/stdlib_fills'
|
|
22
18
|
autoload :Helpers, 'solargraph/yard_map/helpers'
|
|
23
19
|
autoload :ToMethod, 'solargraph/yard_map/to_method'
|
|
24
20
|
|
|
25
21
|
include ApiMap::BundlerMethods
|
|
26
22
|
|
|
27
|
-
CoreDocs.require_minimum
|
|
28
|
-
|
|
29
|
-
def stdlib_paths
|
|
30
|
-
@@stdlib_paths ||= begin
|
|
31
|
-
result = {}
|
|
32
|
-
YARD::Registry.load! CoreDocs.yardoc_stdlib_file
|
|
33
|
-
YARD::Registry.all.each do |co|
|
|
34
|
-
next if co.file.nil?
|
|
35
|
-
path = co.file.sub(/^(ext|lib)\//, '').sub(/\.(rb|c)$/, '')
|
|
36
|
-
base = path.split('/').first
|
|
37
|
-
result[base] ||= []
|
|
38
|
-
result[base].push co
|
|
39
|
-
end
|
|
40
|
-
result
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
23
|
# @return [Boolean]
|
|
45
24
|
attr_writer :with_dependencies
|
|
46
25
|
|
|
@@ -80,6 +59,7 @@ module Solargraph
|
|
|
80
59
|
@rebindable_method_names = nil
|
|
81
60
|
@pin_class_hash = nil
|
|
82
61
|
@pin_select_cache = {}
|
|
62
|
+
pins.each { |p| p.source = :yard }
|
|
83
63
|
true
|
|
84
64
|
end
|
|
85
65
|
|
|
@@ -126,12 +106,6 @@ module Solargraph
|
|
|
126
106
|
nil
|
|
127
107
|
end
|
|
128
108
|
|
|
129
|
-
# @return [Array<Solargraph::Pin::Base>]
|
|
130
|
-
def core_pins
|
|
131
|
-
# Using a class variable to reduce loads
|
|
132
|
-
@@core_pins ||= load_core_pins
|
|
133
|
-
end
|
|
134
|
-
|
|
135
109
|
# @param path [String]
|
|
136
110
|
# @return [Pin::Base]
|
|
137
111
|
def path_pin path
|
|
@@ -155,10 +129,6 @@ module Solargraph
|
|
|
155
129
|
nil
|
|
156
130
|
end
|
|
157
131
|
|
|
158
|
-
def stdlib_pins
|
|
159
|
-
@stdlib_pins ||= []
|
|
160
|
-
end
|
|
161
|
-
|
|
162
132
|
def base_required
|
|
163
133
|
@base_required ||= Set.new
|
|
164
134
|
end
|
|
@@ -199,10 +169,9 @@ module Solargraph
|
|
|
199
169
|
def process_requires
|
|
200
170
|
@gemset = process_gemsets
|
|
201
171
|
required.merge @gemset.keys if required.include?('bundler/require')
|
|
202
|
-
pins.
|
|
172
|
+
pins.clear
|
|
203
173
|
unresolved_requires.clear
|
|
204
174
|
missing_docs.clear
|
|
205
|
-
stdlib_pins.clear
|
|
206
175
|
environ = Convention.for_global(self)
|
|
207
176
|
done = []
|
|
208
177
|
already_errored = []
|
|
@@ -214,30 +183,7 @@ module Solargraph
|
|
|
214
183
|
pins.concat cached
|
|
215
184
|
next
|
|
216
185
|
end
|
|
217
|
-
result =
|
|
218
|
-
begin
|
|
219
|
-
spec = spec_for_require(r)
|
|
220
|
-
if @source_gems.include?(spec.name)
|
|
221
|
-
next
|
|
222
|
-
end
|
|
223
|
-
next if @gem_paths.key?(spec.name)
|
|
224
|
-
yd = yardoc_file_for_spec(spec)
|
|
225
|
-
# YARD detects gems for certain libraries that do not have a yardoc
|
|
226
|
-
# but exist in the stdlib. `fileutils` is an example. Treat those
|
|
227
|
-
# cases as errors and check the stdlib yardoc.
|
|
228
|
-
if yd.nil?
|
|
229
|
-
process_error(r, result, already_errored, nil)
|
|
230
|
-
next
|
|
231
|
-
end
|
|
232
|
-
@gem_paths[spec.name] = spec.full_gem_path
|
|
233
|
-
unless yardocs.include?(yd)
|
|
234
|
-
yardocs.unshift yd
|
|
235
|
-
result.concat process_yardoc yd, spec
|
|
236
|
-
result.concat add_gem_dependencies(spec) if with_dependencies?
|
|
237
|
-
end
|
|
238
|
-
rescue Gem::LoadError, NoYardocError
|
|
239
|
-
process_error(r, result, already_errored)
|
|
240
|
-
end
|
|
186
|
+
result = pins_for_require r, already_errored
|
|
241
187
|
result.delete_if(&:nil?)
|
|
242
188
|
unless result.empty?
|
|
243
189
|
cache.set_path_pins r, result
|
|
@@ -257,14 +203,10 @@ module Solargraph
|
|
|
257
203
|
base = req.split('/').first
|
|
258
204
|
return if already_errored.include?(base)
|
|
259
205
|
already_errored.push base
|
|
260
|
-
stdtmp = load_stdlib_pins(base)
|
|
261
206
|
if yd.nil?
|
|
262
207
|
missing_docs.push req
|
|
263
|
-
elsif stdtmp.empty?
|
|
264
|
-
unresolved_requires.push req
|
|
265
208
|
else
|
|
266
|
-
|
|
267
|
-
result.concat stdtmp
|
|
209
|
+
unresolved_requires.push req
|
|
268
210
|
end
|
|
269
211
|
end
|
|
270
212
|
|
|
@@ -273,31 +215,36 @@ module Solargraph
|
|
|
273
215
|
require_from_bundle(directory)
|
|
274
216
|
end
|
|
275
217
|
|
|
276
|
-
# @param
|
|
277
|
-
|
|
278
|
-
def add_gem_dependencies spec
|
|
218
|
+
# @param r [String]
|
|
219
|
+
def pins_for_require r, already_errored
|
|
279
220
|
result = []
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
221
|
+
begin
|
|
222
|
+
name = r.split('/').first
|
|
223
|
+
return [] if @source_gems.include?(name) || @gem_paths.key?(name)
|
|
224
|
+
spec = spec_for_require(name)
|
|
225
|
+
@gem_paths[name] = spec.full_gem_path
|
|
226
|
+
|
|
227
|
+
yd = yardoc_file_for_spec(spec)
|
|
228
|
+
# YARD detects gems for certain libraries that do not have a yardoc
|
|
229
|
+
# but exist in the stdlib. `fileutils` is an example. Treat those
|
|
230
|
+
# cases as errors and check the stdlib yardoc.
|
|
231
|
+
if yd.nil?
|
|
232
|
+
process_error(r, result, already_errored, nil)
|
|
233
|
+
return []
|
|
234
|
+
end
|
|
235
|
+
unless yardocs.include?(yd)
|
|
236
|
+
yardocs.unshift yd
|
|
237
|
+
result.concat process_yardoc yd, spec
|
|
238
|
+
if with_dependencies?
|
|
239
|
+
(spec.dependencies - spec.development_dependencies).each do |dep|
|
|
240
|
+
result.concat pins_for_require dep.name, already_errored
|
|
241
|
+
end
|
|
294
242
|
end
|
|
295
|
-
rescue Gem::LoadError
|
|
296
|
-
# This error probably indicates a bug in an installed gem
|
|
297
|
-
Solargraph::Logging.logger.warn "Failed to resolve #{dep.name} gem dependency for #{spec.name}"
|
|
298
243
|
end
|
|
244
|
+
rescue Gem::LoadError, NoYardocError
|
|
245
|
+
process_error(r, result, already_errored)
|
|
299
246
|
end
|
|
300
|
-
result
|
|
247
|
+
return result
|
|
301
248
|
end
|
|
302
249
|
|
|
303
250
|
# @param y [String, nil]
|
|
@@ -306,22 +253,8 @@ module Solargraph
|
|
|
306
253
|
def process_yardoc y, spec = nil
|
|
307
254
|
return [] if y.nil?
|
|
308
255
|
if spec
|
|
309
|
-
|
|
310
|
-
if
|
|
311
|
-
Solargraph.logger.info "Loading #{spec.name} #{spec.version} from cache"
|
|
312
|
-
file = File.open(ser, 'rb')
|
|
313
|
-
dump = file.read
|
|
314
|
-
file.close
|
|
315
|
-
begin
|
|
316
|
-
result = Marshal.load(dump)
|
|
317
|
-
return result unless result.nil? || result.empty?
|
|
318
|
-
Solargraph.logger.warn "Empty cache for #{spec.name} #{spec.version}. Reloading"
|
|
319
|
-
File.unlink ser
|
|
320
|
-
rescue StandardError => e
|
|
321
|
-
Solargraph.logger.warn "Error loading pin cache: [#{e.class}] #{e.message}"
|
|
322
|
-
File.unlink ser
|
|
323
|
-
end
|
|
324
|
-
end
|
|
256
|
+
cache = Solargraph::Cache.load('gems', "#{spec.name}-#{spec.version}.ser")
|
|
257
|
+
return cache if cache
|
|
325
258
|
end
|
|
326
259
|
size = Dir.glob(File.join(y, '**', '*'))
|
|
327
260
|
.map{ |f| File.size(f) }
|
|
@@ -335,10 +268,7 @@ module Solargraph
|
|
|
335
268
|
result = Mapper.new(YARD::Registry.all, spec).map
|
|
336
269
|
raise NoYardocError, "Yardoc at #{y} is empty" if result.empty?
|
|
337
270
|
if spec
|
|
338
|
-
|
|
339
|
-
file = File.open(ser, 'wb')
|
|
340
|
-
file.write Marshal.dump(result)
|
|
341
|
-
file.close
|
|
271
|
+
Solargraph::Cache.save 'gems', "#{spec.name}-#{spec.version}.ser", result
|
|
342
272
|
end
|
|
343
273
|
result
|
|
344
274
|
end
|
|
@@ -346,13 +276,7 @@ module Solargraph
|
|
|
346
276
|
# @param spec [Gem::Specification]
|
|
347
277
|
# @return [String]
|
|
348
278
|
def yardoc_file_for_spec spec
|
|
349
|
-
|
|
350
|
-
if File.exist?(cache_dir)
|
|
351
|
-
Solargraph.logger.info "Using cached documentation for #{spec.name} at #{cache_dir}"
|
|
352
|
-
cache_dir
|
|
353
|
-
else
|
|
354
|
-
YARD::Registry.yardoc_file_for_gem(spec.name, "= #{spec.version}")
|
|
355
|
-
end
|
|
279
|
+
YARD::Registry.yardoc_file_for_gem(spec.name, "= #{spec.version}")
|
|
356
280
|
end
|
|
357
281
|
|
|
358
282
|
# @param path [String]
|
|
@@ -373,88 +297,5 @@ module Solargraph
|
|
|
373
297
|
end
|
|
374
298
|
spec
|
|
375
299
|
end
|
|
376
|
-
|
|
377
|
-
def load_core_pins
|
|
378
|
-
yd = CoreDocs.yardoc_file
|
|
379
|
-
ser = File.join(File.dirname(yd), 'core.ser')
|
|
380
|
-
result = if File.file?(ser)
|
|
381
|
-
file = File.open(ser, 'rb')
|
|
382
|
-
dump = file.read
|
|
383
|
-
file.close
|
|
384
|
-
begin
|
|
385
|
-
Marshal.load(dump)
|
|
386
|
-
rescue StandardError => e
|
|
387
|
-
Solargraph.logger.warn "Error loading core pin cache: [#{e.class}] #{e.message}"
|
|
388
|
-
File.unlink ser
|
|
389
|
-
read_core_and_save_cache(yd, ser)
|
|
390
|
-
end
|
|
391
|
-
else
|
|
392
|
-
read_core_and_save_cache(yd, ser)
|
|
393
|
-
end
|
|
394
|
-
ApiMap::Store.new(result + CoreFills::ALL).pins.reject { |pin| pin.is_a?(Pin::Reference::Override) }
|
|
395
|
-
end
|
|
396
|
-
|
|
397
|
-
def read_core_and_save_cache yd, ser
|
|
398
|
-
result = []
|
|
399
|
-
load_yardoc yd
|
|
400
|
-
result.concat Mapper.new(YARD::Registry.all).map
|
|
401
|
-
# HACK: Assume core methods with a single `args` parameter accept restarg
|
|
402
|
-
result.select { |pin| pin.is_a?(Solargraph::Pin::Method )}.each do |pin|
|
|
403
|
-
if pin.parameters.length == 1 && pin.parameters.first.name == 'args' && pin.parameters.first.decl == :arg
|
|
404
|
-
# @todo Smelly instance variable access
|
|
405
|
-
pin.parameters.first.instance_variable_set(:@decl, :restarg)
|
|
406
|
-
end
|
|
407
|
-
end
|
|
408
|
-
# HACK: Set missing parameters on `==` methods, e.g., `Symbol#==`
|
|
409
|
-
result.select { |pin| pin.name == '==' && pin.parameters.empty? }.each do |pin|
|
|
410
|
-
pin.parameters.push Pin::Parameter.new(decl: :arg, name: 'obj2')
|
|
411
|
-
end
|
|
412
|
-
dump = Marshal.dump(result)
|
|
413
|
-
file = File.open(ser, 'wb')
|
|
414
|
-
file.write dump
|
|
415
|
-
file.close
|
|
416
|
-
result
|
|
417
|
-
end
|
|
418
|
-
|
|
419
|
-
def load_stdlib_pins base
|
|
420
|
-
ser = File.join(File.dirname(CoreDocs.yardoc_stdlib_file), "#{base}.ser")
|
|
421
|
-
result = if File.file?(ser)
|
|
422
|
-
Solargraph.logger.info "Loading #{base} stdlib from cache"
|
|
423
|
-
file = File.open(ser, 'rb')
|
|
424
|
-
dump = file.read
|
|
425
|
-
file.close
|
|
426
|
-
begin
|
|
427
|
-
Marshal.load(dump)
|
|
428
|
-
rescue StandardError => e
|
|
429
|
-
Solargraph.logger.warn "Error loading #{base} stdlib pin cache: [#{e.class}] #{e.message}"
|
|
430
|
-
File.unlink ser
|
|
431
|
-
read_stdlib_and_save_cache(base, ser)
|
|
432
|
-
end
|
|
433
|
-
else
|
|
434
|
-
read_stdlib_and_save_cache(base, ser)
|
|
435
|
-
end
|
|
436
|
-
fills = StdlibFills.get(base)
|
|
437
|
-
unless fills.empty?
|
|
438
|
-
result = ApiMap::Store.new(result + fills).pins.reject { |pin| pin.is_a?(Pin::Reference::Override) }
|
|
439
|
-
end
|
|
440
|
-
result
|
|
441
|
-
end
|
|
442
|
-
|
|
443
|
-
def read_stdlib_and_save_cache base, ser
|
|
444
|
-
result = []
|
|
445
|
-
if stdlib_paths[base]
|
|
446
|
-
Solargraph.logger.info "Loading #{base} stdlib from yardoc"
|
|
447
|
-
result.concat Mapper.new(stdlib_paths[base]).map
|
|
448
|
-
unless result.empty?
|
|
449
|
-
dump = Marshal.dump(result)
|
|
450
|
-
file = File.open(ser, 'wb')
|
|
451
|
-
file.write dump
|
|
452
|
-
file.close
|
|
453
|
-
end
|
|
454
|
-
end
|
|
455
|
-
result
|
|
456
|
-
end
|
|
457
300
|
end
|
|
458
301
|
end
|
|
459
|
-
|
|
460
|
-
Solargraph::YardMap::CoreDocs.require_minimum
|
data/lib/solargraph.rb
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Encoding.default_external = 'UTF-8'
|
|
4
4
|
|
|
5
|
-
require 'solargraph/compat'
|
|
6
5
|
require 'solargraph/version'
|
|
7
6
|
|
|
8
7
|
# The top-level namespace for the Solargraph code mapping, documentation,
|
|
@@ -41,9 +40,10 @@ module Solargraph
|
|
|
41
40
|
autoload :Convention, 'solargraph/convention'
|
|
42
41
|
autoload :Documentor, 'solargraph/documentor'
|
|
43
42
|
autoload :Parser, 'solargraph/parser'
|
|
43
|
+
autoload :RbsMap, 'solargraph/rbs_map'
|
|
44
|
+
autoload :Cache, 'solargraph/cache'
|
|
44
45
|
|
|
45
46
|
dir = File.dirname(__FILE__)
|
|
46
|
-
YARDOC_PATH = File.realpath(File.join(dir, '..', 'yardoc'))
|
|
47
47
|
YARD_EXTENSION_FILE = File.join(dir, 'yard-solargraph.rb')
|
|
48
48
|
VIEWS_PATH = File.join(dir, 'solargraph', 'views')
|
|
49
49
|
|
data/solargraph.gemspec
CHANGED
|
@@ -13,30 +13,32 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
14
14
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
15
15
|
end
|
|
16
|
-
s.homepage = '
|
|
16
|
+
s.homepage = 'https://solargraph.org'
|
|
17
17
|
s.license = 'MIT'
|
|
18
18
|
s.executables = ['solargraph']
|
|
19
|
+
s.metadata["funding_uri"] = "https://www.patreon.com/castwide"
|
|
19
20
|
|
|
20
|
-
s.required_ruby_version = '>= 2.
|
|
21
|
+
s.required_ruby_version = '>= 2.6'
|
|
21
22
|
|
|
22
23
|
s.add_runtime_dependency 'backport', '~> 1.2'
|
|
23
24
|
s.add_runtime_dependency 'benchmark'
|
|
24
|
-
s.add_runtime_dependency 'bundler', '
|
|
25
|
+
s.add_runtime_dependency 'bundler', '~> 2.0'
|
|
25
26
|
s.add_runtime_dependency 'diff-lcs', '~> 1.4'
|
|
26
27
|
s.add_runtime_dependency 'e2mmap'
|
|
27
28
|
s.add_runtime_dependency 'jaro_winkler', '~> 1.5'
|
|
28
29
|
s.add_runtime_dependency 'kramdown', '~> 2.3'
|
|
29
30
|
s.add_runtime_dependency 'kramdown-parser-gfm', '~> 1.1'
|
|
30
31
|
s.add_runtime_dependency 'parser', '~> 3.0'
|
|
31
|
-
s.add_runtime_dependency '
|
|
32
|
-
s.add_runtime_dependency '
|
|
32
|
+
s.add_runtime_dependency 'rbs', '~> 2.0'
|
|
33
|
+
s.add_runtime_dependency 'reverse_markdown', '~> 2.0'
|
|
34
|
+
s.add_runtime_dependency 'rubocop', '~> 1.38'
|
|
33
35
|
s.add_runtime_dependency 'thor', '~> 1.0'
|
|
34
36
|
s.add_runtime_dependency 'tilt', '~> 2.0'
|
|
35
37
|
s.add_runtime_dependency 'yard', '~> 0.9', '>= 0.9.24'
|
|
36
38
|
|
|
37
39
|
s.add_development_dependency 'pry'
|
|
38
40
|
s.add_development_dependency 'public_suffix', '~> 3.1'
|
|
39
|
-
s.add_development_dependency 'rspec', '~> 3.5'
|
|
41
|
+
s.add_development_dependency 'rspec', '~> 3.5'
|
|
40
42
|
s.add_development_dependency 'simplecov', '~> 0.14'
|
|
41
43
|
s.add_development_dependency 'webmock', '~> 3.6'
|
|
42
44
|
end
|
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.
|
|
4
|
+
version: 0.49.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fred Snyder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-04-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: backport
|
|
@@ -42,16 +42,16 @@ dependencies:
|
|
|
42
42
|
name: bundler
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: '2.0'
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
54
|
+
version: '2.0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: diff-lcs
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -137,39 +137,47 @@ dependencies:
|
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
138
|
version: '3.0'
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
140
|
+
name: rbs
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements:
|
|
143
|
-
- - "
|
|
144
|
-
- !ruby/object:Gem::Version
|
|
145
|
-
version: 1.0.5
|
|
146
|
-
- - "<"
|
|
143
|
+
- - "~>"
|
|
147
144
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: '
|
|
145
|
+
version: '2.0'
|
|
149
146
|
type: :runtime
|
|
150
147
|
prerelease: false
|
|
151
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
152
149
|
requirements:
|
|
153
|
-
- - "
|
|
150
|
+
- - "~>"
|
|
154
151
|
- !ruby/object:Gem::Version
|
|
155
|
-
version:
|
|
156
|
-
|
|
152
|
+
version: '2.0'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: reverse_markdown
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - "~>"
|
|
157
158
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: '
|
|
159
|
+
version: '2.0'
|
|
160
|
+
type: :runtime
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - "~>"
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '2.0'
|
|
159
167
|
- !ruby/object:Gem::Dependency
|
|
160
168
|
name: rubocop
|
|
161
169
|
requirement: !ruby/object:Gem::Requirement
|
|
162
170
|
requirements:
|
|
163
|
-
- - "
|
|
171
|
+
- - "~>"
|
|
164
172
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '
|
|
173
|
+
version: '1.38'
|
|
166
174
|
type: :runtime
|
|
167
175
|
prerelease: false
|
|
168
176
|
version_requirements: !ruby/object:Gem::Requirement
|
|
169
177
|
requirements:
|
|
170
|
-
- - "
|
|
178
|
+
- - "~>"
|
|
171
179
|
- !ruby/object:Gem::Version
|
|
172
|
-
version: '
|
|
180
|
+
version: '1.38'
|
|
173
181
|
- !ruby/object:Gem::Dependency
|
|
174
182
|
name: thor
|
|
175
183
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -253,9 +261,6 @@ dependencies:
|
|
|
253
261
|
- - "~>"
|
|
254
262
|
- !ruby/object:Gem::Version
|
|
255
263
|
version: '3.5'
|
|
256
|
-
- - ">="
|
|
257
|
-
- !ruby/object:Gem::Version
|
|
258
|
-
version: 3.5.0
|
|
259
264
|
type: :development
|
|
260
265
|
prerelease: false
|
|
261
266
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -263,9 +268,6 @@ dependencies:
|
|
|
263
268
|
- - "~>"
|
|
264
269
|
- !ruby/object:Gem::Version
|
|
265
270
|
version: '3.5'
|
|
266
|
-
- - ">="
|
|
267
|
-
- !ruby/object:Gem::Version
|
|
268
|
-
version: 3.5.0
|
|
269
271
|
- !ruby/object:Gem::Dependency
|
|
270
272
|
name: simplecov
|
|
271
273
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -301,6 +303,7 @@ executables:
|
|
|
301
303
|
extensions: []
|
|
302
304
|
extra_rdoc_files: []
|
|
303
305
|
files:
|
|
306
|
+
- ".github/FUNDING.yml"
|
|
304
307
|
- ".github/workflows/rspec.yml"
|
|
305
308
|
- ".gitignore"
|
|
306
309
|
- ".rspec"
|
|
@@ -321,7 +324,7 @@ files:
|
|
|
321
324
|
- lib/solargraph/api_map/source_to_yard.rb
|
|
322
325
|
- lib/solargraph/api_map/store.rb
|
|
323
326
|
- lib/solargraph/bench.rb
|
|
324
|
-
- lib/solargraph/
|
|
327
|
+
- lib/solargraph/cache.rb
|
|
325
328
|
- lib/solargraph/complex_type.rb
|
|
326
329
|
- lib/solargraph/complex_type/type_methods.rb
|
|
327
330
|
- lib/solargraph/complex_type/unique_type.rb
|
|
@@ -329,6 +332,7 @@ files:
|
|
|
329
332
|
- lib/solargraph/convention/base.rb
|
|
330
333
|
- lib/solargraph/convention/gemfile.rb
|
|
331
334
|
- lib/solargraph/convention/gemspec.rb
|
|
335
|
+
- lib/solargraph/convention/rakefile.rb
|
|
332
336
|
- lib/solargraph/convention/rspec.rb
|
|
333
337
|
- lib/solargraph/converters/dd.rb
|
|
334
338
|
- lib/solargraph/converters/dl.rb
|
|
@@ -463,6 +467,7 @@ files:
|
|
|
463
467
|
- lib/solargraph/parser/rubyvm/node_processors/scope_node.rb
|
|
464
468
|
- lib/solargraph/parser/rubyvm/node_processors/send_node.rb
|
|
465
469
|
- lib/solargraph/parser/rubyvm/node_processors/sym_node.rb
|
|
470
|
+
- lib/solargraph/parser/rubyvm/node_wrapper.rb
|
|
466
471
|
- lib/solargraph/parser/snippet.rb
|
|
467
472
|
- lib/solargraph/pin.rb
|
|
468
473
|
- lib/solargraph/pin/base.rb
|
|
@@ -493,10 +498,17 @@ files:
|
|
|
493
498
|
- lib/solargraph/pin/reference/require.rb
|
|
494
499
|
- lib/solargraph/pin/reference/superclass.rb
|
|
495
500
|
- lib/solargraph/pin/search.rb
|
|
501
|
+
- lib/solargraph/pin/signature.rb
|
|
496
502
|
- lib/solargraph/pin/singleton.rb
|
|
497
503
|
- lib/solargraph/pin/symbol.rb
|
|
498
504
|
- lib/solargraph/position.rb
|
|
499
505
|
- lib/solargraph/range.rb
|
|
506
|
+
- lib/solargraph/rbs_map.rb
|
|
507
|
+
- lib/solargraph/rbs_map/conversions.rb
|
|
508
|
+
- lib/solargraph/rbs_map/core_fills.rb
|
|
509
|
+
- lib/solargraph/rbs_map/core_map.rb
|
|
510
|
+
- lib/solargraph/rbs_map/core_signs.rb
|
|
511
|
+
- lib/solargraph/rbs_map/stdlib_map.rb
|
|
500
512
|
- lib/solargraph/server_methods.rb
|
|
501
513
|
- lib/solargraph/shell.rb
|
|
502
514
|
- lib/solargraph/source.rb
|
|
@@ -541,24 +553,19 @@ files:
|
|
|
541
553
|
- lib/solargraph/workspace/config.rb
|
|
542
554
|
- lib/solargraph/yard_map.rb
|
|
543
555
|
- lib/solargraph/yard_map/cache.rb
|
|
544
|
-
- lib/solargraph/yard_map/core_docs.rb
|
|
545
|
-
- lib/solargraph/yard_map/core_fills.rb
|
|
546
|
-
- lib/solargraph/yard_map/core_gen.rb
|
|
547
556
|
- lib/solargraph/yard_map/helpers.rb
|
|
548
557
|
- lib/solargraph/yard_map/mapper.rb
|
|
549
558
|
- lib/solargraph/yard_map/mapper/to_constant.rb
|
|
550
559
|
- lib/solargraph/yard_map/mapper/to_method.rb
|
|
551
560
|
- lib/solargraph/yard_map/mapper/to_namespace.rb
|
|
552
|
-
- lib/solargraph/yard_map/rdoc_to_yard.rb
|
|
553
|
-
- lib/solargraph/yard_map/stdlib_fills.rb
|
|
554
561
|
- lib/solargraph/yard_map/to_method.rb
|
|
555
562
|
- lib/yard-solargraph.rb
|
|
556
563
|
- solargraph.gemspec
|
|
557
|
-
|
|
558
|
-
homepage: http://solargraph.org
|
|
564
|
+
homepage: https://solargraph.org
|
|
559
565
|
licenses:
|
|
560
566
|
- MIT
|
|
561
|
-
metadata:
|
|
567
|
+
metadata:
|
|
568
|
+
funding_uri: https://www.patreon.com/castwide
|
|
562
569
|
post_install_message:
|
|
563
570
|
rdoc_options: []
|
|
564
571
|
require_paths:
|
|
@@ -567,7 +574,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
567
574
|
requirements:
|
|
568
575
|
- - ">="
|
|
569
576
|
- !ruby/object:Gem::Version
|
|
570
|
-
version: '2.
|
|
577
|
+
version: '2.6'
|
|
571
578
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
572
579
|
requirements:
|
|
573
580
|
- - ">="
|