solargraph 0.39.14 → 0.39.15

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: 3ec8cbe63061b570e7d0fb984e1a4a15ed40c265e34fb6bd7d027f859d32a4d4
4
- data.tar.gz: 93e53c212c5c608b0ecdea34ce7771213b92c75917cf110673e5a4fa1f3f785e
3
+ metadata.gz: 7e70e17b5895de1eea7c7455249afbcf26bb1cb59eb4d47ae93d7e37b53e653d
4
+ data.tar.gz: ba947a023fcc459c489e84afce5d7af0ccce1d3b0b0ba6a6f4b89c72e6693a8e
5
5
  SHA512:
6
- metadata.gz: a0e7c03a9f231ebe695cf95150402a525fe0e3abfedb82dc6cd275e58e64170814dde79a24c03f02ff4f2477dacfef7a64ed71006a54e5b30abd5b27a7d7afcd
7
- data.tar.gz: b78c8f4bf6f7f0f291391fdc1e9c6a95376f51801426efdb7a17b6c0eed380056074df02321dd61a34d1afb82ccae52ba97fba383388d962ede99bd9e3e753ed
6
+ metadata.gz: 1c869730843c3b6f3ad7ea20646c5aed3c22e36b61a8d31e550b13f44de966f8837f9bf35463a9353e755eb6a8352ad2b9c110e5e07a8fd2ad8c6445af1dec83
7
+ data.tar.gz: 3abeace1fea2e9ae611c43bc222968f73bcfb3822761bea46935168d398774cb66fa87528fa851ef080e84dc2cd9d577cada3f5478ad0af4896d02595c16d04f
@@ -55,6 +55,8 @@ module Solargraph
55
55
  false
56
56
  end
57
57
 
58
+ # @param directory [String]
59
+ # @return [Hash]
58
60
  def self.specs_from_bundle directory
59
61
  Solargraph.with_clean_env do
60
62
  Dir.chdir directory do
@@ -174,10 +174,10 @@ module Solargraph
174
174
  if cursor.comment?
175
175
  source = read(filename)
176
176
  offset = Solargraph::Position.to_offset(source.code, Solargraph::Position.new(line, column))
177
- lft = source.code[0..offset-1].match(/[\[<, ]([a-z0-9_:]*)\z/i)
177
+ lft = source.code[0..offset-1].match(/\[[a-z0-9_:<, ]*?([a-z0-9_:]*)\z/i)
178
178
  rgt = source.code[offset..-1].match(/^([a-z0-9_]*)(:[a-z0-9_:]*)?[\]>, ]/i)
179
179
  if lft && rgt
180
- tag = lft[1] + rgt[1]
180
+ tag = (lft[1] + rgt[1]).sub(/:+$/, '')
181
181
  clip = api_map.clip(cursor)
182
182
  clip.translate tag
183
183
  else
@@ -14,7 +14,7 @@ module Solargraph
14
14
  def initialize node, filename = nil, in_block = false
15
15
  @node = node
16
16
  @filename = filename
17
- @in_block = in_block
17
+ @in_block = in_block ? 1 : 0
18
18
  end
19
19
 
20
20
  # @return [Source::Chain]
@@ -51,9 +51,9 @@ module Solargraph
51
51
  return generate_links(n.children[0]) if n.type == :splat
52
52
  result = []
53
53
  if n.type == :block
54
- @in_block = true
54
+ @in_block += 1
55
55
  result.concat generate_links(n.children[0])
56
- @in_block = false
56
+ @in_block -= 1
57
57
  elsif n.type == :send
58
58
  if n.children[0].is_a?(::Parser::AST::Node)
59
59
  result.concat generate_links(n.children[0])
@@ -61,23 +61,23 @@ module Solargraph
61
61
  n.children[2..-1].each do |c|
62
62
  args.push NodeChainer.chain(c)
63
63
  end
64
- result.push Chain::Call.new(n.children[1].to_s, args, @in_block || block_passed?(n))
64
+ result.push Chain::Call.new(n.children[1].to_s, args, @in_block > 0 || block_passed?(n))
65
65
  elsif n.children[0].nil?
66
66
  args = []
67
67
  n.children[2..-1].each do |c|
68
68
  args.push NodeChainer.chain(c)
69
69
  end
70
- result.push Chain::Call.new(n.children[1].to_s, args, @in_block || block_passed?(n))
70
+ result.push Chain::Call.new(n.children[1].to_s, args, @in_block > 0 || block_passed?(n))
71
71
  else
72
72
  raise "No idea what to do with #{n}"
73
73
  end
74
74
  elsif n.type == :self
75
75
  result.push Chain::Head.new('self')
76
76
  elsif n.type == :zsuper
77
- result.push Chain::ZSuper.new('super', @in_block || block_passed?(n))
77
+ result.push Chain::ZSuper.new('super', @in_block > 0 || block_passed?(n))
78
78
  elsif n.type == :super
79
79
  args = n.children.map { |c| NodeChainer.chain(c) }
80
- result.push Chain::Call.new('super', args, @in_block || block_passed?(n))
80
+ result.push Chain::Call.new('super', args, @in_block > 0 || block_passed?(n))
81
81
  elsif n.type == :const
82
82
  const = unpack_name(n)
83
83
  result.push Chain::Constant.new(const)
@@ -15,7 +15,7 @@ module Solargraph
15
15
  def initialize node, filename = nil, in_block = false
16
16
  @node = node
17
17
  @filename = filename
18
- @in_block = in_block
18
+ @in_block = in_block ? 1 : 0
19
19
  end
20
20
 
21
21
  # @return [Source::Chain]
@@ -52,27 +52,27 @@ module Solargraph
52
52
  return generate_links(n.children[0]) if n.type == :SPLAT
53
53
  result = []
54
54
  if n.type == :ITER
55
- @in_block = true
55
+ @in_block += 1
56
56
  result.concat generate_links(n.children[0])
57
- @in_block = false
57
+ @in_block -= 1
58
58
  elsif n.type == :CALL || n.type == :OPCALL
59
59
  n.children[0..-3].each do |c|
60
60
  result.concat generate_links(c)
61
61
  end
62
- result.push Chain::Call.new(n.children[-2].to_s, node_to_argchains(n.children.last), @in_block || block_passed?(n))
62
+ result.push Chain::Call.new(n.children[-2].to_s, node_to_argchains(n.children.last), @in_block > 0 || block_passed?(n))
63
63
  elsif n.type == :ATTRASGN
64
64
  result.concat generate_links(n.children[0])
65
- result.push Chain::Call.new(n.children[1].to_s, node_to_argchains(n.children[2]), @in_block || block_passed?(n))
65
+ result.push Chain::Call.new(n.children[1].to_s, node_to_argchains(n.children[2]), @in_block > 0 || block_passed?(n))
66
66
  elsif n.type == :VCALL
67
- result.push Chain::Call.new(n.children[0].to_s, [], @in_block || block_passed?(n))
67
+ result.push Chain::Call.new(n.children[0].to_s, [], @in_block > 0 || block_passed?(n))
68
68
  elsif n.type == :FCALL
69
- result.push Chain::Call.new(n.children[0].to_s, node_to_argchains(n.children[1]), @in_block || block_passed?(n))
69
+ result.push Chain::Call.new(n.children[0].to_s, node_to_argchains(n.children[1]), @in_block > 0 || block_passed?(n))
70
70
  elsif n.type == :SELF
71
71
  result.push Chain::Head.new('self')
72
72
  elsif n.type == :ZSUPER
73
- result.push Chain::ZSuper.new('super', @in_block || block_passed?(n))
73
+ result.push Chain::ZSuper.new('super', @in_block > 0 || block_passed?(n))
74
74
  elsif n.type == :SUPER
75
- result.push Chain::Call.new('super', node_to_argchains(n.children.last), @in_block || block_passed?(n))
75
+ result.push Chain::Call.new('super', node_to_argchains(n.children.last), @in_block > 0 || block_passed?(n))
76
76
  elsif [:COLON2, :COLON3, :CONST].include?(n.type)
77
77
  const = unpack_name(n)
78
78
  result.push Chain::Constant.new(const)
@@ -153,7 +153,7 @@ module Solargraph
153
153
  probcount += problems.length
154
154
  end
155
155
  puts "#{probcount} problem#{probcount != 1 ? 's' : ''} found#{files.length != 1 ? " in #{filecount} of #{files.length} files" : ''}."
156
- exit 1 if probcount.positive?
156
+ exit 1 if probcount > 0
157
157
  end
158
158
 
159
159
  desc 'scan', 'Test the workspace for problems'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.39.14'
4
+ VERSION = '0.39.15'
5
5
  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.39.14
4
+ version: 0.39.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-13 00:00:00.000000000 Z
11
+ date: 2020-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport