solargraph 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: dcc8258dc2a089ffad93983d3b3ce3be674d59ef
4
- data.tar.gz: 9ab4aff3fe0acdad6d240c012ec66fceb29dc31d
3
+ metadata.gz: 28954a2882b95c72c093ab8e9f8a56d36581353e
4
+ data.tar.gz: c49221b919b8f14239eea72d8f7a1ba59ac42c87
5
5
  SHA512:
6
- metadata.gz: 01650890323070734abf02b839cac279d8336190555838d750440958ca0dde3e67f65cb42669ace4e026af479c4b9b1be26949a1cd3a8d00a59a1425476a235b
7
- data.tar.gz: c30d4fa71a335aa731c9093906df3966563320a0e0158976601e403da504c6d11d195f7ca4a4fea188d7eaf72c5b770158c134587ff45dfe458fc7fff318a93f
6
+ metadata.gz: ebe9048897e96e214df878cdb6d8e596e9a3d56b15fa269ee885a966991c62f930ebbe821e54b2d43c1a2ac2119eadfaad40778e99ac1254ad658147df54ebb3
7
+ data.tar.gz: 5a8b6875aced160a813b3285e45604aada791663f4e4581d3d007828f304db717619c4a5c92682366bd7754e8e50c8a5faa4f4ab737c49ca57910a5cff7b5625
@@ -306,11 +306,11 @@ module Solargraph
306
306
  type
307
307
  end
308
308
 
309
- def get_methods(namespace, root = '')
309
+ def get_methods(namespace, root = '', visibility: [:public])
310
310
  meths = []
311
311
  meths += inner_get_methods(namespace, root, []) #unless has_yardoc?
312
312
  yard = YardMap.new(required: @required, workspace: @workspace)
313
- yard_meths = yard.get_methods(namespace, root)
313
+ yard_meths = yard.get_methods(namespace, root, visibility: visibility)
314
314
  if yard_meths.any?
315
315
  meths.concat yard_meths
316
316
  else
@@ -342,11 +342,11 @@ module Solargraph
342
342
  args
343
343
  end
344
344
 
345
- def get_instance_methods(namespace, root = '')
345
+ def get_instance_methods(namespace, root = '', visibility: [:public])
346
346
  meths = []
347
347
  meths += inner_get_instance_methods(namespace, root, []) #unless has_yardoc?
348
348
  yard = YardMap.new(required: @required, workspace: @workspace)
349
- yard_meths = yard.get_instance_methods(namespace, root)
349
+ yard_meths = yard.get_instance_methods(namespace, root, visibility: visibility)
350
350
  if yard_meths.any?
351
351
  meths.concat yard_meths
352
352
  else
@@ -334,9 +334,9 @@ module Solargraph
334
334
  result += get_local_variables_from(local)
335
335
  scope = namespace_at(index) || @node
336
336
  if local.type == :def
337
- result += @api_map.get_instance_methods(scope)
337
+ result += @api_map.get_instance_methods(scope, visibility: [:public, :private, :protected])
338
338
  else
339
- result += @api_map.get_methods(scope)
339
+ result += @api_map.get_methods(scope, visibility: [:public, :private, :protected])
340
340
  end
341
341
  result += @api_map.get_methods('Kernel')
342
342
  result
@@ -1,3 +1,3 @@
1
1
  module Solargraph
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -48,7 +48,7 @@ module Solargraph
48
48
  }
49
49
  end
50
50
  }
51
- found
51
+ found.sort
52
52
  end
53
53
 
54
54
  def document query
@@ -116,7 +116,7 @@ module Solargraph
116
116
  nil
117
117
  end
118
118
 
119
- def get_methods namespace, scope = ''
119
+ def get_methods namespace, scope = '', visibility: [:public]
120
120
  meths = []
121
121
  yardocs.each { |y|
122
122
  yard = YARD::Registry.load! y
@@ -128,7 +128,7 @@ module Solargraph
128
128
  ns = yard.resolve(P(scope), namespace)
129
129
  end
130
130
  unless ns.nil? or !ns.kind_of?(YARD::CodeObjects::NamespaceObject)
131
- ns.meths(scope: :class, visibility: [:public]).each { |m|
131
+ ns.meths(scope: :class, visibility: visibility).each { |m|
132
132
  n = m.to_s.split(/[\.#]/).last
133
133
  label = "#{n}"
134
134
  args = get_method_args(m)
@@ -144,7 +144,7 @@ module Solargraph
144
144
  meths
145
145
  end
146
146
 
147
- def get_instance_methods namespace, scope = ''
147
+ def get_instance_methods namespace, scope = '', visibility: [:public]
148
148
  meths = []
149
149
  yardocs.each { |y|
150
150
  yard = YARD::Registry.load! y
@@ -156,7 +156,7 @@ module Solargraph
156
156
  ns = yard.resolve(P(scope), namespace)
157
157
  end
158
158
  unless ns.nil?
159
- ns.meths(scope: :instance, visibility: [:public]).each { |m|
159
+ ns.meths(scope: :instance, visibility: visibility).each { |m|
160
160
  n = m.to_s.split(/[\.#]/).last
161
161
  if n.to_s.match(/^[a-z]/i) and (namespace == 'Kernel' or !m.to_s.start_with?('Kernel#')) and !m.docstring.to_s.include?(':nodoc:')
162
162
  label = "#{n}"
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.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-25 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser