solargraph 0.42.3 → 0.42.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/SPONSORS.md +0 -1
- data/lib/solargraph/library.rb +1 -1
- data/lib/solargraph/parser/node_processor/base.rb +0 -3
- data/lib/solargraph/source.rb +0 -12
- data/lib/solargraph/source/chain.rb +0 -4
- data/lib/solargraph/version.rb +1 -1
- data/lib/solargraph/workspace.rb +1 -1
- data/lib/solargraph/yard_map.rb +7 -7
- data/lib/yard-solargraph.rb +3 -0
- 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: 28ad96860cdfaaa7ce608149d111164649664a86e13567c63efb0218cac98bff
|
4
|
+
data.tar.gz: 12f96ea8a87a97a98e0f91774bff44ff3c736fe5268cbdb959cfbf0ce70c53b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '00259fb37ec37b1090797678288f75fc9e1fd26db368d11f6e98f6c89b78745141d416a6a40cc507ce1f032056318c9f67946d9a6d9e17646aee0c9b54a1fd5d'
|
7
|
+
data.tar.gz: 264c5b2e39c4f946f9e375b7d5ef17f97d42c7b6343aa632f1c0319e1a2c6b2b2d73dc50f31b7b863b55b814e0b089cfae63137e8548927e2e0935c4e3243402
|
data/CHANGELOG.md
CHANGED
data/SPONSORS.md
CHANGED
data/lib/solargraph/library.rb
CHANGED
@@ -351,7 +351,7 @@ module Solargraph
|
|
351
351
|
else
|
352
352
|
args = line.split(':').map(&:strip)
|
353
353
|
name = args.shift
|
354
|
-
|
354
|
+
reporter = Diagnostics.reporter(name)
|
355
355
|
raise DiagnosticsError, "Diagnostics reporter #{name} does not exist" if reporter.nil?
|
356
356
|
repargs[reporter] ||= []
|
357
357
|
repargs[reporter].concat args
|
data/lib/solargraph/source.rb
CHANGED
@@ -6,19 +6,15 @@ module Solargraph
|
|
6
6
|
# A Ruby file that has been parsed into an AST.
|
7
7
|
#
|
8
8
|
class Source
|
9
|
-
# autoload :FlawedBuilder, 'solargraph/source/flawed_builder'
|
10
9
|
autoload :Updater, 'solargraph/source/updater'
|
11
10
|
autoload :Change, 'solargraph/source/change'
|
12
11
|
autoload :Mapper, 'solargraph/source/mapper'
|
13
|
-
# autoload :NodeMethods, 'solargraph/source/node_methods'
|
14
12
|
autoload :EncodingFixes, 'solargraph/source/encoding_fixes'
|
15
13
|
autoload :Cursor, 'solargraph/source/cursor'
|
16
14
|
autoload :Chain, 'solargraph/source/chain'
|
17
15
|
autoload :SourceChainer, 'solargraph/source/source_chainer'
|
18
|
-
# autoload :NodeChainer, 'solargraph/source/node_chainer'
|
19
16
|
|
20
17
|
include EncodingFixes
|
21
|
-
# include NodeMethods
|
22
18
|
|
23
19
|
# @return [String]
|
24
20
|
attr_reader :filename
|
@@ -50,17 +46,9 @@ module Solargraph
|
|
50
46
|
@node, @comments = Solargraph::Parser.parse_with_comments(@code, filename)
|
51
47
|
@parsed = true
|
52
48
|
rescue Parser::SyntaxError, EncodingError => e
|
53
|
-
# @todo 100% whitespace results in a nil node, so there's no reason to parse it.
|
54
|
-
# We still need to determine whether the resulting node should be nil or a dummy
|
55
|
-
# node with a location that encompasses the range.
|
56
|
-
# @node, @comments = Source.parse_with_comments(@code.gsub(/[^\s]/, ' '), filename)
|
57
49
|
@node = nil
|
58
50
|
@comments = {}
|
59
51
|
@parsed = false
|
60
|
-
# rescue Exception => e
|
61
|
-
# Solargraph.logger.warn "[#{e.class}] #{e.message}"
|
62
|
-
# Solargraph.logger.warn e.backtrace.join("\n")
|
63
|
-
# raise "Error parsing #{filename || '(source)'}: [#{e.class}] #{e.message}"
|
64
52
|
ensure
|
65
53
|
@code.freeze
|
66
54
|
end
|
@@ -61,10 +61,6 @@ module Solargraph
|
|
61
61
|
working_pin = name_pin
|
62
62
|
links[0..-2].each do |link|
|
63
63
|
pins = link.resolve(api_map, working_pin, locals)
|
64
|
-
# Locals are only used when resolving the first link
|
65
|
-
# @todo There's a problem here. Call links need to resolve arguments
|
66
|
-
# that might refer to local variables.
|
67
|
-
# locals = []
|
68
64
|
type = infer_first_defined(pins, working_pin, api_map)
|
69
65
|
return [] if type.undefined?
|
70
66
|
working_pin = Pin::ProxyType.anonymous(type)
|
data/lib/solargraph/version.rb
CHANGED
data/lib/solargraph/workspace.rb
CHANGED
data/lib/solargraph/yard_map.rb
CHANGED
@@ -288,9 +288,6 @@ module Solargraph
|
|
288
288
|
# @return [Array<Pin::Base>]
|
289
289
|
def process_yardoc y, spec = nil
|
290
290
|
return [] if y.nil?
|
291
|
-
size = Dir.glob(File.join(y, '**', '*'))
|
292
|
-
.map{ |f| File.size(f) }
|
293
|
-
.inject(:+)
|
294
291
|
if spec
|
295
292
|
ser = File.join(CoreDocs.cache_dir, 'gems', "#{spec.name}-#{spec.version}.ser")
|
296
293
|
if File.file?(ser)
|
@@ -299,19 +296,24 @@ module Solargraph
|
|
299
296
|
dump = file.read
|
300
297
|
file.close
|
301
298
|
begin
|
302
|
-
|
299
|
+
result = Marshal.load(dump)
|
300
|
+
return result unless result.nil? || result.empty?
|
301
|
+
Solargraph.logger.warn "Empty cache for #{spec.name} #{spec.version}. Reloading"
|
303
302
|
rescue StandardError => e
|
304
303
|
Solargraph.logger.warn "Error loading pin cache: [#{e.class}] #{e.message}"
|
305
304
|
File.unlink ser
|
306
305
|
end
|
307
306
|
end
|
308
307
|
end
|
308
|
+
size = Dir.glob(File.join(y, '**', '*'))
|
309
|
+
.map{ |f| File.size(f) }
|
310
|
+
.inject(:+)
|
309
311
|
if !size.nil? && size > 20_000_000
|
310
312
|
Solargraph::Logging.logger.warn "Yardoc at #{y} is too large to process (#{size} bytes)"
|
311
313
|
return []
|
312
314
|
end
|
315
|
+
Solargraph.logger.info "Loading #{spec.name} #{spec.version} from #{y}"
|
313
316
|
load_yardoc y
|
314
|
-
Solargraph.logger.info "Loading #{spec.name} #{spec.version} from yardoc"
|
315
317
|
result = Mapper.new(YARD::Registry.all, spec).map
|
316
318
|
if spec
|
317
319
|
ser = File.join(CoreDocs.cache_dir, 'gems', "#{spec.name}-#{spec.version}.ser")
|
@@ -435,5 +437,3 @@ module Solargraph
|
|
435
437
|
end
|
436
438
|
|
437
439
|
Solargraph::YardMap::CoreDocs.require_minimum
|
438
|
-
# Change YARD log IO to avoid sending unexpected messages to STDOUT
|
439
|
-
YARD::Logger.instance.io = File.new(File::NULL, 'w')
|
data/lib/yard-solargraph.rb
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'yard'
|
4
4
|
|
5
|
+
# Change YARD log IO to avoid sending unexpected messages to STDOUT
|
6
|
+
YARD::Logger.instance.io = File.new(File::NULL, 'w')
|
7
|
+
|
5
8
|
module Solargraph
|
6
9
|
# A placeholder for the @!domain directive. It doesn't need to do anything
|
7
10
|
# for yardocs. It's only used for Solargraph API maps.
|
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.42.
|
4
|
+
version: 0.42.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: 2021-
|
11
|
+
date: 2021-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backport
|