ruby-lsp 0.23.11 → 0.23.17

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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/VERSION +1 -1
  4. data/exe/ruby-lsp-launcher +20 -11
  5. data/lib/rubocop/cop/ruby_lsp/use_language_server_aliases.rb +1 -1
  6. data/lib/rubocop/cop/ruby_lsp/use_register_with_handler_method.rb +3 -5
  7. data/lib/ruby_indexer/lib/ruby_indexer/configuration.rb +82 -116
  8. data/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb +134 -183
  9. data/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb +9 -10
  10. data/lib/ruby_indexer/lib/ruby_indexer/entry.rb +97 -217
  11. data/lib/ruby_indexer/lib/ruby_indexer/index.rb +139 -281
  12. data/lib/ruby_indexer/lib/ruby_indexer/location.rb +4 -27
  13. data/lib/ruby_indexer/lib/ruby_indexer/prefix_tree.rb +18 -19
  14. data/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb +23 -55
  15. data/lib/ruby_indexer/lib/ruby_indexer/reference_finder.rb +47 -61
  16. data/lib/ruby_indexer/lib/ruby_indexer/uri.rb +17 -19
  17. data/lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb +7 -11
  18. data/lib/ruby_indexer/test/class_variables_test.rb +14 -14
  19. data/lib/ruby_indexer/test/classes_and_modules_test.rb +65 -40
  20. data/lib/ruby_indexer/test/configuration_test.rb +48 -7
  21. data/lib/ruby_indexer/test/constant_test.rb +34 -34
  22. data/lib/ruby_indexer/test/enhancements_test.rb +1 -1
  23. data/lib/ruby_indexer/test/index_test.rb +146 -135
  24. data/lib/ruby_indexer/test/instance_variables_test.rb +37 -37
  25. data/lib/ruby_indexer/test/method_test.rb +149 -123
  26. data/lib/ruby_indexer/test/prefix_tree_test.rb +13 -13
  27. data/lib/ruby_indexer/test/rbs_indexer_test.rb +68 -73
  28. data/lib/ruby_indexer/test/test_case.rb +9 -3
  29. data/lib/ruby_indexer/test/uri_test.rb +15 -2
  30. data/lib/ruby_lsp/addon.rb +44 -71
  31. data/lib/ruby_lsp/base_server.rb +29 -32
  32. data/lib/ruby_lsp/client_capabilities.rb +10 -12
  33. data/lib/ruby_lsp/document.rb +40 -54
  34. data/lib/ruby_lsp/erb_document.rb +37 -41
  35. data/lib/ruby_lsp/global_state.rb +52 -57
  36. data/lib/ruby_lsp/internal.rb +2 -0
  37. data/lib/ruby_lsp/listeners/code_lens.rb +82 -89
  38. data/lib/ruby_lsp/listeners/completion.rb +67 -73
  39. data/lib/ruby_lsp/listeners/definition.rb +44 -58
  40. data/lib/ruby_lsp/listeners/document_highlight.rb +123 -150
  41. data/lib/ruby_lsp/listeners/document_link.rb +50 -70
  42. data/lib/ruby_lsp/listeners/document_symbol.rb +38 -52
  43. data/lib/ruby_lsp/listeners/folding_ranges.rb +40 -43
  44. data/lib/ruby_lsp/listeners/hover.rb +92 -110
  45. data/lib/ruby_lsp/listeners/inlay_hints.rb +4 -11
  46. data/lib/ruby_lsp/listeners/semantic_highlighting.rb +54 -56
  47. data/lib/ruby_lsp/listeners/signature_help.rb +12 -27
  48. data/lib/ruby_lsp/listeners/spec_style.rb +155 -0
  49. data/lib/ruby_lsp/listeners/test_discovery.rb +89 -0
  50. data/lib/ruby_lsp/listeners/test_style.rb +167 -90
  51. data/lib/ruby_lsp/node_context.rb +12 -39
  52. data/lib/ruby_lsp/rbs_document.rb +9 -7
  53. data/lib/ruby_lsp/requests/code_action_resolve.rb +63 -59
  54. data/lib/ruby_lsp/requests/code_actions.rb +14 -26
  55. data/lib/ruby_lsp/requests/code_lens.rb +20 -19
  56. data/lib/ruby_lsp/requests/completion.rb +7 -20
  57. data/lib/ruby_lsp/requests/completion_resolve.rb +6 -6
  58. data/lib/ruby_lsp/requests/definition.rb +7 -17
  59. data/lib/ruby_lsp/requests/diagnostics.rb +8 -11
  60. data/lib/ruby_lsp/requests/discover_tests.rb +18 -5
  61. data/lib/ruby_lsp/requests/document_highlight.rb +5 -15
  62. data/lib/ruby_lsp/requests/document_link.rb +6 -17
  63. data/lib/ruby_lsp/requests/document_symbol.rb +5 -8
  64. data/lib/ruby_lsp/requests/folding_ranges.rb +7 -15
  65. data/lib/ruby_lsp/requests/formatting.rb +6 -9
  66. data/lib/ruby_lsp/requests/go_to_relevant_file.rb +85 -0
  67. data/lib/ruby_lsp/requests/hover.rb +10 -20
  68. data/lib/ruby_lsp/requests/inlay_hints.rb +6 -17
  69. data/lib/ruby_lsp/requests/on_type_formatting.rb +32 -40
  70. data/lib/ruby_lsp/requests/prepare_rename.rb +4 -9
  71. data/lib/ruby_lsp/requests/prepare_type_hierarchy.rb +5 -15
  72. data/lib/ruby_lsp/requests/range_formatting.rb +5 -6
  73. data/lib/ruby_lsp/requests/references.rb +9 -53
  74. data/lib/ruby_lsp/requests/rename.rb +20 -46
  75. data/lib/ruby_lsp/requests/request.rb +8 -19
  76. data/lib/ruby_lsp/requests/selection_ranges.rb +6 -6
  77. data/lib/ruby_lsp/requests/semantic_highlighting.rb +16 -35
  78. data/lib/ruby_lsp/requests/show_syntax_tree.rb +7 -8
  79. data/lib/ruby_lsp/requests/signature_help.rb +8 -26
  80. data/lib/ruby_lsp/requests/support/annotation.rb +4 -10
  81. data/lib/ruby_lsp/requests/support/common.rb +15 -55
  82. data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +27 -35
  83. data/lib/ruby_lsp/requests/support/rubocop_formatter.rb +11 -14
  84. data/lib/ruby_lsp/requests/support/rubocop_runner.rb +22 -34
  85. data/lib/ruby_lsp/requests/support/selection_range.rb +1 -3
  86. data/lib/ruby_lsp/requests/support/sorbet.rb +29 -38
  87. data/lib/ruby_lsp/requests/support/source_uri.rb +20 -32
  88. data/lib/ruby_lsp/requests/support/syntax_tree_formatter.rb +12 -19
  89. data/lib/ruby_lsp/requests/support/test_item.rb +16 -14
  90. data/lib/ruby_lsp/requests/type_hierarchy_supertypes.rb +5 -6
  91. data/lib/ruby_lsp/requests/workspace_symbol.rb +4 -4
  92. data/lib/ruby_lsp/response_builders/collection_response_builder.rb +5 -5
  93. data/lib/ruby_lsp/response_builders/document_symbol.rb +14 -19
  94. data/lib/ruby_lsp/response_builders/hover.rb +11 -14
  95. data/lib/ruby_lsp/response_builders/response_builder.rb +1 -1
  96. data/lib/ruby_lsp/response_builders/semantic_highlighting.rb +60 -88
  97. data/lib/ruby_lsp/response_builders/signature_help.rb +5 -6
  98. data/lib/ruby_lsp/response_builders/test_collection.rb +43 -10
  99. data/lib/ruby_lsp/ruby_document.rb +24 -92
  100. data/lib/ruby_lsp/scope.rb +7 -11
  101. data/lib/ruby_lsp/scripts/compose_bundle.rb +6 -4
  102. data/lib/ruby_lsp/server.rb +182 -99
  103. data/lib/ruby_lsp/setup_bundler.rb +65 -60
  104. data/lib/ruby_lsp/static_docs.rb +11 -7
  105. data/lib/ruby_lsp/store.rb +29 -47
  106. data/lib/ruby_lsp/test_helper.rb +2 -12
  107. data/lib/ruby_lsp/test_reporters/lsp_reporter.rb +191 -0
  108. data/lib/ruby_lsp/test_reporters/minitest_reporter.rb +105 -0
  109. data/lib/ruby_lsp/test_reporters/test_unit_reporter.rb +94 -0
  110. data/lib/ruby_lsp/type_inferrer.rb +13 -14
  111. data/lib/ruby_lsp/utils.rb +92 -83
  112. 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
- extend T::Sig
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
- sig { returns(Integer) }
18
+ #: Integer
31
19
  attr_reader :start_line, :end_line, :start_column, :end_column
32
20
 
33
- sig do
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
- sig do
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
- sig { void }
40
+ #: -> void
42
41
  def initialize
43
- @root = T.let(Node.new("", ""), Node[Value])
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
- sig { params(prefix: String).returns(T::Array[Value]) }
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
- sig { params(key: String, value: Value).void }
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
- sig { params(key: String).void }
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 = T.let(T.must(node.parent), T.nilable(Node[Value]))
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
- sig { params(key: String).returns(T.nilable(Node[Value])) }
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
- sig { returns(T::Hash[String, Node[Value]]) }
114
+ #: Hash[String, Node[Value]]
117
115
  attr_reader :children
118
116
 
119
- sig { returns(String) }
117
+ #: String
120
118
  attr_reader :key
121
119
 
122
- sig { returns(Value) }
120
+ #: Value
123
121
  attr_accessor :value
124
122
 
125
- sig { returns(T::Boolean) }
123
+ #: bool
126
124
  attr_accessor :leaf
127
125
 
128
- sig { returns(T.nilable(Node[Value])) }
126
+ #: Node[Value]?
129
127
  attr_reader :parent
130
128
 
131
- sig { params(key: String, value: Value, parent: T.nilable(Node[Value])).void }
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
- sig { returns(T::Array[Value]) }
138
+ #: -> Array[Value]
141
139
  def collect
142
140
  result = []
143
- result << @value if @leaf
141
+ stack = [self]
144
142
 
145
- @children.each_value do |node|
146
- result.concat(node.collect)
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
- extend T::Sig
6
+ HAS_UNTYPED_FUNCTION = !!defined?(RBS::Types::UntypedFunction) #: bool
7
7
 
8
- HAS_UNTYPED_FUNCTION = T.let(!!defined?(RBS::Types::UntypedFunction), T::Boolean)
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
- sig { void }
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
- sig do
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
- sig { params(declaration: RBS::AST::Declarations::Base, pathname: Pathname).void }
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
- sig do
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
- sig { params(rbs_location: RBS::Location).returns(RubyIndexer::Location) }
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
- sig do
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,22 +100,13 @@ module RubyIndexer
114
100
  end
115
101
  end
116
102
 
117
- sig { params(member: RBS::AST::Members::MethodDefinition, owner: Entry::Namespace).void }
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)
121
107
  location = to_ruby_indexer_location(member.location)
122
108
  comments = comments_to_string(member)
123
109
 
124
- visibility = case member.visibility
125
- when :private
126
- Entry::Visibility::PRIVATE
127
- when :protected
128
- Entry::Visibility::PROTECTED
129
- else
130
- Entry::Visibility::PUBLIC
131
- end
132
-
133
110
  real_owner = member.singleton? ? @index.existing_or_new_singleton_class(owner.name) : owner
134
111
  signatures = signatures(member)
135
112
  @index.add(Entry::Method.new(
@@ -139,12 +116,12 @@ module RubyIndexer
139
116
  location,
140
117
  comments,
141
118
  signatures,
142
- visibility,
119
+ member.visibility || :public,
143
120
  real_owner,
144
121
  ))
145
122
  end
146
123
 
147
- sig { params(member: RBS::AST::Members::MethodDefinition).returns(T::Array[Entry::Signature]) }
124
+ #: (RBS::AST::Members::MethodDefinition member) -> Array[Entry::Signature]
148
125
  def signatures(member)
149
126
  member.overloads.map do |overload|
150
127
  parameters = process_overload(overload)
@@ -152,7 +129,7 @@ module RubyIndexer
152
129
  end
153
130
  end
154
131
 
155
- sig { params(overload: RBS::AST::Members::MethodDefinition::Overload).returns(T::Array[Entry::Parameter]) }
132
+ #: (RBS::AST::Members::MethodDefinition::Overload overload) -> Array[Entry::Parameter]
156
133
  def process_overload(overload)
157
134
  function = overload.method_type.type
158
135
 
@@ -173,7 +150,7 @@ module RubyIndexer
173
150
  end
174
151
  end
175
152
 
176
- sig { params(function: RBS::Types::Function).returns(T::Array[Entry::Parameter]) }
153
+ #: (RBS::Types::Function function) -> Array[Entry::Parameter]
177
154
  def parse_arguments(function)
178
155
  parameters = []
179
156
  parameters.concat(process_required_and_optional_positionals(function))
@@ -185,7 +162,7 @@ module RubyIndexer
185
162
  parameters
186
163
  end
187
164
 
188
- sig { params(function: RBS::Types::Function).returns(T::Array[Entry::RequiredParameter]) }
165
+ #: (RBS::Types::Function function) -> Array[Entry::RequiredParameter]
189
166
  def process_required_and_optional_positionals(function)
190
167
  argument_offset = 0
191
168
 
@@ -209,14 +186,14 @@ module RubyIndexer
209
186
  required + optional
210
187
  end
211
188
 
212
- sig { params(function: RBS::Types::Function).returns(T::Array[Entry::OptionalParameter]) }
189
+ #: (RBS::Types::Function function) -> Array[Entry::OptionalParameter]
213
190
  def process_trailing_positionals(function)
214
191
  function.trailing_positionals.map do |param|
215
192
  Entry::OptionalParameter.new(name: param.name)
216
193
  end
217
194
  end
218
195
 
219
- sig { params(function: RBS::Types::Function).returns(Entry::RestParameter) }
196
+ #: (RBS::Types::Function function) -> Entry::RestParameter
220
197
  def process_rest_positionals(function)
221
198
  rest = function.rest_positionals
222
199
 
@@ -225,21 +202,21 @@ module RubyIndexer
225
202
  Entry::RestParameter.new(name: rest_name)
226
203
  end
227
204
 
228
- sig { params(function: RBS::Types::Function).returns(T::Array[Entry::KeywordParameter]) }
205
+ #: (RBS::Types::Function function) -> Array[Entry::KeywordParameter]
229
206
  def process_required_keywords(function)
230
207
  function.required_keywords.map do |name, _param|
231
208
  Entry::KeywordParameter.new(name: name)
232
209
  end
233
210
  end
234
211
 
235
- sig { params(function: RBS::Types::Function).returns(T::Array[Entry::OptionalKeywordParameter]) }
212
+ #: (RBS::Types::Function function) -> Array[Entry::OptionalKeywordParameter]
236
213
  def process_optional_keywords(function)
237
214
  function.optional_keywords.map do |name, _param|
238
215
  Entry::OptionalKeywordParameter.new(name: name)
239
216
  end
240
217
  end
241
218
 
242
- sig { params(function: RBS::Types::Function).returns(Entry::KeywordRestParameter) }
219
+ #: (RBS::Types::Function function) -> Entry::KeywordRestParameter
243
220
  def process_rest_keywords(function)
244
221
  param = function.rest_keywords
245
222
 
@@ -262,7 +239,7 @@ module RubyIndexer
262
239
  # Complex::I = ... # Complex::I is a top-level constant
263
240
  #
264
241
  # And we need to handle their nesting differently.
265
- sig { params(declaration: RBS::AST::Declarations::Constant, nesting: T::Array[String], uri: URI::Generic).void }
242
+ #: (RBS::AST::Declarations::Constant declaration, Array[String] nesting, URI::Generic uri) -> void
266
243
  def handle_constant(declaration, nesting, uri)
267
244
  fully_qualified_name = [*nesting, declaration.name.name.to_s].join("::")
268
245
  @index.add(Entry::Constant.new(
@@ -273,7 +250,7 @@ module RubyIndexer
273
250
  ))
274
251
  end
275
252
 
276
- sig { params(declaration: RBS::AST::Declarations::Global, pathname: Pathname).void }
253
+ #: (RBS::AST::Declarations::Global declaration, Pathname pathname) -> void
277
254
  def handle_global_variable(declaration, pathname)
278
255
  name = declaration.name.to_s
279
256
  uri = URI::Generic.from_path(path: pathname.to_s)
@@ -288,7 +265,7 @@ module RubyIndexer
288
265
  ))
289
266
  end
290
267
 
291
- sig { params(member: RBS::AST::Members::Alias, owner_entry: Entry::Namespace).void }
268
+ #: (RBS::AST::Members::Alias member, Entry::Namespace owner_entry) -> void
292
269
  def handle_signature_alias(member, owner_entry)
293
270
  uri = URI::Generic.from_path(path: member.location.buffer.name)
294
271
  comments = comments_to_string(member)
@@ -305,16 +282,7 @@ module RubyIndexer
305
282
  @index.add(entry)
306
283
  end
307
284
 
308
- sig do
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
285
+ #: ((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
286
  def comments_to_string(declaration)
319
287
  declaration.comment&.string
320
288
  end