solargraph 0.39.5 → 0.39.6

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: 42d82e12b3dbc74f908e6fd15757e8856c7c3af088ccbfbc6724f390884f878d
4
- data.tar.gz: df04fa34d85b0633d05ab8fd216873264a4cdaa148089ffa3af909ec68a227a7
3
+ metadata.gz: 4a81ce77f7d8227f2e1bf419edb00bbb35c104f9432f3bf9fca55453f70d118b
4
+ data.tar.gz: 3a3fa7eab3220e6933d4aa79d882caf25f2ec2a21e267b062237d4f3f1437ca2
5
5
  SHA512:
6
- metadata.gz: d1972e824e94ad830815eb780629ef985a5be4b21247f426b603e209cecc60d6c5c02219c63cdc2c6c9ab184013d72e1798c29ef90b5a91d77a92f8dd35e1295
7
- data.tar.gz: 7f5564c3de416999a40e381d853746e759898da6fa09eb6d967735478a24635f1af3cee6695894b7213c8b6746e73d8e3d57d3adc141ab505040e0eb4c8134cd
6
+ metadata.gz: 12fac0ebf0358c1949dde571705a5969049ff72b27d2d2385f72d1272f813ebf133a4aebb5f567462b7d31f105e4960e33fe11f87b2987b00a0a3858e7d533c7
7
+ data.tar.gz: f2562a24884685db6290dfd7c13894949dab71989466dc60ade3a3c2694c90c27ad1d110cc0001e0b03adb1aaabc4ab7ef34d3b8b6fb0ffe5fd8b268c7b70d36
@@ -99,7 +99,7 @@ module Solargraph
99
99
  message = Message.select(request['method']).new(self, request)
100
100
  begin
101
101
  message.process
102
- rescue Exception => e
102
+ rescue StandardError => e
103
103
  logger.warn "Error processing request: [#{e.class}] #{e.message}"
104
104
  logger.warn e.backtrace.join("\n")
105
105
  message.set_error Solargraph::LanguageServer::ErrorCodes::INTERNAL_ERROR, "[#{e.class}] #{e.message}"
@@ -16,7 +16,12 @@ module Solargraph
16
16
  presence: region.closure.location.range,
17
17
  decl: require_keyword?(node) ? :kwarg : :kwoptarg
18
18
  )
19
- region.closure.parameters.push locals.last
19
+ idx = region.closure.parameters.find_index { |par| [:kwrestarg, :blockarg].include?(par.decl) }
20
+ if idx
21
+ region.closure.parameters.insert idx, locals.last
22
+ else
23
+ region.closure.parameters.push locals.last
24
+ end
20
25
  node.children[1] && NodeProcessor.process(node.children[1], region, pins, locals)
21
26
  end
22
27
 
@@ -16,7 +16,12 @@ module Solargraph
16
16
  presence: region.closure.location.range,
17
17
  decl: :optarg
18
18
  )
19
- region.closure.parameters.push locals.last
19
+ idx = region.closure.parameters.find_index { |par| par.decl != :arg }
20
+ if idx
21
+ region.closure.parameters.insert idx, locals.last
22
+ else
23
+ region.closure.parameters.push locals.last
24
+ end
20
25
  node.children[1] && NodeProcessor.process(node.children[1], region, pins, locals)
21
26
  end
22
27
  end
@@ -41,7 +41,7 @@ module Solargraph
41
41
  "*#{name}"
42
42
  when :kwrestarg
43
43
  "**#{name}"
44
- when :block
44
+ when :block, :blockarg
45
45
  "&#{name}"
46
46
  else
47
47
  name
@@ -175,7 +175,7 @@ module Solargraph
175
175
  puts pin_description(pin) if options[:verbose]
176
176
  pin.typify api_map
177
177
  pin.probe api_map
178
- rescue Exception => e
178
+ rescue StandardError => e
179
179
  STDERR.puts "Error testing #{pin_description(pin)} #{pin.location ? "at #{pin.location.filename}:#{pin.location.range.start.line + 1}" : ''}"
180
180
  STDERR.puts "[#{e.class}]: #{e.message}"
181
181
  STDERR.puts e.backtrace.join("\n")
@@ -82,6 +82,8 @@ module Solargraph
82
82
  # @param comment [String]
83
83
  # @return [Integer]
84
84
  def find_directive_line_number comment, tag, start
85
+ # Avoid overruning the index
86
+ return start unless start < comment.lines.length
85
87
  num = comment.lines[start..-1].find_index do |line|
86
88
  # Legacy method directives might be `@method` instead of `@!method`
87
89
  # @todo Legacy syntax should probably emit a warning
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.39.5'
4
+ VERSION = '0.39.6'
5
5
  end
@@ -170,7 +170,7 @@ module Solargraph
170
170
  Dir.chdir base do
171
171
  begin
172
172
  # @type [Gem::Specification]
173
- spec = eval(File.read(file), nil, file)
173
+ spec = eval(File.read(file), TOPLEVEL_BINDING, file)
174
174
  next unless Gem::Specification === spec
175
175
  @gemnames.push spec.name
176
176
  result.concat(spec.require_paths.map { |path| File.join(base, path) })
@@ -102,7 +102,7 @@ module Solargraph
102
102
  else
103
103
  YARD::Registry.load! y
104
104
  end
105
- rescue Exception => e
105
+ rescue StandardError => e
106
106
  Solargraph::Logging.logger.warn "Error loading yardoc '#{y}' #{e.class} #{e.message}"
107
107
  yardocs.delete y
108
108
  nil
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.5
4
+ version: 0.39.6
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-05-02 00:00:00.000000000 Z
11
+ date: 2020-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport