solargraph 0.38.4 → 0.38.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fee6de28dda75ac732866b6ca8e68f52d3b5c4216feac100cbe3196280059f34
4
- data.tar.gz: f8f51dc88c5aff911673a186d2c7ddb60a9e31cd084318741f2cae237091607a
3
+ metadata.gz: 5f5704121cc7b82b0999302bb964ff7d2a0973e724fcbff4f0c2be6b3d800848
4
+ data.tar.gz: b7341f99fa186eebc3803955912c34a841b0be13b77e4725a9f16f5af5b009d2
5
5
  SHA512:
6
- metadata.gz: 78f433fe6a05b703945d53f74ef2b19c24e23c1aca77fcc71c0c6a88499e6c7900e275cdc43913cd51ff3a3fda7785885ece07e68daa18c7eae1f705dc990974
7
- data.tar.gz: 313f01cdc3336c46a1ff6659c84b393192f0b7fab112ae479285f4e7a4b0866da61e47bbb8c2e41638beb931a92e408e2a285d841071a47f006ca16281d3a16c
6
+ metadata.gz: 9abc64fe7dff520bf58f3cb526013c9d2250adbae6ecd7eca22294d7eba4365c548bcd191c08974275186d13cbac421c9cc32cc53ddbe7fdedc549b00eacddd7
7
+ data.tar.gz: db55ce70f037c55a3da7b5f6b060f2bf51d996e78aa51c701e987de9eb1227dc30a99d06248ee88d1f318632d050e9a07cca4435bf8e91f60a21c630a6f27a31
@@ -222,10 +222,6 @@ module Solargraph
222
222
  visibility = [:public]
223
223
  visibility.push :private if fqns == context
224
224
  result.concat inner_get_constants(fqns, visibility, skip)
225
- fqns = qualify(namespace, '')
226
- visibility = [:public]
227
- visibility.push :private if fqns == context
228
- result.concat inner_get_constants(fqns, visibility, skip)
229
225
  end
230
226
  cache.set_constants(namespace, contexts, result)
231
227
  result
@@ -516,9 +512,7 @@ module Solargraph
516
512
  fqsup = qualify(sup)
517
513
  cls = qualify(sub)
518
514
  until fqsup.nil? || cls.nil?
519
- # @todo Classes in the workspace are not detected as subclasses of
520
- # Object. The quick and dirty fix is to hardcode it here.
521
- return true if fqsup == 'Object' || cls == fqsup
515
+ return true if cls == fqsup
522
516
  cls = qualify(store.get_superclass(cls), cls)
523
517
  end
524
518
  false
@@ -14,7 +14,8 @@ module Solargraph
14
14
  filename = uri_to_file(params['textDocument']['uri'])
15
15
  # Make the temp file in the original file's directory so RuboCop
16
16
  # detects the correct configuration
17
- tempfile = File.join(File.dirname(filename), "_tmp_#{SecureRandom.hex(8)}_#{File.basename(filename)}")
17
+ # the .rb extension is needed for ruby file without extension, else rubocop won't format
18
+ tempfile = File.join(File.dirname(filename), "_tmp_#{SecureRandom.hex(8)}_#{File.basename(filename)}.rb")
18
19
  original = host.read_text(params['textDocument']['uri'])
19
20
  File.write tempfile, original
20
21
  begin
@@ -26,9 +26,6 @@ module Solargraph
26
26
  def receiving data
27
27
  @data_reader.receive data
28
28
  end
29
- # @todo Temporary alias to avoid problems due to a breaking change in
30
- # the Backport API
31
- alias sending receiving
32
29
 
33
30
  def update
34
31
  if @host.stopped?
@@ -58,7 +58,7 @@ module Solargraph
58
58
  if here.scope == :instance
59
59
  return ComplexType.try_parse(here.context.namespace)
60
60
  else
61
- return here.closure.return_type
61
+ return here.context
62
62
  end
63
63
  end
64
64
  here = here.closure
@@ -10,7 +10,9 @@ module Solargraph
10
10
 
11
11
  def resolve api_map, name_pin, locals
12
12
  return [Pin::ROOT_PIN] if word.empty?
13
+ rooted = false
13
14
  if word.start_with?('::')
15
+ rooted = true
14
16
  bottom = ''
15
17
  gates = [word[2..-1].split('::')[0..-2].join('::')]
16
18
  else
@@ -18,7 +20,7 @@ module Solargraph
18
20
  gates = crawl_gates(name_pin)
19
21
  end
20
22
  result = api_map.get_constants(bottom, *gates)
21
- result.select{ |p| p.path == word || "::#{p.path}" == word || p.path.end_with?("::#{word}") }
23
+ result.select{ |p| rooted ? p.path == word[2..-1] : p.path == word || "::#{p.path}" == word || p.path.end_with?("::#{word}") }
22
24
  end
23
25
 
24
26
  private
@@ -65,16 +65,6 @@ module Solargraph
65
65
  pins.select{|pin| pin.is_a?(Pin::Closure) && pin.path && !pin.path.empty? && pin.location.range.contain?(position)}.last
66
66
  end
67
67
 
68
- # @todo Candidate for deprecation
69
- def block_pin position
70
- pins.select{|pin| pin.is_a?(Pin::Closure) && pin.location.range.contain?(position)}.last
71
- end
72
-
73
- # @todo Candidate for deprecation
74
- def closure_pin position
75
- pins.select{|pin| pin.is_a?(Pin::Closure) && pin.location.range.contain?(position)}.last
76
- end
77
-
78
68
  private
79
69
 
80
70
  def method_args
@@ -5,7 +5,6 @@ module Solargraph
5
5
  module NodeProcessor
6
6
  class DefNode < Base
7
7
  def process
8
- loc = get_node_location(node)
9
8
  methpin = Solargraph::Pin::Method.new(
10
9
  location: get_node_location(node),
11
10
  closure: region.closure,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.38.4'
4
+ VERSION = '0.38.5'
5
5
  end
@@ -258,11 +258,9 @@ module Solargraph
258
258
  result = []
259
259
  (spec.dependencies - spec.development_dependencies).each do |dep|
260
260
  begin
261
- if @source_gems.include?(dep.name)
262
- next
263
- end
261
+ next if @source_gems.include?(dep.name) || @gem_paths.key?(dep.name)
264
262
  depspec = Gem::Specification.find_by_name(dep.name)
265
- next if depspec.nil? || @gem_paths.key?(depspec.name)
263
+ next if depspec.nil?
266
264
  @gem_paths[depspec.name] = depspec.full_gem_path
267
265
  gy = yardoc_file_for_spec(depspec)
268
266
  if gy.nil?
@@ -315,7 +313,7 @@ module Solargraph
315
313
  spec = Gem::Specification.find_by_path(path) || Gem::Specification.find_by_name(path.split('/').first)
316
314
  # Avoid loading the spec again if it's going to be skipped anyway
317
315
  return spec if @source_gems.include?(spec.name)
318
- # Avoid loading the spec again if it's alredy the correct version
316
+ # Avoid loading the spec again if it's already the correct version
319
317
  if @gemset[spec.name] && @gemset[spec.name] != spec.version
320
318
  begin
321
319
  return Gem::Specification.find_by_name(spec.name, "= #{@gemset[spec.name]}")
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.38.4
4
+ version: 0.38.5
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-01-21 00:00:00.000000000 Z
11
+ date: 2020-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport