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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f99f80989cced14064f1739f7a193f207fe92c8f696374de2f4798e3662196f0
4
- data.tar.gz: efb7011bebf1eaab6b374c093fe25abe67a7b5da469024d78702feae1e4449a3
3
+ metadata.gz: 28ad96860cdfaaa7ce608149d111164649664a86e13567c63efb0218cac98bff
4
+ data.tar.gz: 12f96ea8a87a97a98e0f91774bff44ff3c736fe5268cbdb959cfbf0ce70c53b6
5
5
  SHA512:
6
- metadata.gz: b3975f82cf5ac9c25e6d49dfe5cee21fc780d98f38dfca83371750c8a7913d53684d142f21047fcf132cdb7e02efb878b8956aab94b982ae764a3dcae9bf62cc
7
- data.tar.gz: 6917cfd70a9d436792456857154b6de5c10ded3d08f3ae9caf029307581577fcd1d1934fe3959c5c84750006d9e3d6a55c4a344746dee72eb8fa9dcf3a25e078
6
+ metadata.gz: '00259fb37ec37b1090797678288f75fc9e1fd26db368d11f6e98f6c89b78745141d416a6a40cc507ce1f032056318c9f67946d9a6d9e17646aee0c9b54a1fd5d'
7
+ data.tar.gz: 264c5b2e39c4f946f9e375b7d5ef17f97d42c7b6343aa632f1c0319e1a2c6b2b2d73dc50f31b7b863b55b814e0b089cfae63137e8548927e2e0935c4e3243402
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.42.4
2
+ - Yardoc cache handling
3
+ - Fix required_paths when gemspec is used (#451)
4
+ - fix: yard stdout may break language client (#454)
5
+
1
6
  ## 0.42.3 - June 14, 2021
2
7
  - Require 'pathname' for Library
3
8
 
data/SPONSORS.md CHANGED
@@ -13,4 +13,3 @@ The following people and organizations provide funding or other resources. [Beco
13
13
  - Emily Strickland
14
14
  - Tom de Grunt
15
15
  - Akira Yamada
16
- - Jared White
@@ -351,7 +351,7 @@ module Solargraph
351
351
  else
352
352
  args = line.split(':').map(&:strip)
353
353
  name = args.shift
354
- reporter = Diagnostics.reporter(name)
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
@@ -4,9 +4,6 @@ module Solargraph
4
4
  module Parser
5
5
  module NodeProcessor
6
6
  class Base
7
- # @todo The base node processor should not include legacy node methods
8
- # include Legacy::NodeMethods
9
-
10
7
  # @return [Parser::AST::Node]
11
8
  attr_reader :node
12
9
 
@@ -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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.42.3'
4
+ VERSION = '0.42.4'
5
5
  end
@@ -183,7 +183,7 @@ module Solargraph
183
183
  end
184
184
  end
185
185
  end
186
- result.concat config.require_paths
186
+ result.concat(config.require_paths.map { |p| File.join(directory, p) })
187
187
  result.push File.join(directory, 'lib') if result.empty?
188
188
  result
189
189
  end
@@ -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
- return Marshal.load(dump)
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')
@@ -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.3
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-06-14 00:00:00.000000000 Z
11
+ date: 2021-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport