ruby-lsp 0.1.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +2 -1
  4. data/VERSION +1 -1
  5. data/exe/ruby-lsp +1 -3
  6. data/lib/ruby-lsp.rb +2 -2
  7. data/lib/ruby_lsp/document.rb +10 -3
  8. data/lib/ruby_lsp/handler.rb +30 -134
  9. data/lib/ruby_lsp/internal.rb +3 -1
  10. data/lib/ruby_lsp/requests/code_actions.rb +2 -0
  11. data/lib/ruby_lsp/requests/diagnostics.rb +14 -9
  12. data/lib/ruby_lsp/requests/document_highlight.rb +27 -42
  13. data/lib/ruby_lsp/requests/document_link.rb +59 -0
  14. data/lib/ruby_lsp/requests/document_symbol.rb +2 -0
  15. data/lib/ruby_lsp/requests/folding_ranges.rb +26 -21
  16. data/lib/ruby_lsp/requests/formatting.rb +21 -16
  17. data/lib/ruby_lsp/requests/selection_ranges.rb +2 -0
  18. data/lib/ruby_lsp/requests/semantic_highlighting.rb +85 -11
  19. data/lib/ruby_lsp/requests/support/highlight_target.rb +88 -0
  20. data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +9 -2
  21. data/lib/ruby_lsp/requests/support/rubocop_diagnostics_runner.rb +61 -0
  22. data/lib/ruby_lsp/requests/support/rubocop_formatting_runner.rb +50 -0
  23. data/lib/ruby_lsp/requests.rb +14 -1
  24. data/lib/ruby_lsp/server.rb +192 -0
  25. data/lib/ruby_lsp/store.rb +12 -5
  26. metadata +10 -87
  27. data/.github/dependabot.yml +0 -11
  28. data/.github/probots.yml +0 -2
  29. data/.github/pull_request_template.md +0 -15
  30. data/.github/workflows/ci.yml +0 -31
  31. data/.github/workflows/publish_docs.yml +0 -32
  32. data/.gitignore +0 -9
  33. data/.rubocop.yml +0 -39
  34. data/.vscode/extensions.json +0 -5
  35. data/.vscode/settings.json +0 -5
  36. data/.vscode/tasks.json +0 -25
  37. data/CODE_OF_CONDUCT.md +0 -78
  38. data/Gemfile +0 -17
  39. data/Gemfile.lock +0 -124
  40. data/Rakefile +0 -21
  41. data/bin/rubocop +0 -29
  42. data/bin/tapioca +0 -29
  43. data/bin/test +0 -9
  44. data/dev.yml +0 -20
  45. data/lib/ruby_lsp/cli.rb +0 -88
  46. data/lib/ruby_lsp/requests/rubocop_request.rb +0 -60
  47. data/rakelib/check_docs.rake +0 -57
  48. data/ruby-lsp.gemspec +0 -26
  49. data/service.yml +0 -2
  50. data/sorbet/config +0 -4
  51. data/sorbet/rbi/.rubocop.yml +0 -8
  52. data/sorbet/rbi/gems/ansi@1.5.0.rbi +0 -338
  53. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -522
  54. data/sorbet/rbi/gems/builder@3.2.4.rbi +0 -418
  55. data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -8
  56. data/sorbet/rbi/gems/debug@1.5.0.rbi +0 -1273
  57. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -867
  58. data/sorbet/rbi/gems/io-console@0.5.11.rbi +0 -8
  59. data/sorbet/rbi/gems/irb@1.4.1.rbi +0 -376
  60. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +0 -7325
  61. data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -8
  62. data/sorbet/rbi/gems/minitest-reporters@1.5.0.rbi +0 -612
  63. data/sorbet/rbi/gems/minitest@5.15.0.rbi +0 -994
  64. data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -163
  65. data/sorbet/rbi/gems/parser@3.1.2.0.rbi +0 -3968
  66. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -734
  67. data/sorbet/rbi/gems/pry@0.14.1.rbi +0 -8
  68. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -227
  69. data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -1853
  70. data/sorbet/rbi/gems/rbi@0.0.14.rbi +0 -2337
  71. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +0 -1854
  72. data/sorbet/rbi/gems/reline@0.3.1.rbi +0 -1274
  73. data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -3852
  74. data/sorbet/rbi/gems/rubocop-ast@1.18.0.rbi +0 -4180
  75. data/sorbet/rbi/gems/rubocop-minitest@0.20.0.rbi +0 -1369
  76. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +0 -246
  77. data/sorbet/rbi/gems/rubocop-shopify@2.6.0.rbi +0 -8
  78. data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +0 -652
  79. data/sorbet/rbi/gems/rubocop@1.30.0.rbi +0 -36729
  80. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -732
  81. data/sorbet/rbi/gems/spoom@1.1.11.rbi +0 -1600
  82. data/sorbet/rbi/gems/syntax_tree@2.7.1.rbi +0 -6777
  83. data/sorbet/rbi/gems/tapioca@0.8.1.rbi +0 -1972
  84. data/sorbet/rbi/gems/thor@1.2.1.rbi +0 -2921
  85. data/sorbet/rbi/gems/unicode-display_width@2.1.0.rbi +0 -27
  86. data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -2789
  87. data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -1779
  88. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +0 -289
  89. data/sorbet/rbi/gems/yard@0.9.27.rbi +0 -13048
  90. data/sorbet/rbi/shims/fiddle.rbi +0 -4
  91. data/sorbet/rbi/shims/hash.rbi +0 -6
  92. data/sorbet/rbi/shims/rdoc.rbi +0 -4
  93. data/sorbet/tapioca/config.yml +0 -13
  94. data/sorbet/tapioca/require.rb +0 -7
@@ -1,1972 +0,0 @@
1
- # typed: false
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `tapioca` gem.
5
- # Please instead update this file by running `bin/tapioca gem tapioca`.
6
-
7
- # We need to do the alias-method-chain dance since Bootsnap does the same,
8
- # and prepended modules and alias-method-chain don't play well together.
9
- #
10
- # So, why does Bootsnap do alias-method-chain and not prepend? Glad you asked!
11
- # That's because RubyGems does alias-method-chain for Kernel#require and such,
12
- # so, if Bootsnap were to do prepend, it might end up breaking RubyGems.
13
- class Module
14
- def append_features(constant); end
15
- def autoload(const_name, path); end
16
- def extend_object(obj); end
17
- def prepend_features(constant); end
18
- end
19
-
20
- module RBI; end
21
-
22
- class RBI::Tree < ::RBI::NodeWithComments
23
- sig do
24
- params(
25
- loc: T.nilable(::RBI::Loc),
26
- comments: T::Array[::RBI::Comment],
27
- block: T.nilable(T.proc.params(node: ::RBI::Tree).void)
28
- ).void
29
- end
30
- def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
31
-
32
- sig { params(node: ::RBI::Node).void }
33
- def <<(node); end
34
-
35
- sig { override.params(v: ::RBI::Printer).void }
36
- def accept_printer(v); end
37
-
38
- sig { params(with_todo_comment: T::Boolean).void }
39
- def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end
40
-
41
- sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void }
42
- def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end
43
-
44
- sig do
45
- params(
46
- name: ::String,
47
- superclass_name: T.nilable(::String),
48
- block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)
49
- ).returns(::RBI::Scope)
50
- end
51
- def create_class(name, superclass_name: T.unsafe(nil), &block); end
52
-
53
- sig { params(name: ::String, value: ::String).void }
54
- def create_constant(name, value:); end
55
-
56
- sig { params(name: ::String).void }
57
- def create_extend(name); end
58
-
59
- sig { params(name: ::String).void }
60
- def create_include(name); end
61
-
62
- sig do
63
- params(
64
- name: ::String,
65
- parameters: T::Array[::RBI::TypedParam],
66
- return_type: ::String,
67
- class_method: T::Boolean,
68
- visibility: ::RBI::Visibility
69
- ).void
70
- end
71
- def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil)); end
72
-
73
- sig { params(name: ::String).void }
74
- def create_mixes_in_class_methods(name); end
75
-
76
- sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) }
77
- def create_module(name, &block); end
78
-
79
- sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).void }
80
- def create_path(constant, &block); end
81
-
82
- sig do
83
- params(
84
- name: ::String,
85
- type: ::String,
86
- variance: ::Symbol,
87
- fixed: T.nilable(::String),
88
- upper: T.nilable(::String),
89
- lower: T.nilable(::String)
90
- ).void
91
- end
92
- def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end
93
-
94
- sig { params(annotation: ::String).void }
95
- def deannotate!(annotation); end
96
-
97
- sig { returns(T::Boolean) }
98
- def empty?; end
99
-
100
- sig { void }
101
- def group_nodes!; end
102
-
103
- sig { returns(::RBI::Index) }
104
- def index; end
105
-
106
- sig do
107
- params(
108
- other: ::RBI::Tree,
109
- left_name: ::String,
110
- right_name: ::String,
111
- keep: ::RBI::Rewriters::Merge::Keep
112
- ).returns(::RBI::MergeTree)
113
- end
114
- def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
115
-
116
- sig { void }
117
- def nest_non_public_methods!; end
118
-
119
- sig { void }
120
- def nest_singleton_methods!; end
121
-
122
- sig { returns(T::Array[::RBI::Node]) }
123
- def nodes; end
124
-
125
- sig { override.returns(T::Boolean) }
126
- def oneline?; end
127
-
128
- sig { void }
129
- def sort_nodes!; end
130
-
131
- private
132
-
133
- sig { params(node: ::RBI::Node).returns(::RBI::Node) }
134
- def create_node(node); end
135
-
136
- sig { returns(T::Hash[::String, ::RBI::Node]) }
137
- def nodes_cache; end
138
-
139
- sig { params(name: ::String).returns(T::Boolean) }
140
- def valid_method_name?(name); end
141
- end
142
-
143
- RBI::Tree::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
144
-
145
- class RBI::TypedParam < ::T::Struct
146
- const :param, ::RBI::Param
147
- const :type, ::String
148
-
149
- class << self
150
- def inherited(s); end
151
- end
152
- end
153
-
154
- RBI::VERSION = T.let(T.unsafe(nil), String)
155
-
156
- module T::Generic
157
- def [](*types); end
158
- def type_member(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
159
- def type_template(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
160
- end
161
-
162
- # This module intercepts calls to generic type instantiations and type variable definitions.
163
- # Tapioca stores the data from those calls in a `GenericTypeRegistry` which can then be used
164
- # to look up the original call details when we are trying to do code generation.
165
- #
166
- # We are interested in the data of the `[]`, `type_member` and `type_template` calls which
167
- # are all needed to generate good generic information at runtime.
168
- module T::Generic::TypeStoragePatch
169
- def [](*types); end
170
- def type_member(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
171
- def type_template(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
172
- end
173
-
174
- class T::Types::Simple < ::T::Types::Base
175
- def name; end
176
- end
177
-
178
- module T::Types::Simple::GenericPatch
179
- # This method intercepts calls to the `name` method for simple types, so that
180
- # it can ask the name to the type if the type is generic, since, by this point,
181
- # we've created a clone of that type with the `name` method returning the
182
- # appropriate name for that specific concrete type.
183
- def name; end
184
- end
185
-
186
- module T::Types::Simple::NamePatch
187
- def name; end
188
- end
189
-
190
- module T::Types::Simple::Private; end
191
-
192
- module T::Types::Simple::Private::Pool
193
- class << self
194
- def type_for_module(mod); end
195
- end
196
- end
197
-
198
- module T::Utils
199
- class << self
200
- def coerce(val); end
201
- end
202
- end
203
-
204
- module T::Utils::CoercePatch
205
- def coerce(val); end
206
- end
207
-
208
- module Tapioca
209
- class << self
210
- sig do
211
- type_parameters(:Result)
212
- .params(
213
- blk: T.proc.returns(T.type_parameter(:Result))
214
- ).returns(T.type_parameter(:Result))
215
- end
216
- def silence_warnings(&blk); end
217
- end
218
- end
219
-
220
- Tapioca::BINARY_FILE = T.let(T.unsafe(nil), String)
221
- Tapioca::CENTRAL_REPO_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String)
222
- Tapioca::CENTRAL_REPO_INDEX_PATH = T.let(T.unsafe(nil), String)
223
- Tapioca::CENTRAL_REPO_ROOT_URI = T.let(T.unsafe(nil), String)
224
-
225
- class Tapioca::Cli < ::Thor
226
- include ::Tapioca::CliHelper
227
- include ::Tapioca::ConfigHelper
228
- include ::Tapioca::SorbetHelper
229
- include ::Tapioca::ShimsHelper
230
-
231
- def __print_version; end
232
- def annotations; end
233
- def check_shims; end
234
- def dsl(*constants); end
235
- def gem(*gems); end
236
- def init; end
237
- def require; end
238
- def todo; end
239
-
240
- class << self
241
- def exit_on_failure?; end
242
- end
243
- end
244
-
245
- Tapioca::Cli::FILE_HEADER_OPTION_DESC = T.let(T.unsafe(nil), String)
246
-
247
- module Tapioca::CliHelper
248
- requires_ancestor { Thor::Shell }
249
-
250
- sig { params(options: T::Hash[::Symbol, T.untyped]).returns(::Tapioca::RBIFormatter) }
251
- def rbi_formatter(options); end
252
-
253
- sig { params(message: ::String, color: T.any(::Symbol, T::Array[::Symbol])).void }
254
- def say_error(message = T.unsafe(nil), *color); end
255
- end
256
-
257
- module Tapioca::Commands; end
258
-
259
- class Tapioca::Commands::Annotations < ::Tapioca::Commands::Command
260
- sig { params(central_repo_root_uri: ::String, central_repo_index_path: ::String).void }
261
- def initialize(central_repo_root_uri:, central_repo_index_path: T.unsafe(nil)); end
262
-
263
- sig { override.void }
264
- def execute; end
265
-
266
- private
267
-
268
- sig { params(name: ::String, content: ::String).returns(::String) }
269
- def add_header(name, content); end
270
-
271
- sig { params(gem_name: ::String).void }
272
- def fetch_annotation(gem_name); end
273
-
274
- sig { params(gem_names: T::Array[::String]).returns(T::Array[::String]) }
275
- def fetch_annotations(gem_names); end
276
-
277
- sig { params(path: ::String).returns(T.nilable(::String)) }
278
- def fetch_file(path); end
279
-
280
- sig { params(path: ::String).returns(T.nilable(::String)) }
281
- def fetch_http_file(path); end
282
-
283
- sig { returns(Tapioca::RepoIndex) }
284
- def fetch_index; end
285
-
286
- sig { params(path: ::String).returns(T.nilable(::String)) }
287
- def fetch_local_file(path); end
288
-
289
- sig { returns(T::Array[::String]) }
290
- def list_gemfile_gems; end
291
-
292
- sig { params(project_gems: T::Array[::String]).void }
293
- def remove_expired_annotations(project_gems); end
294
- end
295
-
296
- # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
297
- class Tapioca::Commands::Command
298
- include ::Thor::Base
299
- include ::Thor::Invocation
300
- include ::Thor::Shell
301
- include ::Tapioca::CliHelper
302
- extend ::Thor::Base::ClassMethods
303
- extend ::Thor::Invocation::ClassMethods
304
-
305
- abstract!
306
-
307
- sig { void }
308
- def initialize; end
309
-
310
- # @abstract
311
- sig { abstract.void }
312
- def execute; end
313
-
314
- sig { returns(::Thor::Actions) }
315
- def file_writer; end
316
-
317
- private
318
-
319
- sig do
320
- params(
321
- path: T.any(::Pathname, ::String),
322
- content: ::String,
323
- force: T::Boolean,
324
- skip: T::Boolean,
325
- verbose: T::Boolean
326
- ).void
327
- end
328
- def create_file(path, content, force: T.unsafe(nil), skip: T.unsafe(nil), verbose: T.unsafe(nil)); end
329
-
330
- sig { params(command: ::Symbol, args: ::String).returns(::String) }
331
- def default_command(command, *args); end
332
-
333
- sig { params(path: T.any(::Pathname, ::String), verbose: T::Boolean).void }
334
- def remove_file(path, verbose: T.unsafe(nil)); end
335
- end
336
-
337
- class Tapioca::Commands::Command::FileWriter < ::Thor
338
- include ::Thor::Actions
339
- extend ::Thor::Actions::ClassMethods
340
- end
341
-
342
- class Tapioca::Commands::Dsl < ::Tapioca::Commands::Command
343
- include ::Tapioca::SorbetHelper
344
- include ::Tapioca::RBIHelper
345
-
346
- sig do
347
- params(
348
- requested_constants: T::Array[::String],
349
- outpath: ::Pathname,
350
- only: T::Array[::String],
351
- exclude: T::Array[::String],
352
- file_header: T::Boolean,
353
- compiler_path: ::String,
354
- tapioca_path: ::String,
355
- should_verify: T::Boolean,
356
- quiet: T::Boolean,
357
- verbose: T::Boolean,
358
- number_of_workers: T.nilable(::Integer),
359
- auto_strictness: T::Boolean,
360
- gem_dir: ::String,
361
- rbi_formatter: ::Tapioca::RBIFormatter
362
- ).void
363
- end
364
- def initialize(requested_constants:, outpath:, only:, exclude:, file_header:, compiler_path:, tapioca_path:, should_verify: T.unsafe(nil), quiet: T.unsafe(nil), verbose: T.unsafe(nil), number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), gem_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil)); end
365
-
366
- sig { override.void }
367
- def execute; end
368
-
369
- private
370
-
371
- sig { void }
372
- def abort_if_pending_migrations!; end
373
-
374
- sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) }
375
- def build_error_for_files(cause, files); end
376
-
377
- sig do
378
- params(
379
- constant_name: ::String,
380
- rbi: ::RBI::File,
381
- outpath: ::Pathname,
382
- quiet: T::Boolean
383
- ).returns(T.nilable(::Pathname))
384
- end
385
- def compile_dsl_rbi(constant_name, rbi, outpath: T.unsafe(nil), quiet: T.unsafe(nil)); end
386
-
387
- sig { params(constant_names: T::Array[::String]).returns(T::Array[::Module]) }
388
- def constantize(constant_names); end
389
-
390
- sig { params(compiler_names: T::Array[::String]).returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) }
391
- def constantize_compilers(compiler_names); end
392
-
393
- sig { params(constant_name: ::String).returns(::Pathname) }
394
- def dsl_rbi_filename(constant_name); end
395
-
396
- sig { params(requested_constants: T::Array[::String], path: ::Pathname).returns(T::Set[::Pathname]) }
397
- def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end
398
-
399
- sig { params(constant: ::String).returns(::String) }
400
- def generate_command_for(constant); end
401
-
402
- sig { params(eager_load: T::Boolean).void }
403
- def load_application(eager_load:); end
404
-
405
- sig { void }
406
- def load_dsl_compilers; end
407
-
408
- sig { void }
409
- def load_dsl_extensions; end
410
-
411
- sig { returns(::Tapioca::Runtime::Loader) }
412
- def loader; end
413
-
414
- sig { params(dir: ::Pathname).void }
415
- def perform_dsl_verification(dir); end
416
-
417
- sig { params(files: T::Set[::Pathname]).void }
418
- def purge_stale_dsl_rbi_files(files); end
419
-
420
- sig { params(constant: ::String).returns(::String) }
421
- def rbi_filename_for(constant); end
422
-
423
- sig { params(path: ::Pathname).returns(T::Array[::Pathname]) }
424
- def rbi_files_in(path); end
425
-
426
- sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void }
427
- def report_diff_and_exit_if_out_of_date(diff, command); end
428
-
429
- sig { params(name: ::String).returns(T.nilable(T.class_of(Tapioca::Dsl::Compiler))) }
430
- def resolve(name); end
431
-
432
- sig { params(class_name: ::String).returns(::String) }
433
- def underscore(class_name); end
434
-
435
- sig { params(tmp_dir: ::Pathname).returns(T::Hash[::String, ::Symbol]) }
436
- def verify_dsl_rbi(tmp_dir:); end
437
- end
438
-
439
- class Tapioca::Commands::Gem < ::Tapioca::Commands::Command
440
- include ::Tapioca::SorbetHelper
441
- include ::Tapioca::RBIHelper
442
-
443
- sig do
444
- params(
445
- gem_names: T::Array[::String],
446
- exclude: T::Array[::String],
447
- prerequire: T.nilable(::String),
448
- postrequire: ::String,
449
- typed_overrides: T::Hash[::String, ::String],
450
- outpath: ::Pathname,
451
- file_header: T::Boolean,
452
- doc: T::Boolean,
453
- include_exported_rbis: T::Boolean,
454
- number_of_workers: T.nilable(::Integer),
455
- auto_strictness: T::Boolean,
456
- dsl_dir: ::String,
457
- rbi_formatter: ::Tapioca::RBIFormatter
458
- ).void
459
- end
460
- def initialize(gem_names:, exclude:, prerequire:, postrequire:, typed_overrides:, outpath:, file_header:, doc:, include_exported_rbis:, number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), dsl_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil)); end
461
-
462
- sig { override.void }
463
- def execute; end
464
-
465
- sig { params(should_verify: T::Boolean).void }
466
- def sync(should_verify: T.unsafe(nil)); end
467
-
468
- private
469
-
470
- sig { returns(T::Array[::String]) }
471
- def added_rbis; end
472
-
473
- sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) }
474
- def build_error_for_files(cause, files); end
475
-
476
- sig { returns(::Tapioca::Gemfile) }
477
- def bundle; end
478
-
479
- sig { params(gem: ::Tapioca::Gemfile::GemSpec).void }
480
- def compile_gem_rbi(gem); end
481
-
482
- sig { params(gem_name: ::String).returns(::Pathname) }
483
- def existing_rbi(gem_name); end
484
-
485
- sig { returns(T::Hash[::String, ::String]) }
486
- def existing_rbis; end
487
-
488
- sig { params(gem_name: ::String).returns(::Pathname) }
489
- def expected_rbi(gem_name); end
490
-
491
- sig { returns(T::Hash[::String, ::String]) }
492
- def expected_rbis; end
493
-
494
- sig { params(file: ::String, error: ::LoadError).void }
495
- def explain_failed_require(file, error); end
496
-
497
- sig { params(gem_name: ::String).returns(T::Boolean) }
498
- def gem_rbi_exists?(gem_name); end
499
-
500
- sig { params(gem_name: ::String, version: ::String).returns(::Pathname) }
501
- def gem_rbi_filename(gem_name, version); end
502
-
503
- sig { params(gem_names: T::Array[::String]).returns(T::Array[::Tapioca::Gemfile::GemSpec]) }
504
- def gems_to_generate(gem_names); end
505
-
506
- sig { returns(::Tapioca::Runtime::Loader) }
507
- def loader; end
508
-
509
- sig { params(gem: ::Tapioca::Gemfile::GemSpec, file: ::RBI::File).void }
510
- def merge_with_exported_rbi(gem, file); end
511
-
512
- sig { params(old_filename: ::Pathname, new_filename: ::Pathname).void }
513
- def move(old_filename, new_filename); end
514
-
515
- sig { void }
516
- def perform_additions; end
517
-
518
- sig { void }
519
- def perform_removals; end
520
-
521
- sig { void }
522
- def perform_sync_verification; end
523
-
524
- sig { returns(T::Array[::String]) }
525
- def removed_rbis; end
526
-
527
- sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void }
528
- def report_diff_and_exit_if_out_of_date(diff, command); end
529
-
530
- sig { void }
531
- def require_gem_file; end
532
- end
533
-
534
- class Tapioca::Commands::Init < ::Tapioca::Commands::Command
535
- sig { params(sorbet_config: ::String, tapioca_config: ::String, default_postrequire: ::String).void }
536
- def initialize(sorbet_config:, tapioca_config:, default_postrequire:); end
537
-
538
- sig { override.void }
539
- def execute; end
540
-
541
- private
542
-
543
- sig { void }
544
- def create_binstub; end
545
-
546
- sig { void }
547
- def create_post_require; end
548
-
549
- sig { void }
550
- def create_sorbet_config; end
551
-
552
- sig { void }
553
- def create_tapioca_config; end
554
-
555
- sig { returns(::Bundler::Installer) }
556
- def installer; end
557
-
558
- sig { returns(::Bundler::StubSpecification) }
559
- def spec; end
560
- end
561
-
562
- class Tapioca::Commands::Require < ::Tapioca::Commands::Command
563
- sig { params(requires_path: ::String, sorbet_config_path: ::String).void }
564
- def initialize(requires_path:, sorbet_config_path:); end
565
-
566
- sig { override.void }
567
- def execute; end
568
- end
569
-
570
- class Tapioca::Commands::Todo < ::Tapioca::Commands::Command
571
- include ::Tapioca::SorbetHelper
572
-
573
- sig { params(todo_file: ::String, file_header: T::Boolean).void }
574
- def initialize(todo_file:, file_header:); end
575
-
576
- sig { override.void }
577
- def execute; end
578
-
579
- private
580
-
581
- sig { params(constants: T::Array[::String], command: ::String).returns(::RBI::File) }
582
- def rbi(constants, command:); end
583
-
584
- sig { returns(T::Array[::String]) }
585
- def unresolved_constants; end
586
- end
587
-
588
- module Tapioca::ConfigHelper
589
- requires_ancestor { Thor }
590
-
591
- sig { params(args: T.untyped, local_options: T.untyped, config: T.untyped).void }
592
- def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end
593
-
594
- sig { returns(::String) }
595
- def command_name; end
596
-
597
- sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) }
598
- def defaults; end
599
-
600
- sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) }
601
- def options; end
602
-
603
- private
604
-
605
- sig { params(msg: ::String).returns(::Tapioca::ConfigHelper::ConfigError) }
606
- def build_error(msg); end
607
-
608
- sig do
609
- params(
610
- options: ::Thor::CoreExt::HashWithIndifferentAccess
611
- ).returns(::Thor::CoreExt::HashWithIndifferentAccess)
612
- end
613
- def config_options(options); end
614
-
615
- sig { params(options: T::Hash[::Symbol, ::Thor::Option]).void }
616
- def filter_defaults(options); end
617
-
618
- sig do
619
- params(
620
- options: T.nilable(::Thor::CoreExt::HashWithIndifferentAccess)
621
- ).returns(::Thor::CoreExt::HashWithIndifferentAccess)
622
- end
623
- def merge_options(*options); end
624
-
625
- sig { params(config_file: ::String, errors: T::Array[::Tapioca::ConfigHelper::ConfigError]).void }
626
- def print_errors(config_file, errors); end
627
-
628
- sig { params(config_file: ::String, config: T::Hash[T.untyped, T.untyped]).void }
629
- def validate_config!(config_file, config); end
630
-
631
- sig do
632
- params(
633
- command_options: T::Hash[::Symbol, ::Thor::Option],
634
- config_key: ::String,
635
- config_options: T::Hash[T.untyped, T.untyped]
636
- ).returns(T::Array[::Tapioca::ConfigHelper::ConfigError])
637
- end
638
- def validate_config_options(command_options, config_key, config_options); end
639
- end
640
-
641
- class Tapioca::ConfigHelper::ConfigError < ::T::Struct
642
- const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart]
643
-
644
- class << self
645
- def inherited(s); end
646
- end
647
- end
648
-
649
- class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct
650
- const :colors, T::Array[::Symbol]
651
- const :message, ::String
652
-
653
- class << self
654
- def inherited(s); end
655
- end
656
- end
657
-
658
- Tapioca::DEFAULT_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String)
659
- Tapioca::DEFAULT_DSL_DIR = T.let(T.unsafe(nil), String)
660
- Tapioca::DEFAULT_GEM_DIR = T.let(T.unsafe(nil), String)
661
- Tapioca::DEFAULT_OVERRIDES = T.let(T.unsafe(nil), Hash)
662
- Tapioca::DEFAULT_POSTREQUIRE_FILE = T.let(T.unsafe(nil), String)
663
- Tapioca::DEFAULT_RBI_DIR = T.let(T.unsafe(nil), String)
664
- Tapioca::DEFAULT_RBI_FORMATTER = T.let(T.unsafe(nil), Tapioca::RBIFormatter)
665
- Tapioca::DEFAULT_SHIM_DIR = T.let(T.unsafe(nil), String)
666
- Tapioca::DEFAULT_TODO_FILE = T.let(T.unsafe(nil), String)
667
- module Tapioca::Dsl; end
668
-
669
- # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
670
- class Tapioca::Dsl::Compiler
671
- extend T::Generic
672
- include ::Tapioca::Runtime::Reflection
673
- include ::Tapioca::SignaturesHelper
674
- include ::Tapioca::Dsl::Helpers::ParamHelper
675
- extend ::Tapioca::Runtime::Reflection
676
-
677
- abstract!
678
-
679
- ConstantType = type_member { { upper: Module } }
680
-
681
- sig { params(pipeline: ::Tapioca::Dsl::Pipeline, root: ::RBI::Tree, constant: ConstantType).void }
682
- def initialize(pipeline, root, constant); end
683
-
684
- # NOTE: This should eventually accept an `Error` object or `Exception` rather than simply a `String`.
685
- sig { params(error: ::String).void }
686
- def add_error(error); end
687
-
688
- sig { params(compiler_name: ::String).returns(T::Boolean) }
689
- def compiler_enabled?(compiler_name); end
690
-
691
- sig { returns(ConstantType) }
692
- def constant; end
693
-
694
- # @abstract
695
- sig { abstract.void }
696
- def decorate; end
697
-
698
- sig { returns(::RBI::Tree) }
699
- def root; end
700
-
701
- private
702
-
703
- sig { params(type: ::String).returns(::String) }
704
- def as_nilable_type(type); end
705
-
706
- sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(T::Array[::RBI::TypedParam]) }
707
- def compile_method_parameters_to_rbi(method_def); end
708
-
709
- sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(::String) }
710
- def compile_method_return_type_to_rbi(method_def); end
711
-
712
- sig { params(scope: ::RBI::Scope, method_def: T.any(::Method, ::UnboundMethod), class_method: T::Boolean).void }
713
- def create_method_from_def(scope, method_def, class_method: T.unsafe(nil)); end
714
-
715
- # Get the types of each parameter from a method signature
716
- sig { params(method_def: T.any(::Method, ::UnboundMethod), signature: T.untyped).returns(T::Array[::String]) }
717
- def parameters_types_from_signature(method_def, signature); end
718
-
719
- sig { params(name: ::String).returns(T::Boolean) }
720
- def valid_parameter_name?(name); end
721
-
722
- class << self
723
- # @abstract
724
- sig { abstract.returns(T::Enumerable[::Module]) }
725
- def gather_constants; end
726
-
727
- sig { params(constant: ::Module).returns(T::Boolean) }
728
- def handles?(constant); end
729
-
730
- sig { returns(T::Set[::Module]) }
731
- def processable_constants; end
732
-
733
- private
734
-
735
- sig { returns(T::Enumerable[::Class]) }
736
- def all_classes; end
737
-
738
- sig { returns(T::Enumerable[::Module]) }
739
- def all_modules; end
740
- end
741
- end
742
-
743
- module Tapioca::Dsl::Compilers; end
744
- Tapioca::Dsl::Compilers::DIRECTORY = T.let(T.unsafe(nil), String)
745
-
746
- # DSL compilers are either built-in to Tapioca and live under the
747
- # `Tapioca::Dsl::Compilers` namespace (i.e. this namespace), and
748
- # can be referred to by just using the class name, or they live in
749
- # a different namespace and can only be referred to using their fully
750
- # qualified name. This constant encapsulates that dual lookup when
751
- # a compiler needs to be resolved by name.
752
- Tapioca::Dsl::Compilers::NAMESPACES = T.let(T.unsafe(nil), Array)
753
-
754
- module Tapioca::Dsl::Helpers; end
755
-
756
- module Tapioca::Dsl::Helpers::ParamHelper
757
- include ::Tapioca::SignaturesHelper
758
-
759
- sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
760
- def create_block_param(name, type:); end
761
-
762
- sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) }
763
- def create_kw_opt_param(name, type:, default:); end
764
-
765
- sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
766
- def create_kw_param(name, type:); end
767
-
768
- sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
769
- def create_kw_rest_param(name, type:); end
770
-
771
- sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) }
772
- def create_opt_param(name, type:, default:); end
773
-
774
- sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
775
- def create_param(name, type:); end
776
-
777
- sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
778
- def create_rest_param(name, type:); end
779
-
780
- sig { params(param: ::RBI::Param, type: ::String).returns(::RBI::TypedParam) }
781
- def create_typed_param(param, type); end
782
- end
783
-
784
- class Tapioca::Dsl::Pipeline
785
- sig do
786
- params(
787
- requested_constants: T::Array[::Module],
788
- requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)],
789
- excluded_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)],
790
- error_handler: T.proc.params(error: ::String).void,
791
- number_of_workers: T.nilable(::Integer)
792
- ).void
793
- end
794
- def initialize(requested_constants:, requested_compilers: T.unsafe(nil), excluded_compilers: T.unsafe(nil), error_handler: T.unsafe(nil), number_of_workers: T.unsafe(nil)); end
795
-
796
- sig { params(error: ::String).void }
797
- def add_error(error); end
798
-
799
- sig { params(compiler_name: ::String).returns(T::Boolean) }
800
- def compiler_enabled?(compiler_name); end
801
-
802
- sig { returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)]) }
803
- def compilers; end
804
-
805
- sig { returns(T.proc.params(error: ::String).void) }
806
- def error_handler; end
807
-
808
- sig { returns(T::Array[::String]) }
809
- def errors; end
810
-
811
- sig { returns(T::Array[::Module]) }
812
- def requested_constants; end
813
-
814
- sig do
815
- type_parameters(:T)
816
- .params(
817
- blk: T.proc.params(constant: ::Module, rbi: ::RBI::File).returns(T.type_parameter(:T))
818
- ).returns(T::Array[T.type_parameter(:T)])
819
- end
820
- def run(&blk); end
821
-
822
- private
823
-
824
- sig { params(constants: T::Set[::Module]).returns(T::Set[::Module]) }
825
- def filter_anonymous_and_reloaded_constants(constants); end
826
-
827
- sig do
828
- params(
829
- requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)],
830
- excluded_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)]
831
- ).returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)])
832
- end
833
- def gather_compilers(requested_compilers, excluded_compilers); end
834
-
835
- sig { params(requested_constants: T::Array[::Module]).returns(T::Set[::Module]) }
836
- def gather_constants(requested_constants); end
837
-
838
- sig { params(constant: ::Module).returns(T.nilable(::RBI::File)) }
839
- def rbi_for_constant(constant); end
840
-
841
- sig { params(error: ::String).returns(T.noreturn) }
842
- def report_error(error); end
843
- end
844
-
845
- class Tapioca::Error < ::StandardError; end
846
-
847
- class Tapioca::Executor
848
- sig { params(queue: T::Array[T.untyped], number_of_workers: T.nilable(::Integer)).void }
849
- def initialize(queue, number_of_workers: T.unsafe(nil)); end
850
-
851
- sig do
852
- type_parameters(:T)
853
- .params(
854
- block: T.proc.params(item: T.untyped).returns(T.type_parameter(:T))
855
- ).returns(T::Array[T.type_parameter(:T)])
856
- end
857
- def run_in_parallel(&block); end
858
- end
859
-
860
- Tapioca::Executor::MINIMUM_ITEMS_PER_WORKER = T.let(T.unsafe(nil), Integer)
861
- module Tapioca::Gem; end
862
-
863
- class Tapioca::Gem::ConstNodeAdded < ::Tapioca::Gem::NodeAdded
864
- sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void }
865
- def initialize(symbol, constant, node); end
866
-
867
- sig { returns(::RBI::Const) }
868
- def node; end
869
- end
870
-
871
- class Tapioca::Gem::ConstantFound < ::Tapioca::Gem::Event
872
- sig { params(symbol: ::String, constant: ::BasicObject).void }
873
- def initialize(symbol, constant); end
874
-
875
- sig { returns(::BasicObject) }
876
- def constant; end
877
-
878
- sig { returns(::String) }
879
- def symbol; end
880
- end
881
-
882
- # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
883
- class Tapioca::Gem::Event
884
- abstract!
885
-
886
- def initialize(*args, **_arg1, &blk); end
887
- end
888
-
889
- module Tapioca::Gem::Listeners; end
890
-
891
- # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
892
- class Tapioca::Gem::Listeners::Base
893
- abstract!
894
-
895
- sig { params(pipeline: ::Tapioca::Gem::Pipeline).void }
896
- def initialize(pipeline); end
897
-
898
- sig { params(event: ::Tapioca::Gem::NodeAdded).void }
899
- def dispatch(event); end
900
-
901
- private
902
-
903
- sig { params(event: ::Tapioca::Gem::ConstNodeAdded).void }
904
- def on_const(event); end
905
-
906
- sig { params(event: ::Tapioca::Gem::MethodNodeAdded).void }
907
- def on_method(event); end
908
-
909
- sig { params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
910
- def on_scope(event); end
911
- end
912
-
913
- class Tapioca::Gem::Listeners::DynamicMixins < ::Tapioca::Gem::Listeners::Base
914
- include ::Tapioca::Runtime::Reflection
915
-
916
- private
917
-
918
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
919
- def on_scope(event); end
920
- end
921
-
922
- class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base
923
- include ::Tapioca::Runtime::Reflection
924
-
925
- private
926
-
927
- sig { params(tree: ::RBI::Tree, module_name: ::String, mod: ::Module, for_visibility: T::Array[::Symbol]).void }
928
- def compile_directly_owned_methods(tree, module_name, mod, for_visibility = T.unsafe(nil)); end
929
-
930
- sig do
931
- params(
932
- tree: ::RBI::Tree,
933
- symbol_name: ::String,
934
- constant: ::Module,
935
- method: T.nilable(::UnboundMethod),
936
- visibility: ::RBI::Visibility
937
- ).void
938
- end
939
- def compile_method(tree, symbol_name, constant, method, visibility = T.unsafe(nil)); end
940
-
941
- sig { params(constant: ::Module).returns(T.nilable(::UnboundMethod)) }
942
- def initialize_method_for(constant); end
943
-
944
- sig { params(mod: ::Module).returns(T::Hash[::Symbol, T::Array[::Symbol]]) }
945
- def method_names_by_visibility(mod); end
946
-
947
- # Check whether the method is defined by the constant.
948
- #
949
- # In most cases, it works to check that the constant is the method owner. However,
950
- # in the case that a method is also defined in a module prepended to the constant, it
951
- # will be owned by the prepended module, not the constant.
952
- #
953
- # This method implements a better way of checking whether a constant defines a method.
954
- # It walks up the ancestor tree via the `super_method` method; if any of the super
955
- # methods are owned by the constant, it means that the constant declares the method.
956
- sig { params(method: ::UnboundMethod, constant: ::Module).returns(T::Boolean) }
957
- def method_owned_by_constant?(method, constant); end
958
-
959
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
960
- def on_scope(event); end
961
-
962
- sig { params(constant: ::Module, method_name: ::String).returns(T::Boolean) }
963
- def struct_method?(constant, method_name); end
964
-
965
- sig { params(name: ::String).returns(T::Boolean) }
966
- def valid_method_name?(name); end
967
-
968
- sig { params(name: ::String).returns(T::Boolean) }
969
- def valid_parameter_name?(name); end
970
- end
971
-
972
- Tapioca::Gem::Listeners::Methods::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
973
-
974
- class Tapioca::Gem::Listeners::Mixins < ::Tapioca::Gem::Listeners::Base
975
- include ::Tapioca::Runtime::Reflection
976
-
977
- private
978
-
979
- sig do
980
- params(
981
- tree: ::RBI::Tree,
982
- mods: T::Array[::Module],
983
- mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type
984
- ).void
985
- end
986
- def add_mixins(tree, mods, mixin_type); end
987
-
988
- sig { params(mixin_name: ::String).returns(T::Boolean) }
989
- def filtered_mixin?(mixin_name); end
990
-
991
- sig { params(constant: ::Module).returns(T::Array[::Module]) }
992
- def interesting_ancestors_of(constant); end
993
-
994
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
995
- def on_scope(event); end
996
- end
997
-
998
- class Tapioca::Gem::Listeners::RemoveEmptyPayloadScopes < ::Tapioca::Gem::Listeners::Base
999
- include ::Tapioca::Runtime::Reflection
1000
-
1001
- private
1002
-
1003
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1004
- def on_scope(event); end
1005
- end
1006
-
1007
- class Tapioca::Gem::Listeners::SorbetEnums < ::Tapioca::Gem::Listeners::Base
1008
- private
1009
-
1010
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1011
- def on_scope(event); end
1012
- end
1013
-
1014
- class Tapioca::Gem::Listeners::SorbetHelpers < ::Tapioca::Gem::Listeners::Base
1015
- include ::Tapioca::Runtime::Reflection
1016
-
1017
- private
1018
-
1019
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1020
- def on_scope(event); end
1021
- end
1022
-
1023
- class Tapioca::Gem::Listeners::SorbetProps < ::Tapioca::Gem::Listeners::Base
1024
- private
1025
-
1026
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1027
- def on_scope(event); end
1028
- end
1029
-
1030
- class Tapioca::Gem::Listeners::SorbetRequiredAncestors < ::Tapioca::Gem::Listeners::Base
1031
- private
1032
-
1033
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1034
- def on_scope(event); end
1035
- end
1036
-
1037
- class Tapioca::Gem::Listeners::SorbetSignatures < ::Tapioca::Gem::Listeners::Base
1038
- include ::Tapioca::Runtime::Reflection
1039
- include ::Tapioca::SignaturesHelper
1040
-
1041
- private
1042
-
1043
- sig { params(signature: T.untyped, parameters: T::Array[[::Symbol, ::String]]).returns(::RBI::Sig) }
1044
- def compile_signature(signature, parameters); end
1045
-
1046
- sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void }
1047
- def on_method(event); end
1048
-
1049
- sig { params(signature: T.untyped).returns(T::Boolean) }
1050
- def signature_final?(signature); end
1051
- end
1052
-
1053
- Tapioca::Gem::Listeners::SorbetSignatures::TYPE_PARAMETER_MATCHER = T.let(T.unsafe(nil), Regexp)
1054
-
1055
- class Tapioca::Gem::Listeners::SorbetTypeVariables < ::Tapioca::Gem::Listeners::Base
1056
- include ::Tapioca::Runtime::Reflection
1057
-
1058
- private
1059
-
1060
- sig { params(tree: ::RBI::Tree, constant: ::Module).void }
1061
- def compile_type_variable_declarations(tree, constant); end
1062
-
1063
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1064
- def on_scope(event); end
1065
- end
1066
-
1067
- class Tapioca::Gem::Listeners::Subconstants < ::Tapioca::Gem::Listeners::Base
1068
- include ::Tapioca::Runtime::Reflection
1069
-
1070
- private
1071
-
1072
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1073
- def on_scope(event); end
1074
- end
1075
-
1076
- class Tapioca::Gem::Listeners::YardDoc < ::Tapioca::Gem::Listeners::Base
1077
- sig { params(pipeline: ::Tapioca::Gem::Pipeline).void }
1078
- def initialize(pipeline); end
1079
-
1080
- private
1081
-
1082
- sig { params(name: ::String, sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) }
1083
- def documentation_comments(name, sigs: T.unsafe(nil)); end
1084
-
1085
- sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void }
1086
- def on_const(event); end
1087
-
1088
- sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void }
1089
- def on_method(event); end
1090
-
1091
- sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1092
- def on_scope(event); end
1093
- end
1094
-
1095
- Tapioca::Gem::Listeners::YardDoc::IGNORED_COMMENTS = T.let(T.unsafe(nil), Array)
1096
- Tapioca::Gem::Listeners::YardDoc::IGNORED_SIG_TAGS = T.let(T.unsafe(nil), Array)
1097
-
1098
- class Tapioca::Gem::MethodNodeAdded < ::Tapioca::Gem::NodeAdded
1099
- sig do
1100
- params(
1101
- symbol: ::String,
1102
- constant: ::Module,
1103
- node: ::RBI::Method,
1104
- signature: T.untyped,
1105
- parameters: T::Array[[::Symbol, ::String]]
1106
- ).void
1107
- end
1108
- def initialize(symbol, constant, node, signature, parameters); end
1109
-
1110
- sig { returns(::RBI::Method) }
1111
- def node; end
1112
-
1113
- sig { returns(T::Array[[::Symbol, ::String]]) }
1114
- def parameters; end
1115
-
1116
- sig { returns(T.untyped) }
1117
- def signature; end
1118
- end
1119
-
1120
- # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
1121
- class Tapioca::Gem::NodeAdded < ::Tapioca::Gem::Event
1122
- abstract!
1123
-
1124
- sig { params(symbol: ::String, constant: ::Module).void }
1125
- def initialize(symbol, constant); end
1126
-
1127
- sig { returns(::Module) }
1128
- def constant; end
1129
-
1130
- sig { returns(::String) }
1131
- def symbol; end
1132
- end
1133
-
1134
- class Tapioca::Gem::Pipeline
1135
- include ::Tapioca::Runtime::Reflection
1136
- include ::Tapioca::SignaturesHelper
1137
-
1138
- sig { params(gem: ::Tapioca::Gemfile::GemSpec, include_doc: T::Boolean).void }
1139
- def initialize(gem, include_doc: T.unsafe(nil)); end
1140
-
1141
- sig { returns(::RBI::Tree) }
1142
- def compile; end
1143
-
1144
- sig { returns(::Tapioca::Gemfile::GemSpec) }
1145
- def gem; end
1146
-
1147
- sig { params(method: ::UnboundMethod).returns(T::Boolean) }
1148
- def method_in_gem?(method); end
1149
-
1150
- sig { params(constant: ::Module).returns(T.nilable(::String)) }
1151
- def name_of(constant); end
1152
-
1153
- sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void }
1154
- def push_const(symbol, constant, node); end
1155
-
1156
- sig { params(symbol: ::String, constant: ::BasicObject).void }
1157
- def push_constant(symbol, constant); end
1158
-
1159
- sig do
1160
- params(
1161
- symbol: ::String,
1162
- constant: ::Module,
1163
- node: ::RBI::Method,
1164
- signature: T.untyped,
1165
- parameters: T::Array[[::Symbol, ::String]]
1166
- ).void
1167
- end
1168
- def push_method(symbol, constant, node, signature, parameters); end
1169
-
1170
- sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void }
1171
- def push_scope(symbol, constant, node); end
1172
-
1173
- sig { params(symbol: ::String).void }
1174
- def push_symbol(symbol); end
1175
-
1176
- sig { params(symbol_name: ::String).returns(T::Boolean) }
1177
- def symbol_in_payload?(symbol_name); end
1178
-
1179
- private
1180
-
1181
- sig { params(name: ::String).void }
1182
- def add_to_alias_namespace(name); end
1183
-
1184
- sig { params(name: ::String).returns(T::Boolean) }
1185
- def alias_namespaced?(name); end
1186
-
1187
- sig { params(name: ::String, constant: ::Module).void }
1188
- def compile_alias(name, constant); end
1189
-
1190
- # Compile
1191
- sig { params(symbol: ::String, constant: ::BasicObject).void }
1192
- def compile_constant(symbol, constant); end
1193
-
1194
- sig { params(name: ::String, constant: ::Module).void }
1195
- def compile_module(name, constant); end
1196
-
1197
- sig { params(name: ::String, value: ::BasicObject).void }
1198
- def compile_object(name, value); end
1199
-
1200
- sig { params(constant: ::Class).returns(T.nilable(::String)) }
1201
- def compile_superclass(constant); end
1202
-
1203
- sig { params(constant: ::Module, strict: T::Boolean).returns(T::Boolean) }
1204
- def defined_in_gem?(constant, strict: T.unsafe(nil)); end
1205
-
1206
- sig { params(event: ::Tapioca::Gem::Event).void }
1207
- def dispatch(event); end
1208
-
1209
- sig { params(constant: T.all(::Module, ::T::Generic)).returns(::String) }
1210
- def generic_name_of(constant); end
1211
-
1212
- sig { params(constant: ::Module).returns(T::Array[::String]) }
1213
- def get_file_candidates(constant); end
1214
-
1215
- sig { params(name: ::String).void }
1216
- def mark_seen(name); end
1217
-
1218
- sig { params(constant: ::Module, class_name: T.nilable(::String)).returns(T.nilable(::String)) }
1219
- def name_of_proxy_target(constant, class_name); end
1220
-
1221
- sig { returns(::Tapioca::Gem::Event) }
1222
- def next_event; end
1223
-
1224
- sig { params(event: ::Tapioca::Gem::ConstantFound).void }
1225
- def on_constant(event); end
1226
-
1227
- sig { params(event: ::Tapioca::Gem::NodeAdded).void }
1228
- def on_node(event); end
1229
-
1230
- sig { params(event: ::Tapioca::Gem::SymbolFound).void }
1231
- def on_symbol(event); end
1232
-
1233
- sig { params(name: ::String).returns(T::Boolean) }
1234
- def seen?(name); end
1235
- end
1236
-
1237
- Tapioca::Gem::Pipeline::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array)
1238
-
1239
- class Tapioca::Gem::ScopeNodeAdded < ::Tapioca::Gem::NodeAdded
1240
- sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void }
1241
- def initialize(symbol, constant, node); end
1242
-
1243
- sig { returns(::RBI::Scope) }
1244
- def node; end
1245
- end
1246
-
1247
- class Tapioca::Gem::SymbolFound < ::Tapioca::Gem::Event
1248
- sig { params(symbol: ::String).void }
1249
- def initialize(symbol); end
1250
-
1251
- sig { returns(::String) }
1252
- def symbol; end
1253
- end
1254
-
1255
- class Tapioca::Gemfile
1256
- sig { params(exclude: T::Array[::String]).void }
1257
- def initialize(exclude); end
1258
-
1259
- sig { returns(::Bundler::Definition) }
1260
- def definition; end
1261
-
1262
- sig { returns(T::Array[::Tapioca::Gemfile::GemSpec]) }
1263
- def dependencies; end
1264
-
1265
- sig { params(gem_name: ::String).returns(T.nilable(::Tapioca::Gemfile::GemSpec)) }
1266
- def gem(gem_name); end
1267
-
1268
- sig { returns(T::Array[::String]) }
1269
- def missing_specs; end
1270
-
1271
- sig { void }
1272
- def require_bundle; end
1273
-
1274
- private
1275
-
1276
- sig { returns(::String) }
1277
- def dir; end
1278
-
1279
- sig { returns(::File) }
1280
- def gemfile; end
1281
-
1282
- sig { returns(T::Array[::Symbol]) }
1283
- def groups; end
1284
-
1285
- sig { returns([T::Array[::Tapioca::Gemfile::GemSpec], T::Array[::String]]) }
1286
- def load_dependencies; end
1287
-
1288
- # @return [File]
1289
- def lockfile; end
1290
-
1291
- sig { returns([T::Enumerable[T.any(::Bundler::StubSpecification, ::Gem::Specification)], T::Array[::String]]) }
1292
- def materialize_deps; end
1293
-
1294
- sig { returns(::Bundler::Runtime) }
1295
- def runtime; end
1296
- end
1297
-
1298
- # This is a module that gets prepended to `Bundler::Dependency` and
1299
- # makes sure even gems marked as `require: false` are required during
1300
- # `Bundler.require`.
1301
- module Tapioca::Gemfile::AutoRequireHook
1302
- requires_ancestor { Bundler::Dependency }
1303
-
1304
- sig { returns(T.untyped) }
1305
- def autorequire; end
1306
-
1307
- class << self
1308
- sig { params(exclude: T::Array[::String]).returns(T::Array[::String]) }
1309
- def exclude=(exclude); end
1310
-
1311
- sig { params(name: T.untyped).returns(T::Boolean) }
1312
- def excluded?(name); end
1313
- end
1314
- end
1315
-
1316
- class Tapioca::Gemfile::GemSpec
1317
- sig { params(spec: T.any(::Bundler::StubSpecification, ::Gem::Specification)).void }
1318
- def initialize(spec); end
1319
-
1320
- sig { params(path: ::String).returns(T::Boolean) }
1321
- def contains_path?(path); end
1322
-
1323
- sig { returns(T::Boolean) }
1324
- def export_rbi_files?; end
1325
-
1326
- sig { returns(T::Array[::String]) }
1327
- def exported_rbi_files; end
1328
-
1329
- sig { returns(::RBI::MergeTree) }
1330
- def exported_rbi_tree; end
1331
-
1332
- sig { returns(T::Array[::Pathname]) }
1333
- def files; end
1334
-
1335
- sig { returns(::String) }
1336
- def full_gem_path; end
1337
-
1338
- sig { params(gemfile_dir: ::String).returns(T::Boolean) }
1339
- def ignore?(gemfile_dir); end
1340
-
1341
- sig { returns(::String) }
1342
- def name; end
1343
-
1344
- sig { void }
1345
- def parse_yard_docs; end
1346
-
1347
- sig { returns(::String) }
1348
- def rbi_file_name; end
1349
-
1350
- # @return [String]
1351
- def version; end
1352
-
1353
- private
1354
-
1355
- sig { returns(T::Array[::Pathname]) }
1356
- def collect_files; end
1357
-
1358
- sig { returns(T.nilable(T::Boolean)) }
1359
- def default_gem?; end
1360
-
1361
- sig { returns(T::Boolean) }
1362
- def gem_ignored?; end
1363
-
1364
- sig { params(gemfile_dir: ::String).returns(T::Boolean) }
1365
- def gem_in_app_dir?(gemfile_dir); end
1366
-
1367
- sig { returns(T::Boolean) }
1368
- def gem_in_bundle_path?; end
1369
-
1370
- sig { params(path: ::String).returns(T::Boolean) }
1371
- def has_parent_gemspec?(path); end
1372
-
1373
- sig { returns(::Regexp) }
1374
- def require_paths_prefix_matcher; end
1375
-
1376
- sig { params(file: ::String).returns(::Pathname) }
1377
- def resolve_to_ruby_lib_dir(file); end
1378
-
1379
- sig { params(path: T.any(::Pathname, ::String)).returns(::String) }
1380
- def to_realpath(path); end
1381
-
1382
- sig { returns(::String) }
1383
- def version_string; end
1384
- end
1385
-
1386
- Tapioca::Gemfile::GemSpec::IGNORED_GEMS = T.let(T.unsafe(nil), Array)
1387
- Tapioca::Gemfile::Spec = T.type_alias { T.any(::Bundler::StubSpecification, ::Gem::Specification) }
1388
-
1389
- class Tapioca::RBIFormatter < ::RBI::Formatter
1390
- sig { params(file: ::RBI::File).void }
1391
- def write_empty_body_comment!(file); end
1392
-
1393
- sig { params(file: ::RBI::File, command: ::String, reason: T.nilable(::String)).void }
1394
- def write_header!(file, command, reason: T.unsafe(nil)); end
1395
- end
1396
-
1397
- module Tapioca::RBIHelper
1398
- requires_ancestor { Tapioca::SorbetHelper }
1399
- requires_ancestor { Thor::Shell }
1400
-
1401
- sig do
1402
- params(
1403
- command: ::String,
1404
- gem_dir: ::String,
1405
- dsl_dir: ::String,
1406
- auto_strictness: T::Boolean,
1407
- gems: T::Array[::Tapioca::Gemfile::GemSpec],
1408
- compilers: T::Enumerable[::Class]
1409
- ).void
1410
- end
1411
- def validate_rbi_files(command:, gem_dir:, dsl_dir:, auto_strictness:, gems: T.unsafe(nil), compilers: T.unsafe(nil)); end
1412
-
1413
- private
1414
-
1415
- sig { params(path: ::String).returns(::String) }
1416
- def gem_name_from_rbi_path(path); end
1417
-
1418
- sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error], gem_dir: ::String).void }
1419
- def update_gem_rbis_strictnesses(errors, gem_dir); end
1420
- end
1421
-
1422
- class Tapioca::RepoIndex
1423
- sig { void }
1424
- def initialize; end
1425
-
1426
- sig { params(gem_name: ::String).void }
1427
- def <<(gem_name); end
1428
-
1429
- sig { returns(T::Enumerable[::String]) }
1430
- def gems; end
1431
-
1432
- sig { params(gem_name: ::String).returns(T::Boolean) }
1433
- def has_gem?(gem_name); end
1434
-
1435
- class << self
1436
- sig { params(hash: T::Hash[::String, T::Hash[T.untyped, T.untyped]]).returns(Tapioca::RepoIndex) }
1437
- def from_hash(hash); end
1438
-
1439
- sig { params(json: ::String).returns(Tapioca::RepoIndex) }
1440
- def from_json(json); end
1441
- end
1442
- end
1443
-
1444
- module Tapioca::Runtime; end
1445
-
1446
- class Tapioca::Runtime::DynamicMixinCompiler
1447
- include ::Tapioca::Runtime::Reflection
1448
-
1449
- sig { params(constant: ::Module).void }
1450
- def initialize(constant); end
1451
-
1452
- # @return [Array<Symbol>]
1453
- def class_attribute_predicates; end
1454
-
1455
- sig { returns(T::Array[::Symbol]) }
1456
- def class_attribute_readers; end
1457
-
1458
- # @return [Array<Symbol>]
1459
- def class_attribute_writers; end
1460
-
1461
- sig { params(tree: ::RBI::Tree).void }
1462
- def compile_class_attributes(tree); end
1463
-
1464
- sig { params(tree: ::RBI::Tree).returns([T::Array[::Module], T::Array[::Module]]) }
1465
- def compile_mixes_in_class_methods(tree); end
1466
-
1467
- sig { returns(T::Array[::Module]) }
1468
- def dynamic_extends; end
1469
-
1470
- # @return [Array<Module>]
1471
- def dynamic_includes; end
1472
-
1473
- sig { returns(T::Boolean) }
1474
- def empty_attributes?; end
1475
-
1476
- sig { params(qualified_mixin_name: ::String).returns(T::Boolean) }
1477
- def filtered_mixin?(qualified_mixin_name); end
1478
-
1479
- # @return [Array<Symbol>]
1480
- def instance_attribute_predicates; end
1481
-
1482
- sig { returns(T::Array[::Symbol]) }
1483
- def instance_attribute_readers; end
1484
-
1485
- # @return [Array<Symbol>]
1486
- def instance_attribute_writers; end
1487
-
1488
- sig { params(mod: ::Module, dynamic_extends: T::Array[::Module]).returns(T::Boolean) }
1489
- def module_included_by_another_dynamic_extend?(mod, dynamic_extends); end
1490
- end
1491
-
1492
- # This class is responsible for storing and looking up information related to generic types.
1493
- #
1494
- # The class stores 2 different kinds of data, in two separate lookup tables:
1495
- # 1. a lookup of generic type instances by name: `@generic_instances`
1496
- # 2. a lookup of type variable serializer by constant and type variable
1497
- # instance: `@type_variables`
1498
- #
1499
- # By storing the above data, we can cheaply query each constant against this registry
1500
- # to see if it declares any generic type variables. This becomes a simple lookup in the
1501
- # `@type_variables` hash table with the given constant.
1502
- #
1503
- # If there is no entry, then we can cheaply know that we can skip generic type
1504
- # information generation for this type.
1505
- #
1506
- # On the other hand, if we get a result, then the result will be a hash of type
1507
- # variable to type variable serializers. This allows us to associate type variables
1508
- # to the constant names that represent them, easily.
1509
- module Tapioca::Runtime::GenericTypeRegistry
1510
- class << self
1511
- sig { params(instance: ::Object).returns(T::Boolean) }
1512
- def generic_type_instance?(instance); end
1513
-
1514
- sig { params(constant: ::Module).returns(T.nilable(T::Array[::Tapioca::TypeVariableModule])) }
1515
- def lookup_type_variables(constant); end
1516
-
1517
- # This method is responsible for building the name of the instantiated concrete type
1518
- # and cloning the given constant so that we can return a type that is the same
1519
- # as the current type but is a different instance and has a different name method.
1520
- #
1521
- # We cache those cloned instances by their name in `@generic_instances`, so that
1522
- # we don't keep instantiating a new type every single time it is referenced.
1523
- # For example, `[Foo[Integer], Foo[Integer], Foo[Integer], Foo[String]]` will only
1524
- # result in 2 clones (1 for `Foo[Integer]` and another for `Foo[String]`) and
1525
- # 2 hash lookups (for the other two `Foo[Integer]`s).
1526
- #
1527
- # This method returns the created or cached clone of the constant.
1528
- sig { params(constant: T.untyped, types: T.untyped).returns(::Module) }
1529
- def register_type(constant, types); end
1530
-
1531
- # This method is called from intercepted calls to `type_member` and `type_template`.
1532
- # We get passed all the arguments to those methods, as well as the `T::Types::TypeVariable`
1533
- # instance generated by the Sorbet defined `type_member`/`type_template` call on `T::Generic`.
1534
- #
1535
- # This method creates a `String` with that data and stores it in the
1536
- # `@type_variables` lookup table, keyed by the `constant` and `type_variable`.
1537
- #
1538
- # Finally, the original `type_variable` is returned from this method, so that the caller
1539
- # can return it from the original methods as well.
1540
- sig { params(constant: T.untyped, type_variable: ::Tapioca::TypeVariableModule).void }
1541
- def register_type_variable(constant, type_variable); end
1542
-
1543
- private
1544
-
1545
- sig { params(constant: ::Module, name: ::String).returns(::Module) }
1546
- def create_generic_type(constant, name); end
1547
-
1548
- sig { params(constant: ::Class).returns(::Class) }
1549
- def create_safe_subclass(constant); end
1550
-
1551
- sig { params(constant: ::Module).returns(T::Array[::Tapioca::TypeVariableModule]) }
1552
- def lookup_or_initialize_type_variables(constant); end
1553
- end
1554
- end
1555
-
1556
- class Tapioca::Runtime::Loader
1557
- sig do
1558
- params(
1559
- gemfile: ::Tapioca::Gemfile,
1560
- initialize_file: T.nilable(::String),
1561
- require_file: T.nilable(::String)
1562
- ).void
1563
- end
1564
- def load_bundle(gemfile, initialize_file, require_file); end
1565
-
1566
- sig { params(environment_load: T::Boolean, eager_load: T::Boolean).void }
1567
- def load_rails_application(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil)); end
1568
-
1569
- private
1570
-
1571
- sig { void }
1572
- def eager_load_rails_app; end
1573
-
1574
- sig { void }
1575
- def load_rails_engines; end
1576
-
1577
- sig { returns(T::Array[T.untyped]) }
1578
- def rails_engines; end
1579
-
1580
- sig { params(file: T.nilable(::String)).void }
1581
- def require_helper(file); end
1582
-
1583
- sig { params(path: ::String).void }
1584
- def safe_require(path); end
1585
-
1586
- sig { void }
1587
- def silence_deprecations; end
1588
- end
1589
-
1590
- module Tapioca::Runtime::Reflection
1591
- extend ::Tapioca::Runtime::Reflection
1592
-
1593
- sig { params(constant: ::Module).returns(T::Array[::Module]) }
1594
- def ancestors_of(constant); end
1595
-
1596
- sig { params(object: ::BasicObject, other: ::BasicObject).returns(T::Boolean) }
1597
- def are_equal?(object, other); end
1598
-
1599
- sig { params(object: ::BasicObject).returns(::Class) }
1600
- def class_of(object); end
1601
-
1602
- sig { params(symbol: ::String, inherit: T::Boolean, namespace: ::Module).returns(::BasicObject) }
1603
- def constantize(symbol, inherit: T.unsafe(nil), namespace: T.unsafe(nil)); end
1604
-
1605
- sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1606
- def constants_of(constant); end
1607
-
1608
- # Returns an array with all classes that are < than the supplied class.
1609
- #
1610
- # class C; end
1611
- # descendants_of(C) # => []
1612
- #
1613
- # class B < C; end
1614
- # descendants_of(C) # => [B]
1615
- #
1616
- # class A < B; end
1617
- # descendants_of(C) # => [B, A]
1618
- #
1619
- # class D < C; end
1620
- # descendants_of(C) # => [B, A, D]
1621
- sig do
1622
- type_parameters(:U)
1623
- .params(
1624
- klass: T.all(::Class, T.type_parameter(:U))
1625
- ).returns(T::Array[T.type_parameter(:U)])
1626
- end
1627
- def descendants_of(klass); end
1628
-
1629
- sig { params(constant: ::Module).returns(T::Array[::Module]) }
1630
- def inherited_ancestors_of(constant); end
1631
-
1632
- sig { params(constant: ::Module, method: ::Symbol).returns(::Method) }
1633
- def method_of(constant, method); end
1634
-
1635
- sig { params(constant: ::Module).returns(T.nilable(::String)) }
1636
- def name_of(constant); end
1637
-
1638
- sig { params(type: ::T::Types::Base).returns(::String) }
1639
- def name_of_type(type); end
1640
-
1641
- sig { params(object: ::BasicObject).returns(::Integer) }
1642
- def object_id_of(object); end
1643
-
1644
- sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1645
- def private_instance_methods_of(constant); end
1646
-
1647
- sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1648
- def protected_instance_methods_of(constant); end
1649
-
1650
- sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1651
- def public_instance_methods_of(constant); end
1652
-
1653
- sig { params(constant: ::Module).returns(T.nilable(::String)) }
1654
- def qualified_name_of(constant); end
1655
-
1656
- sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.untyped) }
1657
- def signature_of(method); end
1658
-
1659
- sig { params(constant: ::Module).returns(::Class) }
1660
- def singleton_class_of(constant); end
1661
-
1662
- sig { params(constant: ::Class).returns(T.nilable(::Class)) }
1663
- def superclass_of(constant); end
1664
- end
1665
-
1666
- Tapioca::Runtime::Reflection::ANCESTORS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1667
- Tapioca::Runtime::Reflection::CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1668
- Tapioca::Runtime::Reflection::CONSTANTS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1669
- Tapioca::Runtime::Reflection::EQUAL_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1670
- Tapioca::Runtime::Reflection::METHOD_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1671
- Tapioca::Runtime::Reflection::NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1672
- Tapioca::Runtime::Reflection::OBJECT_ID_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1673
- Tapioca::Runtime::Reflection::PRIVATE_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1674
- Tapioca::Runtime::Reflection::PROTECTED_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1675
- Tapioca::Runtime::Reflection::PUBLIC_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1676
- Tapioca::Runtime::Reflection::SINGLETON_CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1677
- Tapioca::Runtime::Reflection::SUPERCLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1678
- module Tapioca::Runtime::Trackers; end
1679
-
1680
- module Tapioca::Runtime::Trackers::Autoload
1681
- class << self
1682
- sig { void }
1683
- def eager_load_all!; end
1684
-
1685
- sig { params(constant_name: ::String).void }
1686
- def register(constant_name); end
1687
-
1688
- sig do
1689
- type_parameters(:Result)
1690
- .params(
1691
- block: T.proc.returns(T.type_parameter(:Result))
1692
- ).returns(T.type_parameter(:Result))
1693
- end
1694
- def with_disabled_exits(&block); end
1695
- end
1696
- end
1697
-
1698
- Tapioca::Runtime::Trackers::Autoload::NOOP_METHOD = T.let(T.unsafe(nil), Proc)
1699
-
1700
- # Registers a TracePoint immediately upon load to track points at which
1701
- # classes and modules are opened for definition. This is used to track
1702
- # correspondence between classes/modules and files, as this information isn't
1703
- # available in the ruby runtime without extra accounting.
1704
- module Tapioca::Runtime::Trackers::ConstantDefinition
1705
- extend ::Tapioca::Runtime::Reflection
1706
-
1707
- class << self
1708
- # Returns the files in which this class or module was opened. Doesn't know
1709
- # about situations where the class was opened prior to +require+ing,
1710
- # or where metaprogramming was used via +eval+, etc.
1711
- def files_for(klass); end
1712
- end
1713
- end
1714
-
1715
- module Tapioca::Runtime::Trackers::Mixin
1716
- class << self
1717
- sig do
1718
- params(
1719
- constant: ::Module
1720
- ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, T::Array[::String]]])
1721
- end
1722
- def mixin_locations_for(constant); end
1723
-
1724
- sig do
1725
- params(
1726
- constant: ::Module,
1727
- mod: ::Module,
1728
- mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type,
1729
- locations: T.nilable(T::Array[::Thread::Backtrace::Location])
1730
- ).void
1731
- end
1732
- def register(constant, mod, mixin_type, locations); end
1733
- end
1734
- end
1735
-
1736
- class Tapioca::Runtime::Trackers::Mixin::Type < ::T::Enum
1737
- enums do
1738
- Prepend = new
1739
- Include = new
1740
- Extend = new
1741
- end
1742
- end
1743
-
1744
- module Tapioca::Runtime::Trackers::RequiredAncestor
1745
- class << self
1746
- sig { params(requiring: ::T::Helpers, block: T.proc.returns(::Module)).void }
1747
- def register(requiring, block); end
1748
-
1749
- sig { params(mod: ::Module).returns(T::Array[T.proc.returns(::Module)]) }
1750
- def required_ancestors_blocks_by(mod); end
1751
-
1752
- sig { params(mod: ::Module).returns(T::Array[T.nilable(::Module)]) }
1753
- def required_ancestors_by(mod); end
1754
- end
1755
- end
1756
-
1757
- Tapioca::SORBET_CONFIG_FILE = T.let(T.unsafe(nil), String)
1758
- Tapioca::SORBET_DIR = T.let(T.unsafe(nil), String)
1759
-
1760
- module Tapioca::ShimsHelper
1761
- requires_ancestor { Thor::Shell }
1762
-
1763
- sig { params(index: ::RBI::Index, shim_rbi_dir: ::String).returns(T::Hash[::String, T::Array[::RBI::Node]]) }
1764
- def duplicated_nodes_from_index(index, shim_rbi_dir); end
1765
-
1766
- sig { params(index: ::RBI::Index, dir: ::String).void }
1767
- def index_payload(index, dir); end
1768
-
1769
- sig { params(index: ::RBI::Index, kind: ::String, dir: ::String).void }
1770
- def index_rbis(index, kind, dir); end
1771
-
1772
- sig { params(loc: ::RBI::Loc, path_prefix: T.nilable(::String)).returns(::String) }
1773
- def location_to_payload_url(loc, path_prefix:); end
1774
-
1775
- private
1776
-
1777
- sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) }
1778
- def extract_methods_and_attrs(nodes); end
1779
-
1780
- sig do
1781
- params(
1782
- nodes: T::Array[T.any(::RBI::Attr, ::RBI::Method)]
1783
- ).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)])
1784
- end
1785
- def extract_nodes_with_sigs(nodes); end
1786
-
1787
- sig { params(nodes: T::Array[::RBI::Node], shim_rbi_dir: ::String).returns(T::Array[::RBI::Node]) }
1788
- def extract_shims(nodes, shim_rbi_dir); end
1789
-
1790
- sig { params(index: ::RBI::Index, files: T::Array[::String]).void }
1791
- def parse_and_index_files(index, files); end
1792
-
1793
- sig { params(nodes: T::Array[::RBI::Node], shim_rbi_dir: ::String).returns(T::Boolean) }
1794
- def shims_have_duplicates?(nodes, shim_rbi_dir); end
1795
- end
1796
-
1797
- Tapioca::ShimsHelper::SORBET_PAYLOAD_URL = T.let(T.unsafe(nil), String)
1798
-
1799
- module Tapioca::SignaturesHelper
1800
- sig { params(sig_string: ::String).returns(::String) }
1801
- def sanitize_signature_types(sig_string); end
1802
- end
1803
-
1804
- module Tapioca::SorbetHelper
1805
- sig { params(sorbet_args: ::String).returns(::Spoom::ExecResult) }
1806
- def sorbet(*sorbet_args); end
1807
-
1808
- sig { returns(::String) }
1809
- def sorbet_path; end
1810
-
1811
- sig { params(feature: ::Symbol, version: T.nilable(::Gem::Version)).returns(T::Boolean) }
1812
- def sorbet_supports?(feature, version: T.unsafe(nil)); end
1813
- end
1814
-
1815
- Tapioca::SorbetHelper::FEATURE_REQUIREMENTS = T.let(T.unsafe(nil), Hash)
1816
- Tapioca::SorbetHelper::SORBET_BIN = T.let(T.unsafe(nil), Pathname)
1817
- Tapioca::SorbetHelper::SORBET_EXE_PATH_ENV_VAR = T.let(T.unsafe(nil), String)
1818
- Tapioca::SorbetHelper::SORBET_GEM_SPEC = T.let(T.unsafe(nil), Gem::Specification)
1819
- module Tapioca::Static; end
1820
-
1821
- class Tapioca::Static::RequiresCompiler
1822
- sig { params(sorbet_path: ::String).void }
1823
- def initialize(sorbet_path); end
1824
-
1825
- sig { returns(::String) }
1826
- def compile; end
1827
-
1828
- private
1829
-
1830
- sig { params(config: ::Spoom::Sorbet::Config).returns(T::Array[::String]) }
1831
- def collect_files(config); end
1832
-
1833
- sig { params(file_path: ::String).returns(T::Enumerable[::String]) }
1834
- def collect_requires(file_path); end
1835
-
1836
- sig { params(config: ::Spoom::Sorbet::Config, file_path: ::Pathname).returns(T::Boolean) }
1837
- def file_ignored_by_sorbet?(config, file_path); end
1838
-
1839
- sig { params(path: ::Pathname).returns(T::Array[::String]) }
1840
- def path_parts(path); end
1841
- end
1842
-
1843
- module Tapioca::Static::SymbolLoader
1844
- extend ::Tapioca::SorbetHelper
1845
- extend ::Tapioca::Runtime::Reflection
1846
-
1847
- class << self
1848
- sig { returns(T::Set[::String]) }
1849
- def engine_symbols; end
1850
-
1851
- sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) }
1852
- def gem_symbols(gem); end
1853
-
1854
- sig { returns(T::Set[::String]) }
1855
- def payload_symbols; end
1856
-
1857
- private
1858
-
1859
- sig { returns(T::Set[::String]) }
1860
- def load_engine_symbols; end
1861
-
1862
- sig { params(input: ::String, table_type: ::String).returns(::String) }
1863
- def symbol_table_json_from(input, table_type: T.unsafe(nil)); end
1864
-
1865
- sig { params(paths: T::Array[::Pathname]).returns(T::Set[::String]) }
1866
- def symbols_from_paths(paths); end
1867
- end
1868
- end
1869
-
1870
- class Tapioca::Static::SymbolTableParser
1871
- sig { void }
1872
- def initialize; end
1873
-
1874
- sig { params(name: ::String).returns(::String) }
1875
- def fully_qualified_name(name); end
1876
-
1877
- sig { params(object: T::Hash[::String, T.untyped]).void }
1878
- def parse_object(object); end
1879
-
1880
- sig { returns(T::Set[::String]) }
1881
- def symbols; end
1882
-
1883
- class << self
1884
- sig { params(json_string: ::String).returns(T::Set[::String]) }
1885
- def parse_json(json_string); end
1886
- end
1887
- end
1888
-
1889
- Tapioca::TAPIOCA_CONFIG_FILE = T.let(T.unsafe(nil), String)
1890
- Tapioca::TAPIOCA_DIR = T.let(T.unsafe(nil), String)
1891
-
1892
- class Tapioca::TypeVariable < ::T::Types::TypeVariable
1893
- # @return [TypeVariable] a new instance of TypeVariable
1894
- def initialize(name, variance); end
1895
-
1896
- # Returns the value of attribute name.
1897
- def name; end
1898
- end
1899
-
1900
- module Tapioca::TypeVariableHelper
1901
- extend ::Tapioca::SorbetHelper
1902
-
1903
- class << self
1904
- sig do
1905
- params(
1906
- type: ::String,
1907
- variance: ::Symbol,
1908
- fixed: T.nilable(::String),
1909
- upper: T.nilable(::String),
1910
- lower: T.nilable(::String)
1911
- ).returns(::String)
1912
- end
1913
- def serialize_type_variable(type, variance, fixed, upper, lower); end
1914
- end
1915
- end
1916
-
1917
- # This is subclassing from `Module` so that instances of this type will be modules.
1918
- # The reason why we want that is because that means those instances will automatically
1919
- # get bound to the constant names they are assigned to by Ruby. As a result, we don't
1920
- # need to do any matching of constants to type variables to bind their names, Ruby will
1921
- # do that automatically for us and we get the `name` method for free from `Module`.
1922
- class Tapioca::TypeVariableModule < ::Module
1923
- sig do
1924
- params(
1925
- context: ::Module,
1926
- type: ::Tapioca::TypeVariableModule::Type,
1927
- variance: ::Symbol,
1928
- fixed: T.untyped,
1929
- lower: T.untyped,
1930
- upper: T.untyped,
1931
- bounds_proc: T.nilable(T.proc.returns(T::Hash[::Symbol, T.untyped]))
1932
- ).void
1933
- end
1934
- def initialize(context, type, variance, fixed, lower, upper, bounds_proc); end
1935
-
1936
- sig { returns(::Tapioca::TypeVariable) }
1937
- def coerce_to_type_variable; end
1938
-
1939
- sig { returns(T.nilable(::String)) }
1940
- def name; end
1941
-
1942
- sig { returns(::String) }
1943
- def serialize; end
1944
-
1945
- private
1946
-
1947
- sig do
1948
- params(
1949
- fixed: T.untyped,
1950
- lower: T.untyped,
1951
- upper: T.untyped
1952
- ).returns(T.proc.returns(T::Hash[::Symbol, T.untyped]))
1953
- end
1954
- def build_bounds_proc(fixed, lower, upper); end
1955
-
1956
- sig do
1957
- type_parameters(:Result)
1958
- .params(
1959
- block: T.proc.returns(T.type_parameter(:Result))
1960
- ).returns(T.type_parameter(:Result))
1961
- end
1962
- def with_bound_name_pre_3_0(&block); end
1963
- end
1964
-
1965
- class Tapioca::TypeVariableModule::Type < ::T::Enum
1966
- enums do
1967
- Member = new
1968
- Template = new
1969
- end
1970
- end
1971
-
1972
- Tapioca::VERSION = T.let(T.unsafe(nil), String)