solargraph 0.32.2 → 0.32.3

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: 80e5d1c7f259f52bafd116d70e972be0409e282539c568f19ecb4114d7b88f36
4
- data.tar.gz: ae52fc598ab045b3cae66f84fcc5157f69d3d51cbd283f396760fab35f22ec4f
3
+ metadata.gz: d76bcc0ee329b23c7c59aabc9a502d8960c40e9b16ab4dc1983f2c6dc76b6344
4
+ data.tar.gz: 6b264048a68bf50e96e56bc527340df96b638bbe7ca43d4d9d561af84dbdcb3c
5
5
  SHA512:
6
- metadata.gz: 1473f5115ab0b6890318053325754af90eb37b949dab4397efbd71db929d1a0272d6e4b9429a21cb127aaa6c4268ee0112837be9fc794fd4581cc9f3729face2
7
- data.tar.gz: 23c8737bafb64c0acf80db643d0df6e990cc73f1ef3ece715507170c3dbc1449118cb923642f6ef7da73c426c448710eda58dcf3e2167ed8b0f986db04caa56e
6
+ metadata.gz: 617c3091175a9a37737f5e2d8381cedfcdf8bb07c07aeeb00bbdf7b9d4076b29029e1b0c78555d6cb38fceda225245bbc02be1e51adc784bed9e2df1fec5161b
7
+ data.tar.gz: d431aa76ca0d2e2927defe3b11f0f26f8b388758fd930615602eb41c549bc6a0ad2c1c1135fc6bf56dcd81a9e989374ebde2b49d65789880779349702b257d04
@@ -608,7 +608,7 @@ module Solargraph
608
608
  # @return [Symbol] :class, :module, or nil
609
609
  def get_namespace_type fqns
610
610
  return nil if fqns.nil?
611
- pin = store.get_path_pins(fqns).first
611
+ pin = store.get_path_pins(fqns).select{|p| p.is_a?(Pin::Namespace)}.first
612
612
  return nil if pin.nil?
613
613
  pin.type
614
614
  end
@@ -32,7 +32,14 @@ module Solargraph
32
32
  # @param context [Solargraph::ComplexType]
33
33
  # @return [Pin::Method]
34
34
  def virtual_new_pin new_pin, context
35
- Pin::ProxyType.anonymous(ComplexType.try_parse(context.namespace))
35
+ case new_pin.path
36
+ when 'Class.new'
37
+ Pin::ProxyType.anonymous(ComplexType.try_parse('Class<Object>'))
38
+ when 'Class#new'
39
+ Pin::ProxyType.anonymous(ComplexType.try_parse(context.namespace == 'Class' ? 'Object' : context.namespace))
40
+ else
41
+ Pin::ProxyType.anonymous(ComplexType.try_parse(context.namespace))
42
+ end
36
43
  end
37
44
 
38
45
  def inferred_pins pins, api_map, context, locals
@@ -61,7 +68,7 @@ module Solargraph
61
68
  end
62
69
 
63
70
  def external_constructor? pin, context
64
- pin.path == 'Class#new' || (pin.name == 'new' && pin.scope == :class && pin.return_type != context)
71
+ pin.path == 'Class#new' || (pin.name == 'new' && pin.scope == :class && pin.docstring.tag(:return).nil?)
65
72
  end
66
73
 
67
74
  # @param pin [Pin::Method]
@@ -1,3 +1,3 @@
1
1
  module Solargraph
2
- VERSION = '0.32.2'
2
+ VERSION = '0.32.3'
3
3
  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.32.2
4
+ version: 0.32.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-07 00:00:00.000000000 Z
11
+ date: 2019-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport