ruby-lsp 0.23.11 → 0.23.16
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/README.md +2 -2
- data/VERSION +1 -1
- data/exe/ruby-lsp-launcher +20 -11
- data/lib/rubocop/cop/ruby_lsp/use_language_server_aliases.rb +1 -1
- data/lib/rubocop/cop/ruby_lsp/use_register_with_handler_method.rb +3 -5
- data/lib/ruby_indexer/lib/ruby_indexer/configuration.rb +82 -116
- data/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb +123 -169
- data/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb +9 -7
- data/lib/ruby_indexer/lib/ruby_indexer/entry.rb +92 -202
- data/lib/ruby_indexer/lib/ruby_indexer/index.rb +116 -222
- data/lib/ruby_indexer/lib/ruby_indexer/location.rb +4 -27
- data/lib/ruby_indexer/lib/ruby_indexer/prefix_tree.rb +18 -19
- data/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb +22 -45
- data/lib/ruby_indexer/lib/ruby_indexer/reference_finder.rb +47 -61
- data/lib/ruby_indexer/lib/ruby_indexer/uri.rb +17 -19
- data/lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb +5 -9
- data/lib/ruby_indexer/test/class_variables_test.rb +14 -14
- data/lib/ruby_indexer/test/classes_and_modules_test.rb +65 -40
- data/lib/ruby_indexer/test/configuration_test.rb +48 -7
- data/lib/ruby_indexer/test/constant_test.rb +34 -34
- data/lib/ruby_indexer/test/enhancements_test.rb +1 -1
- data/lib/ruby_indexer/test/index_test.rb +139 -135
- data/lib/ruby_indexer/test/instance_variables_test.rb +37 -37
- data/lib/ruby_indexer/test/method_test.rb +143 -117
- data/lib/ruby_indexer/test/prefix_tree_test.rb +13 -13
- data/lib/ruby_indexer/test/rbs_indexer_test.rb +65 -71
- data/lib/ruby_indexer/test/test_case.rb +2 -2
- data/lib/ruby_indexer/test/uri_test.rb +15 -2
- data/lib/ruby_lsp/addon.rb +44 -71
- data/lib/ruby_lsp/base_server.rb +29 -32
- data/lib/ruby_lsp/client_capabilities.rb +10 -12
- data/lib/ruby_lsp/document.rb +39 -45
- data/lib/ruby_lsp/erb_document.rb +36 -40
- data/lib/ruby_lsp/global_state.rb +52 -57
- data/lib/ruby_lsp/internal.rb +2 -0
- data/lib/ruby_lsp/listeners/code_lens.rb +82 -89
- data/lib/ruby_lsp/listeners/completion.rb +60 -66
- data/lib/ruby_lsp/listeners/definition.rb +38 -52
- data/lib/ruby_lsp/listeners/document_highlight.rb +123 -150
- data/lib/ruby_lsp/listeners/document_link.rb +46 -63
- data/lib/ruby_lsp/listeners/document_symbol.rb +38 -52
- data/lib/ruby_lsp/listeners/folding_ranges.rb +40 -43
- data/lib/ruby_lsp/listeners/hover.rb +83 -102
- data/lib/ruby_lsp/listeners/inlay_hints.rb +4 -11
- data/lib/ruby_lsp/listeners/semantic_highlighting.rb +54 -56
- data/lib/ruby_lsp/listeners/signature_help.rb +11 -26
- data/lib/ruby_lsp/listeners/spec_style.rb +155 -0
- data/lib/ruby_lsp/listeners/test_discovery.rb +89 -0
- data/lib/ruby_lsp/listeners/test_style.rb +160 -88
- data/lib/ruby_lsp/node_context.rb +12 -39
- data/lib/ruby_lsp/rbs_document.rb +8 -6
- data/lib/ruby_lsp/requests/code_action_resolve.rb +24 -25
- data/lib/ruby_lsp/requests/code_actions.rb +14 -26
- data/lib/ruby_lsp/requests/code_lens.rb +6 -17
- data/lib/ruby_lsp/requests/completion.rb +7 -20
- data/lib/ruby_lsp/requests/completion_resolve.rb +6 -6
- data/lib/ruby_lsp/requests/definition.rb +8 -17
- data/lib/ruby_lsp/requests/diagnostics.rb +8 -11
- data/lib/ruby_lsp/requests/discover_tests.rb +18 -5
- data/lib/ruby_lsp/requests/document_highlight.rb +5 -15
- data/lib/ruby_lsp/requests/document_link.rb +6 -17
- data/lib/ruby_lsp/requests/document_symbol.rb +5 -8
- data/lib/ruby_lsp/requests/folding_ranges.rb +7 -15
- data/lib/ruby_lsp/requests/formatting.rb +6 -9
- data/lib/ruby_lsp/requests/go_to_relevant_file.rb +87 -0
- data/lib/ruby_lsp/requests/hover.rb +10 -20
- data/lib/ruby_lsp/requests/inlay_hints.rb +6 -17
- data/lib/ruby_lsp/requests/on_type_formatting.rb +32 -40
- data/lib/ruby_lsp/requests/prepare_rename.rb +4 -9
- data/lib/ruby_lsp/requests/prepare_type_hierarchy.rb +5 -15
- data/lib/ruby_lsp/requests/range_formatting.rb +5 -6
- data/lib/ruby_lsp/requests/references.rb +8 -37
- data/lib/ruby_lsp/requests/rename.rb +19 -42
- data/lib/ruby_lsp/requests/request.rb +7 -19
- data/lib/ruby_lsp/requests/selection_ranges.rb +6 -6
- data/lib/ruby_lsp/requests/semantic_highlighting.rb +16 -35
- data/lib/ruby_lsp/requests/show_syntax_tree.rb +7 -8
- data/lib/ruby_lsp/requests/signature_help.rb +8 -26
- data/lib/ruby_lsp/requests/support/annotation.rb +4 -10
- data/lib/ruby_lsp/requests/support/common.rb +16 -51
- data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +27 -35
- data/lib/ruby_lsp/requests/support/rubocop_formatter.rb +11 -14
- data/lib/ruby_lsp/requests/support/rubocop_runner.rb +22 -34
- data/lib/ruby_lsp/requests/support/selection_range.rb +1 -3
- data/lib/ruby_lsp/requests/support/sorbet.rb +29 -38
- data/lib/ruby_lsp/requests/support/source_uri.rb +20 -32
- data/lib/ruby_lsp/requests/support/syntax_tree_formatter.rb +12 -19
- data/lib/ruby_lsp/requests/support/test_item.rb +10 -14
- data/lib/ruby_lsp/requests/type_hierarchy_supertypes.rb +5 -6
- data/lib/ruby_lsp/requests/workspace_symbol.rb +4 -4
- data/lib/ruby_lsp/response_builders/collection_response_builder.rb +5 -5
- data/lib/ruby_lsp/response_builders/document_symbol.rb +13 -18
- data/lib/ruby_lsp/response_builders/hover.rb +11 -14
- data/lib/ruby_lsp/response_builders/response_builder.rb +1 -1
- data/lib/ruby_lsp/response_builders/semantic_highlighting.rb +60 -88
- data/lib/ruby_lsp/response_builders/signature_help.rb +5 -6
- data/lib/ruby_lsp/response_builders/test_collection.rb +6 -10
- data/lib/ruby_lsp/ruby_document.rb +24 -62
- data/lib/ruby_lsp/scope.rb +7 -11
- data/lib/ruby_lsp/scripts/compose_bundle.rb +6 -4
- data/lib/ruby_lsp/server.rb +147 -79
- data/lib/ruby_lsp/setup_bundler.rb +65 -60
- data/lib/ruby_lsp/static_docs.rb +11 -7
- data/lib/ruby_lsp/store.rb +24 -42
- data/lib/ruby_lsp/test_helper.rb +2 -12
- data/lib/ruby_lsp/test_reporters/lsp_reporter.rb +164 -0
- data/lib/ruby_lsp/test_reporters/minitest_reporter.rb +105 -0
- data/lib/ruby_lsp/test_reporters/test_unit_reporter.rb +94 -0
- data/lib/ruby_lsp/type_inferrer.rb +13 -14
- data/lib/ruby_lsp/utils.rb +49 -83
- metadata +9 -3
@@ -3,20 +3,8 @@
|
|
3
3
|
|
4
4
|
module RubyIndexer
|
5
5
|
class Location
|
6
|
-
extend T::Sig
|
7
|
-
|
8
6
|
class << self
|
9
|
-
|
10
|
-
|
11
|
-
sig do
|
12
|
-
params(
|
13
|
-
prism_location: Prism::Location,
|
14
|
-
code_units_cache: T.any(
|
15
|
-
T.proc.params(arg0: Integer).returns(Integer),
|
16
|
-
Prism::CodeUnitsCache,
|
17
|
-
),
|
18
|
-
).returns(T.attached_class)
|
19
|
-
end
|
7
|
+
#: (Prism::Location prism_location, (^(Integer arg0) -> Integer | Prism::CodeUnitsCache) code_units_cache) -> instance
|
20
8
|
def from_prism_location(prism_location, code_units_cache)
|
21
9
|
new(
|
22
10
|
prism_location.start_line,
|
@@ -27,17 +15,10 @@ module RubyIndexer
|
|
27
15
|
end
|
28
16
|
end
|
29
17
|
|
30
|
-
|
18
|
+
#: Integer
|
31
19
|
attr_reader :start_line, :end_line, :start_column, :end_column
|
32
20
|
|
33
|
-
|
34
|
-
params(
|
35
|
-
start_line: Integer,
|
36
|
-
end_line: Integer,
|
37
|
-
start_column: Integer,
|
38
|
-
end_column: Integer,
|
39
|
-
).void
|
40
|
-
end
|
21
|
+
#: (Integer start_line, Integer end_line, Integer start_column, Integer end_column) -> void
|
41
22
|
def initialize(start_line, end_line, start_column, end_column)
|
42
23
|
@start_line = start_line
|
43
24
|
@end_line = end_line
|
@@ -45,11 +26,7 @@ module RubyIndexer
|
|
45
26
|
@end_column = end_column
|
46
27
|
end
|
47
28
|
|
48
|
-
|
49
|
-
params(
|
50
|
-
other: T.any(Location, Prism::Location),
|
51
|
-
).returns(T::Boolean)
|
52
|
-
end
|
29
|
+
#: ((Location | Prism::Location) other) -> bool
|
53
30
|
def ==(other)
|
54
31
|
start_line == other.start_line &&
|
55
32
|
end_line == other.end_line &&
|
@@ -33,21 +33,20 @@ module RubyIndexer
|
|
33
33
|
#
|
34
34
|
# See https://en.wikipedia.org/wiki/Trie for more information
|
35
35
|
class PrefixTree
|
36
|
-
extend T::Sig
|
37
36
|
extend T::Generic
|
38
37
|
|
39
38
|
Value = type_member
|
40
39
|
|
41
|
-
|
40
|
+
#: -> void
|
42
41
|
def initialize
|
43
|
-
@root =
|
42
|
+
@root = Node.new("", "") #: Node[Value]
|
44
43
|
end
|
45
44
|
|
46
45
|
# Search the PrefixTree based on a given `prefix`. If `foo` is an entry in the tree, then searching for `fo` will
|
47
46
|
# return it as a result. The result is always an array of the type of value attribute to the generic `Value` type.
|
48
47
|
# Notice that if the `Value` is an array, this method will return an array of arrays, where each entry is the array
|
49
48
|
# of values for a given match
|
50
|
-
|
49
|
+
#: (String prefix) -> Array[Value]
|
51
50
|
def search(prefix)
|
52
51
|
node = find_node(prefix)
|
53
52
|
return [] unless node
|
@@ -56,7 +55,7 @@ module RubyIndexer
|
|
56
55
|
end
|
57
56
|
|
58
57
|
# Inserts a `value` using the given `key`
|
59
|
-
|
58
|
+
#: (String key, Value value) -> void
|
60
59
|
def insert(key, value)
|
61
60
|
node = @root
|
62
61
|
|
@@ -73,13 +72,13 @@ module RubyIndexer
|
|
73
72
|
|
74
73
|
# Deletes the entry identified by `key` from the tree. Notice that a partial match will still delete all entries
|
75
74
|
# that match it. For example, if the tree contains `foo` and we ask to delete `fo`, then `foo` will be deleted
|
76
|
-
|
75
|
+
#: (String key) -> void
|
77
76
|
def delete(key)
|
78
77
|
node = find_node(key)
|
79
78
|
return unless node
|
80
79
|
|
81
80
|
# Remove the node from the tree and then go up the parents to remove any of them with empty children
|
82
|
-
parent =
|
81
|
+
parent = node.parent #: Node[Value]?
|
83
82
|
|
84
83
|
while parent
|
85
84
|
parent.children.delete(node.key)
|
@@ -93,7 +92,7 @@ module RubyIndexer
|
|
93
92
|
private
|
94
93
|
|
95
94
|
# Find a node that matches the given `key`
|
96
|
-
|
95
|
+
#: (String key) -> Node[Value]?
|
97
96
|
def find_node(key)
|
98
97
|
node = @root
|
99
98
|
|
@@ -108,27 +107,26 @@ module RubyIndexer
|
|
108
107
|
end
|
109
108
|
|
110
109
|
class Node
|
111
|
-
extend T::Sig
|
112
110
|
extend T::Generic
|
113
111
|
|
114
112
|
Value = type_member
|
115
113
|
|
116
|
-
|
114
|
+
#: Hash[String, Node[Value]]
|
117
115
|
attr_reader :children
|
118
116
|
|
119
|
-
|
117
|
+
#: String
|
120
118
|
attr_reader :key
|
121
119
|
|
122
|
-
|
120
|
+
#: Value
|
123
121
|
attr_accessor :value
|
124
122
|
|
125
|
-
|
123
|
+
#: bool
|
126
124
|
attr_accessor :leaf
|
127
125
|
|
128
|
-
|
126
|
+
#: Node[Value]?
|
129
127
|
attr_reader :parent
|
130
128
|
|
131
|
-
|
129
|
+
#: (String key, Value value, ?Node[Value]? parent) -> void
|
132
130
|
def initialize(key, value, parent = nil)
|
133
131
|
@key = key
|
134
132
|
@value = value
|
@@ -137,13 +135,14 @@ module RubyIndexer
|
|
137
135
|
@leaf = false
|
138
136
|
end
|
139
137
|
|
140
|
-
|
138
|
+
#: -> Array[Value]
|
141
139
|
def collect
|
142
140
|
result = []
|
143
|
-
|
141
|
+
stack = [self]
|
144
142
|
|
145
|
-
|
146
|
-
result.
|
143
|
+
while (node = stack.pop)
|
144
|
+
result << node.value if node.leaf
|
145
|
+
stack.concat(node.children.values)
|
147
146
|
end
|
148
147
|
|
149
148
|
result
|
@@ -3,16 +3,14 @@
|
|
3
3
|
|
4
4
|
module RubyIndexer
|
5
5
|
class RBSIndexer
|
6
|
-
|
6
|
+
HAS_UNTYPED_FUNCTION = !!defined?(RBS::Types::UntypedFunction) #: bool
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
sig { params(index: Index).void }
|
8
|
+
#: (Index index) -> void
|
11
9
|
def initialize(index)
|
12
10
|
@index = index
|
13
11
|
end
|
14
12
|
|
15
|
-
|
13
|
+
#: -> void
|
16
14
|
def index_ruby_core
|
17
15
|
loader = RBS::EnvironmentLoader.new
|
18
16
|
RBS::Environment.from_loader(loader).resolve_type_names
|
@@ -22,12 +20,7 @@ module RubyIndexer
|
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
25
|
-
|
26
|
-
params(
|
27
|
-
pathname: Pathname,
|
28
|
-
declarations: T::Array[RBS::AST::Declarations::Base],
|
29
|
-
).void
|
30
|
-
end
|
23
|
+
#: (Pathname pathname, Array[RBS::AST::Declarations::Base] declarations) -> void
|
31
24
|
def process_signature(pathname, declarations)
|
32
25
|
declarations.each do |declaration|
|
33
26
|
process_declaration(declaration, pathname)
|
@@ -36,7 +29,7 @@ module RubyIndexer
|
|
36
29
|
|
37
30
|
private
|
38
31
|
|
39
|
-
|
32
|
+
#: (RBS::AST::Declarations::Base declaration, Pathname pathname) -> void
|
40
33
|
def process_declaration(declaration, pathname)
|
41
34
|
case declaration
|
42
35
|
when RBS::AST::Declarations::Class, RBS::AST::Declarations::Module
|
@@ -51,9 +44,7 @@ module RubyIndexer
|
|
51
44
|
end
|
52
45
|
end
|
53
46
|
|
54
|
-
|
55
|
-
params(declaration: T.any(RBS::AST::Declarations::Class, RBS::AST::Declarations::Module), pathname: Pathname).void
|
56
|
-
end
|
47
|
+
#: ((RBS::AST::Declarations::Class | RBS::AST::Declarations::Module) declaration, Pathname pathname) -> void
|
57
48
|
def handle_class_or_module_declaration(declaration, pathname)
|
58
49
|
nesting = [declaration.name.name.to_s]
|
59
50
|
uri = URI::Generic.from_path(path: pathname.to_s)
|
@@ -83,7 +74,7 @@ module RubyIndexer
|
|
83
74
|
end
|
84
75
|
end
|
85
76
|
|
86
|
-
|
77
|
+
#: (RBS::Location rbs_location) -> RubyIndexer::Location
|
87
78
|
def to_ruby_indexer_location(rbs_location)
|
88
79
|
RubyIndexer::Location.new(
|
89
80
|
rbs_location.start_line,
|
@@ -93,12 +84,7 @@ module RubyIndexer
|
|
93
84
|
)
|
94
85
|
end
|
95
86
|
|
96
|
-
|
97
|
-
params(
|
98
|
-
declaration: T.any(RBS::AST::Declarations::Class, RBS::AST::Declarations::Module),
|
99
|
-
entry: Entry::Namespace,
|
100
|
-
).void
|
101
|
-
end
|
87
|
+
#: ((RBS::AST::Declarations::Class | RBS::AST::Declarations::Module) declaration, Entry::Namespace entry) -> void
|
102
88
|
def add_declaration_mixins_to_entry(declaration, entry)
|
103
89
|
declaration.each_mixin do |mixin|
|
104
90
|
name = mixin.name.name.to_s
|
@@ -114,7 +100,7 @@ module RubyIndexer
|
|
114
100
|
end
|
115
101
|
end
|
116
102
|
|
117
|
-
|
103
|
+
#: (RBS::AST::Members::MethodDefinition member, Entry::Namespace owner) -> void
|
118
104
|
def handle_method(member, owner)
|
119
105
|
name = member.name.name
|
120
106
|
uri = URI::Generic.from_path(path: member.location.buffer.name)
|
@@ -144,7 +130,7 @@ module RubyIndexer
|
|
144
130
|
))
|
145
131
|
end
|
146
132
|
|
147
|
-
|
133
|
+
#: (RBS::AST::Members::MethodDefinition member) -> Array[Entry::Signature]
|
148
134
|
def signatures(member)
|
149
135
|
member.overloads.map do |overload|
|
150
136
|
parameters = process_overload(overload)
|
@@ -152,7 +138,7 @@ module RubyIndexer
|
|
152
138
|
end
|
153
139
|
end
|
154
140
|
|
155
|
-
|
141
|
+
#: (RBS::AST::Members::MethodDefinition::Overload overload) -> Array[Entry::Parameter]
|
156
142
|
def process_overload(overload)
|
157
143
|
function = overload.method_type.type
|
158
144
|
|
@@ -173,7 +159,7 @@ module RubyIndexer
|
|
173
159
|
end
|
174
160
|
end
|
175
161
|
|
176
|
-
|
162
|
+
#: (RBS::Types::Function function) -> Array[Entry::Parameter]
|
177
163
|
def parse_arguments(function)
|
178
164
|
parameters = []
|
179
165
|
parameters.concat(process_required_and_optional_positionals(function))
|
@@ -185,7 +171,7 @@ module RubyIndexer
|
|
185
171
|
parameters
|
186
172
|
end
|
187
173
|
|
188
|
-
|
174
|
+
#: (RBS::Types::Function function) -> Array[Entry::RequiredParameter]
|
189
175
|
def process_required_and_optional_positionals(function)
|
190
176
|
argument_offset = 0
|
191
177
|
|
@@ -209,14 +195,14 @@ module RubyIndexer
|
|
209
195
|
required + optional
|
210
196
|
end
|
211
197
|
|
212
|
-
|
198
|
+
#: (RBS::Types::Function function) -> Array[Entry::OptionalParameter]
|
213
199
|
def process_trailing_positionals(function)
|
214
200
|
function.trailing_positionals.map do |param|
|
215
201
|
Entry::OptionalParameter.new(name: param.name)
|
216
202
|
end
|
217
203
|
end
|
218
204
|
|
219
|
-
|
205
|
+
#: (RBS::Types::Function function) -> Entry::RestParameter
|
220
206
|
def process_rest_positionals(function)
|
221
207
|
rest = function.rest_positionals
|
222
208
|
|
@@ -225,21 +211,21 @@ module RubyIndexer
|
|
225
211
|
Entry::RestParameter.new(name: rest_name)
|
226
212
|
end
|
227
213
|
|
228
|
-
|
214
|
+
#: (RBS::Types::Function function) -> Array[Entry::KeywordParameter]
|
229
215
|
def process_required_keywords(function)
|
230
216
|
function.required_keywords.map do |name, _param|
|
231
217
|
Entry::KeywordParameter.new(name: name)
|
232
218
|
end
|
233
219
|
end
|
234
220
|
|
235
|
-
|
221
|
+
#: (RBS::Types::Function function) -> Array[Entry::OptionalKeywordParameter]
|
236
222
|
def process_optional_keywords(function)
|
237
223
|
function.optional_keywords.map do |name, _param|
|
238
224
|
Entry::OptionalKeywordParameter.new(name: name)
|
239
225
|
end
|
240
226
|
end
|
241
227
|
|
242
|
-
|
228
|
+
#: (RBS::Types::Function function) -> Entry::KeywordRestParameter
|
243
229
|
def process_rest_keywords(function)
|
244
230
|
param = function.rest_keywords
|
245
231
|
|
@@ -262,7 +248,7 @@ module RubyIndexer
|
|
262
248
|
# Complex::I = ... # Complex::I is a top-level constant
|
263
249
|
#
|
264
250
|
# And we need to handle their nesting differently.
|
265
|
-
|
251
|
+
#: (RBS::AST::Declarations::Constant declaration, Array[String] nesting, URI::Generic uri) -> void
|
266
252
|
def handle_constant(declaration, nesting, uri)
|
267
253
|
fully_qualified_name = [*nesting, declaration.name.name.to_s].join("::")
|
268
254
|
@index.add(Entry::Constant.new(
|
@@ -273,7 +259,7 @@ module RubyIndexer
|
|
273
259
|
))
|
274
260
|
end
|
275
261
|
|
276
|
-
|
262
|
+
#: (RBS::AST::Declarations::Global declaration, Pathname pathname) -> void
|
277
263
|
def handle_global_variable(declaration, pathname)
|
278
264
|
name = declaration.name.to_s
|
279
265
|
uri = URI::Generic.from_path(path: pathname.to_s)
|
@@ -288,7 +274,7 @@ module RubyIndexer
|
|
288
274
|
))
|
289
275
|
end
|
290
276
|
|
291
|
-
|
277
|
+
#: (RBS::AST::Members::Alias member, Entry::Namespace owner_entry) -> void
|
292
278
|
def handle_signature_alias(member, owner_entry)
|
293
279
|
uri = URI::Generic.from_path(path: member.location.buffer.name)
|
294
280
|
comments = comments_to_string(member)
|
@@ -305,16 +291,7 @@ module RubyIndexer
|
|
305
291
|
@index.add(entry)
|
306
292
|
end
|
307
293
|
|
308
|
-
|
309
|
-
params(declaration: T.any(
|
310
|
-
RBS::AST::Declarations::Class,
|
311
|
-
RBS::AST::Declarations::Module,
|
312
|
-
RBS::AST::Declarations::Constant,
|
313
|
-
RBS::AST::Declarations::Global,
|
314
|
-
RBS::AST::Members::MethodDefinition,
|
315
|
-
RBS::AST::Members::Alias,
|
316
|
-
)).returns(T.nilable(String))
|
317
|
-
end
|
294
|
+
#: ((RBS::AST::Declarations::Class | RBS::AST::Declarations::Module | RBS::AST::Declarations::Constant | RBS::AST::Declarations::Global | RBS::AST::Members::MethodDefinition | RBS::AST::Members::Alias) declaration) -> String?
|
318
295
|
def comments_to_string(declaration)
|
319
296
|
declaration.comment&.string
|
320
297
|
end
|