solargraph 0.47.2 → 0.54.0
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 +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/plugins.yml +40 -0
- data/.github/workflows/rspec.yml +4 -8
- data/.github/workflows/typecheck.yml +34 -0
- data/.yardopts +2 -2
- data/CHANGELOG.md +166 -3
- data/LICENSE +1 -1
- data/README.md +19 -16
- data/SPONSORS.md +2 -9
- data/lib/solargraph/api_map/cache.rb +50 -20
- data/lib/solargraph/api_map/source_to_yard.rb +17 -10
- data/lib/solargraph/api_map/store.rb +68 -15
- data/lib/solargraph/api_map.rb +238 -112
- data/lib/solargraph/bench.rb +3 -2
- data/lib/solargraph/cache.rb +77 -0
- data/lib/solargraph/complex_type/type_methods.rb +116 -35
- data/lib/solargraph/complex_type/unique_type.rb +261 -33
- data/lib/solargraph/complex_type.rb +149 -30
- data/lib/solargraph/convention/rakefile.rb +17 -0
- data/lib/solargraph/convention.rb +2 -3
- data/lib/solargraph/converters/dd.rb +5 -0
- data/lib/solargraph/converters/dl.rb +3 -0
- data/lib/solargraph/converters/dt.rb +3 -0
- data/lib/solargraph/diagnostics/rubocop.rb +23 -8
- data/lib/solargraph/diagnostics/rubocop_helpers.rb +4 -1
- data/lib/solargraph/diagnostics/type_check.rb +1 -0
- data/lib/solargraph/diagnostics.rb +2 -2
- data/lib/solargraph/doc_map.rb +187 -0
- data/lib/solargraph/gem_pins.rb +72 -0
- data/lib/solargraph/language_server/host/diagnoser.rb +2 -2
- data/lib/solargraph/language_server/host/dispatch.rb +22 -5
- data/lib/solargraph/language_server/host/message_worker.rb +4 -0
- data/lib/solargraph/language_server/host/sources.rb +8 -65
- data/lib/solargraph/language_server/host.rb +88 -93
- data/lib/solargraph/language_server/message/base.rb +1 -1
- data/lib/solargraph/language_server/message/completion_item/resolve.rb +3 -1
- data/lib/solargraph/language_server/message/extended/check_gem_version.rb +13 -1
- data/lib/solargraph/language_server/message/extended/download_core.rb +1 -5
- data/lib/solargraph/language_server/message/initialize.rb +27 -0
- data/lib/solargraph/language_server/message/initialized.rb +1 -0
- data/lib/solargraph/language_server/message/text_document/document_symbol.rb +4 -1
- data/lib/solargraph/language_server/message/text_document/formatting.rb +5 -4
- data/lib/solargraph/language_server/message/text_document/hover.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/signature_help.rb +1 -6
- data/lib/solargraph/language_server/message/text_document/type_definition.rb +24 -0
- data/lib/solargraph/language_server/message/text_document.rb +1 -1
- data/lib/solargraph/language_server/message/workspace/did_change_configuration.rb +5 -0
- data/lib/solargraph/language_server/message/workspace/did_change_watched_files.rb +10 -3
- data/lib/solargraph/language_server/message.rb +1 -0
- data/lib/solargraph/language_server/progress.rb +118 -0
- data/lib/solargraph/language_server/transport/adapter.rb +16 -1
- data/lib/solargraph/language_server/transport/data_reader.rb +2 -0
- data/lib/solargraph/language_server.rb +1 -0
- data/lib/solargraph/library.rb +231 -104
- data/lib/solargraph/location.rb +1 -0
- data/lib/solargraph/page.rb +6 -0
- data/lib/solargraph/parser/comment_ripper.rb +4 -0
- data/lib/solargraph/parser/node_methods.rb +47 -7
- data/lib/solargraph/parser/node_processor/base.rb +11 -1
- data/lib/solargraph/parser/node_processor.rb +1 -0
- data/lib/solargraph/parser/{legacy → parser_gem}/class_methods.rb +31 -9
- data/lib/solargraph/parser/{legacy → parser_gem}/flawed_builder.rb +3 -1
- data/lib/solargraph/parser/{legacy → parser_gem}/node_chainer.rb +57 -41
- data/lib/solargraph/parser/parser_gem/node_methods.rb +495 -0
- data/lib/solargraph/parser/{rubyvm → parser_gem}/node_processors/alias_node.rb +1 -1
- data/lib/solargraph/parser/parser_gem/node_processors/args_node.rb +53 -0
- data/lib/solargraph/parser/{rubyvm → parser_gem}/node_processors/begin_node.rb +1 -1
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/block_node.rb +3 -2
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/casgn_node.rb +14 -4
- data/lib/solargraph/parser/{rubyvm → parser_gem}/node_processors/cvasgn_node.rb +1 -1
- data/lib/solargraph/parser/{rubyvm → parser_gem}/node_processors/def_node.rb +7 -20
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/defs_node.rb +2 -2
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/gvasgn_node.rb +1 -1
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/ivasgn_node.rb +2 -2
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/lvasgn_node.rb +2 -2
- data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +47 -0
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/namespace_node.rb +2 -2
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/orasgn_node.rb +1 -1
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/resbody_node.rb +3 -3
- data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +42 -0
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/send_node.rb +7 -5
- data/lib/solargraph/parser/{legacy → parser_gem}/node_processors/sym_node.rb +1 -1
- data/lib/solargraph/parser/parser_gem/node_processors.rb +56 -0
- data/lib/solargraph/parser/parser_gem.rb +12 -0
- data/lib/solargraph/parser/region.rb +1 -1
- data/lib/solargraph/parser/snippet.rb +2 -0
- data/lib/solargraph/parser.rb +9 -10
- data/lib/solargraph/pin/base.rb +69 -11
- data/lib/solargraph/pin/base_variable.rb +40 -7
- data/lib/solargraph/pin/block.rb +81 -33
- data/lib/solargraph/pin/closure.rb +17 -2
- data/lib/solargraph/pin/common.rb +7 -3
- data/lib/solargraph/pin/conversions.rb +34 -8
- data/lib/solargraph/pin/delegated_method.rb +101 -0
- data/lib/solargraph/pin/documenting.rb +25 -32
- data/lib/solargraph/pin/instance_variable.rb +4 -0
- data/lib/solargraph/pin/local_variable.rb +13 -1
- data/lib/solargraph/pin/method.rb +273 -17
- data/lib/solargraph/pin/namespace.rb +17 -1
- data/lib/solargraph/pin/parameter.rb +40 -28
- data/lib/solargraph/pin/reference/override.rb +2 -2
- data/lib/solargraph/pin/reference.rb +8 -0
- data/lib/solargraph/pin/search.rb +4 -4
- data/lib/solargraph/pin/signature.rb +143 -0
- data/lib/solargraph/pin.rb +2 -1
- data/lib/solargraph/range.rb +4 -6
- data/lib/solargraph/rbs_map/conversions.rb +607 -0
- data/lib/solargraph/rbs_map/core_fills.rb +50 -0
- data/lib/solargraph/rbs_map/core_map.rb +28 -0
- data/lib/solargraph/rbs_map/stdlib_map.rb +33 -0
- data/lib/solargraph/rbs_map.rb +92 -0
- data/lib/solargraph/shell.rb +85 -59
- data/lib/solargraph/source/chain/array.rb +32 -0
- data/lib/solargraph/source/chain/block_symbol.rb +13 -0
- data/lib/solargraph/source/chain/call.rb +125 -61
- data/lib/solargraph/source/chain/constant.rb +15 -1
- data/lib/solargraph/source/chain/if.rb +23 -0
- data/lib/solargraph/source/chain/link.rb +8 -2
- data/lib/solargraph/source/chain/or.rb +1 -1
- data/lib/solargraph/source/chain/z_super.rb +3 -3
- data/lib/solargraph/source/chain.rb +64 -14
- data/lib/solargraph/source/change.rb +3 -0
- data/lib/solargraph/source/cursor.rb +2 -0
- data/lib/solargraph/source/source_chainer.rb +8 -5
- data/lib/solargraph/source/updater.rb +1 -0
- data/lib/solargraph/source.rb +18 -63
- data/lib/solargraph/source_map/clip.rb +31 -23
- data/lib/solargraph/source_map/mapper.rb +23 -7
- data/lib/solargraph/source_map.rb +36 -11
- data/lib/solargraph/type_checker/checks.rb +10 -2
- data/lib/solargraph/type_checker.rb +229 -100
- data/lib/solargraph/version.rb +1 -1
- data/lib/solargraph/views/environment.erb +2 -2
- data/lib/solargraph/workspace/config.rb +15 -11
- data/lib/solargraph/workspace.rb +41 -17
- data/lib/solargraph/yard_map/cache.rb +6 -0
- data/lib/solargraph/yard_map/helpers.rb +1 -1
- data/lib/solargraph/yard_map/mapper/to_method.rb +23 -7
- data/lib/solargraph/yard_map/mapper.rb +1 -1
- data/lib/solargraph/yard_map/to_method.rb +11 -4
- data/lib/solargraph/yard_map.rb +1 -443
- data/lib/solargraph/yard_tags.rb +20 -0
- data/lib/solargraph/yardoc.rb +52 -0
- data/lib/solargraph.rb +8 -6
- data/solargraph.gemspec +19 -8
- metadata +164 -99
- data/.travis.yml +0 -19
- data/lib/solargraph/api_map/bundler_methods.rb +0 -22
- data/lib/solargraph/compat.rb +0 -37
- data/lib/solargraph/convention/rspec.rb +0 -30
- data/lib/solargraph/documentor.rb +0 -76
- data/lib/solargraph/language_server/host/cataloger.rb +0 -56
- data/lib/solargraph/parser/legacy/node_methods.rb +0 -325
- data/lib/solargraph/parser/legacy/node_processors/alias_node.rb +0 -23
- data/lib/solargraph/parser/legacy/node_processors/args_node.rb +0 -35
- data/lib/solargraph/parser/legacy/node_processors/begin_node.rb +0 -15
- data/lib/solargraph/parser/legacy/node_processors/cvasgn_node.rb +0 -23
- data/lib/solargraph/parser/legacy/node_processors/def_node.rb +0 -63
- data/lib/solargraph/parser/legacy/node_processors/sclass_node.rb +0 -21
- data/lib/solargraph/parser/legacy/node_processors.rb +0 -54
- data/lib/solargraph/parser/legacy.rb +0 -12
- data/lib/solargraph/parser/rubyvm/class_methods.rb +0 -144
- data/lib/solargraph/parser/rubyvm/node_chainer.rb +0 -160
- data/lib/solargraph/parser/rubyvm/node_methods.rb +0 -315
- data/lib/solargraph/parser/rubyvm/node_processors/args_node.rb +0 -85
- data/lib/solargraph/parser/rubyvm/node_processors/block_node.rb +0 -42
- data/lib/solargraph/parser/rubyvm/node_processors/casgn_node.rb +0 -22
- data/lib/solargraph/parser/rubyvm/node_processors/defs_node.rb +0 -57
- data/lib/solargraph/parser/rubyvm/node_processors/gvasgn_node.rb +0 -23
- data/lib/solargraph/parser/rubyvm/node_processors/ivasgn_node.rb +0 -38
- data/lib/solargraph/parser/rubyvm/node_processors/kw_arg_node.rb +0 -39
- data/lib/solargraph/parser/rubyvm/node_processors/lit_node.rb +0 -20
- data/lib/solargraph/parser/rubyvm/node_processors/lvasgn_node.rb +0 -27
- data/lib/solargraph/parser/rubyvm/node_processors/namespace_node.rb +0 -39
- data/lib/solargraph/parser/rubyvm/node_processors/opt_arg_node.rb +0 -26
- data/lib/solargraph/parser/rubyvm/node_processors/orasgn_node.rb +0 -15
- data/lib/solargraph/parser/rubyvm/node_processors/resbody_node.rb +0 -45
- data/lib/solargraph/parser/rubyvm/node_processors/sclass_node.rb +0 -21
- data/lib/solargraph/parser/rubyvm/node_processors/scope_node.rb +0 -15
- data/lib/solargraph/parser/rubyvm/node_processors/send_node.rb +0 -277
- data/lib/solargraph/parser/rubyvm/node_processors/sym_node.rb +0 -18
- data/lib/solargraph/parser/rubyvm/node_processors.rb +0 -63
- data/lib/solargraph/parser/rubyvm.rb +0 -40
- data/lib/solargraph/yard_map/core_docs.rb +0 -170
- data/lib/solargraph/yard_map/core_fills.rb +0 -208
- data/lib/solargraph/yard_map/core_gen.rb +0 -76
- data/lib/solargraph/yard_map/rdoc_to_yard.rb +0 -140
- data/lib/solargraph/yard_map/stdlib_fills.rb +0 -43
- data/lib/yard-solargraph.rb +0 -33
- data/yardoc/2.2.2.tar.gz +0 -0
data/lib/solargraph/workspace.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'open3'
|
4
|
-
require 'rubygems'
|
5
4
|
require 'json'
|
6
5
|
|
7
6
|
module Solargraph
|
@@ -26,9 +25,11 @@ module Solargraph
|
|
26
25
|
|
27
26
|
# @param directory [String]
|
28
27
|
# @param config [Config, nil]
|
29
|
-
|
28
|
+
# @param server [Hash]
|
29
|
+
def initialize directory = '', config = nil, server = {}
|
30
30
|
@directory = directory
|
31
31
|
@config = config
|
32
|
+
@server = server
|
32
33
|
load_sources
|
33
34
|
@gemnames = []
|
34
35
|
@require_paths = generate_require_paths
|
@@ -46,24 +47,21 @@ module Solargraph
|
|
46
47
|
#
|
47
48
|
# @param source [Solargraph::Source]
|
48
49
|
# @return [Boolean] True if the source was added to the workspace
|
49
|
-
def merge
|
50
|
-
unless directory == '*' || source_hash.key?(source.filename)
|
50
|
+
def merge *sources
|
51
|
+
unless directory == '*' || sources.all? { |source| source_hash.key?(source.filename) }
|
51
52
|
# Reload the config to determine if a new source should be included
|
52
53
|
@config = Solargraph::Workspace::Config.new(directory)
|
53
|
-
return false unless config.calculated.include?(source.filename)
|
54
54
|
end
|
55
|
-
source_hash[source.filename] = source
|
56
|
-
true
|
57
|
-
end
|
58
55
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
56
|
+
includes_any = false
|
57
|
+
sources.each do |source|
|
58
|
+
if directory == "*" || config.calculated.include?(source.filename)
|
59
|
+
source_hash[source.filename] = source
|
60
|
+
includes_any = true
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
includes_any
|
67
65
|
end
|
68
66
|
|
69
67
|
# Remove a source from the workspace. The source will not be removed if
|
@@ -107,7 +105,8 @@ module Solargraph
|
|
107
105
|
# @return [Boolean]
|
108
106
|
def would_require? path
|
109
107
|
require_paths.each do |rp|
|
110
|
-
|
108
|
+
full = File.join rp, path
|
109
|
+
return true if File.exist?(full) or File.exist?(full << ".rb")
|
111
110
|
end
|
112
111
|
false
|
113
112
|
end
|
@@ -129,6 +128,11 @@ module Solargraph
|
|
129
128
|
end
|
130
129
|
end
|
131
130
|
|
131
|
+
# @return [String, nil]
|
132
|
+
def rbs_collection_path
|
133
|
+
@gem_rbs_collection ||= read_rbs_collection_path
|
134
|
+
end
|
135
|
+
|
132
136
|
# Synchronize the workspace from the provided updater.
|
133
137
|
#
|
134
138
|
# @param updater [Source::Updater]
|
@@ -137,8 +141,19 @@ module Solargraph
|
|
137
141
|
source_hash[updater.filename] = source_hash[updater.filename].synchronize(updater)
|
138
142
|
end
|
139
143
|
|
144
|
+
# @return [String]
|
145
|
+
def command_path
|
146
|
+
server['commandPath'] || 'solargraph'
|
147
|
+
end
|
148
|
+
|
140
149
|
private
|
141
150
|
|
151
|
+
# The language server configuration (or an empty hash if the workspace was
|
152
|
+
# not initialized from a server).
|
153
|
+
#
|
154
|
+
# @return [Hash]
|
155
|
+
attr_reader :server
|
156
|
+
|
142
157
|
# @return [Hash{String => Solargraph::Source}]
|
143
158
|
def source_hash
|
144
159
|
@source_hash ||= {}
|
@@ -202,6 +217,7 @@ module Solargraph
|
|
202
217
|
config.require_paths.map{|p| File.join(directory, p)}
|
203
218
|
end
|
204
219
|
|
220
|
+
# @return [void]
|
205
221
|
def require_plugins
|
206
222
|
config.plugins.each do |plugin|
|
207
223
|
begin
|
@@ -211,5 +227,13 @@ module Solargraph
|
|
211
227
|
end
|
212
228
|
end
|
213
229
|
end
|
230
|
+
|
231
|
+
# @return [String, nil]
|
232
|
+
def read_rbs_collection_path
|
233
|
+
yaml_file = File.join(directory, 'rbs_collection.yaml')
|
234
|
+
return unless File.file?(yaml_file)
|
235
|
+
|
236
|
+
YAML.load_file(yaml_file)&.fetch('path')
|
237
|
+
end
|
214
238
|
end
|
215
239
|
end
|
@@ -4,13 +4,19 @@ module Solargraph
|
|
4
4
|
class YardMap
|
5
5
|
class Cache
|
6
6
|
def initialize
|
7
|
+
# @type [Hash{String => Array<Solargraph::Pin::Base>}]
|
7
8
|
@path_pins = {}
|
8
9
|
end
|
9
10
|
|
11
|
+
# @param path [String]
|
12
|
+
# @param pins [Array<Solargraph::Pin::Base>]
|
13
|
+
# @return [Array<Solargraph::Pin::Base>]
|
10
14
|
def set_path_pins path, pins
|
11
15
|
@path_pins[path] = pins
|
12
16
|
end
|
13
17
|
|
18
|
+
# @param path [String]
|
19
|
+
# @return [Array<Solargraph::Pin::Base>]
|
14
20
|
def get_path_pins path
|
15
21
|
@path_pins[path]
|
16
22
|
end
|
@@ -4,7 +4,7 @@ module Solargraph
|
|
4
4
|
module_function
|
5
5
|
|
6
6
|
# @param code_object [YARD::CodeObjects::Base]
|
7
|
-
# @param spec [Gem::Specification]
|
7
|
+
# @param spec [Gem::Specification, nil]
|
8
8
|
# @return [Solargraph::Location, nil]
|
9
9
|
def object_location code_object, spec
|
10
10
|
return nil if spec.nil? || code_object.nil? || code_object.file.nil? || code_object.line.nil?
|
@@ -6,31 +6,47 @@ module Solargraph
|
|
6
6
|
module ToMethod
|
7
7
|
extend YardMap::Helpers
|
8
8
|
|
9
|
+
# @param code_object [YARD::CodeObjects::Base]
|
10
|
+
# @param name [String, nil]
|
11
|
+
# @param scope [Symbol, nil]
|
12
|
+
# @param visibility [Symbol, nil]
|
13
|
+
# @param closure [Solargraph::Pin::Namespace, nil]
|
14
|
+
# @param spec [Gem::Specification, nil]
|
15
|
+
# @return [Solargraph::Pin::Method]
|
9
16
|
def self.make code_object, name = nil, scope = nil, visibility = nil, closure = nil, spec = nil
|
10
17
|
closure ||= Solargraph::Pin::Namespace.new(
|
11
18
|
name: code_object.namespace.to_s,
|
12
19
|
gates: [code_object.namespace.to_s]
|
13
20
|
)
|
14
21
|
location = object_location(code_object, spec)
|
22
|
+
name ||= code_object.name.to_s
|
23
|
+
return_type = ComplexType::SELF if name == 'new'
|
15
24
|
comments = code_object.docstring ? code_object.docstring.all.to_s : ''
|
16
|
-
Pin::Method.new(
|
25
|
+
pin = Pin::Method.new(
|
17
26
|
location: location,
|
18
27
|
closure: closure,
|
19
|
-
name: name
|
28
|
+
name: name,
|
20
29
|
comments: comments,
|
21
30
|
scope: scope || code_object.scope,
|
22
31
|
visibility: visibility || code_object.visibility,
|
23
|
-
|
24
|
-
|
32
|
+
# @todo Might need to convert overloads to signatures
|
33
|
+
parameters: [],
|
34
|
+
explicit: code_object.is_explicit?,
|
35
|
+
return_type: return_type
|
25
36
|
)
|
37
|
+
pin.parameters.concat get_parameters(code_object, location, comments, pin)
|
38
|
+
pin
|
26
39
|
end
|
27
40
|
|
28
41
|
class << self
|
29
42
|
private
|
30
43
|
|
31
44
|
# @param code_object [YARD::CodeObjects::Base]
|
45
|
+
# @param location [Location],
|
46
|
+
# @param comments [String]
|
47
|
+
# @param pin [Pin::Base]
|
32
48
|
# @return [Array<Solargraph::Pin::Parameter>]
|
33
|
-
def get_parameters code_object, location, comments
|
49
|
+
def get_parameters code_object, location, comments, pin
|
34
50
|
return [] unless code_object.is_a?(YARD::CodeObjects::MethodObject)
|
35
51
|
# HACK: Skip `nil` and `self` parameters that are sometimes emitted
|
36
52
|
# for methods defined in C
|
@@ -38,7 +54,7 @@ module Solargraph
|
|
38
54
|
code_object.parameters.select { |a| a[0] && a[0] != 'self' }.map do |a|
|
39
55
|
Solargraph::Pin::Parameter.new(
|
40
56
|
location: location,
|
41
|
-
closure:
|
57
|
+
closure: pin,
|
42
58
|
comments: comments,
|
43
59
|
name: arg_name(a),
|
44
60
|
presence: nil,
|
@@ -48,7 +64,7 @@ module Solargraph
|
|
48
64
|
end
|
49
65
|
end
|
50
66
|
|
51
|
-
# @param a [Array]
|
67
|
+
# @param a [Array<String>]
|
52
68
|
# @return [String]
|
53
69
|
def arg_name a
|
54
70
|
a[0].gsub(/[^a-z0-9_]/i, '')
|
@@ -8,7 +8,7 @@ module Solargraph
|
|
8
8
|
autoload :ToConstant, 'solargraph/yard_map/mapper/to_constant'
|
9
9
|
|
10
10
|
# @param code_objects [Array<YARD::CodeObjects::Base>]
|
11
|
-
# @param spec [Gem::Specification]
|
11
|
+
# @param spec [Gem::Specification, nil]
|
12
12
|
def initialize code_objects, spec = nil
|
13
13
|
@code_objects = code_objects
|
14
14
|
@spec = spec
|
@@ -7,6 +7,8 @@ module Solargraph
|
|
7
7
|
module_function
|
8
8
|
|
9
9
|
# @param code_object [YARD::CodeObjects::Base]
|
10
|
+
# @param location [Solargraph::Location]
|
11
|
+
# @param comments [String]
|
10
12
|
# @return [Array<Solargraph::Pin::Parameter>]
|
11
13
|
def get_parameters code_object, location, comments
|
12
14
|
return [] unless code_object.is_a?(YARD::CodeObjects::MethodObject)
|
@@ -26,7 +28,7 @@ module Solargraph
|
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
29
|
-
# @param a [Array]
|
31
|
+
# @param a [Array<String>]
|
30
32
|
# @return [String]
|
31
33
|
def arg_name a
|
32
34
|
a[0].gsub(/[^a-z0-9_]/i, '')
|
@@ -52,10 +54,15 @@ module Solargraph
|
|
52
54
|
end
|
53
55
|
private_constant :InnerMethods
|
54
56
|
|
55
|
-
|
56
|
-
# extend YardMixin
|
57
|
-
extend Helpers
|
57
|
+
include Helpers
|
58
58
|
|
59
|
+
# @param code_object [YARD::CodeObjects::Base]
|
60
|
+
# @param name [String, nil]
|
61
|
+
# @param scope [Symbol, nil]
|
62
|
+
# @param visibility [Symbol, nil]
|
63
|
+
# @param closure [Solargraph::Pin::Base, nil]
|
64
|
+
# @param spec [Solargraph::Pin::Base, nil]
|
65
|
+
# @return [Solargraph::Pin::Method]
|
59
66
|
def make code_object, name = nil, scope = nil, visibility = nil, closure = nil, spec = nil
|
60
67
|
closure ||= Solargraph::Pin::Namespace.new(
|
61
68
|
name: code_object.namespace.to_s,
|