ruby-lsp 0.0.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +6 -0
  3. data/.rubocop.yml +25 -0
  4. data/CHANGELOG.md +35 -0
  5. data/Gemfile +10 -6
  6. data/Gemfile.lock +63 -16
  7. data/README.md +41 -0
  8. data/Rakefile +8 -1
  9. data/VERSION +1 -1
  10. data/bin/console +19 -0
  11. data/bin/tapioca +29 -0
  12. data/dev.yml +3 -0
  13. data/exe/ruby-lsp +19 -4
  14. data/lib/ruby-lsp.rb +2 -1
  15. data/lib/ruby_lsp/cli.rb +13 -5
  16. data/lib/ruby_lsp/document.rb +43 -14
  17. data/lib/ruby_lsp/handler.rb +107 -37
  18. data/lib/ruby_lsp/internal.rb +7 -0
  19. data/lib/ruby_lsp/requests/base_request.rb +18 -5
  20. data/lib/ruby_lsp/requests/code_actions.rb +20 -8
  21. data/lib/ruby_lsp/requests/diagnostics.rb +25 -7
  22. data/lib/ruby_lsp/requests/document_highlight.rb +113 -0
  23. data/lib/ruby_lsp/requests/document_symbol.rb +56 -16
  24. data/lib/ruby_lsp/requests/folding_ranges.rb +70 -34
  25. data/lib/ruby_lsp/requests/formatting.rb +24 -14
  26. data/lib/ruby_lsp/requests/selection_ranges.rb +18 -4
  27. data/lib/ruby_lsp/requests/semantic_highlighting.rb +187 -34
  28. data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +16 -3
  29. data/lib/ruby_lsp/requests/support/rubocop_diagnostics_runner.rb +61 -0
  30. data/lib/ruby_lsp/requests/support/rubocop_formatting_runner.rb +50 -0
  31. data/lib/ruby_lsp/requests/support/selection_range.rb +4 -0
  32. data/lib/ruby_lsp/requests/support/semantic_token_encoder.rb +24 -3
  33. data/lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb +6 -0
  34. data/lib/ruby_lsp/requests.rb +13 -1
  35. data/lib/ruby_lsp/store.rb +20 -3
  36. data/rakelib/check_docs.rake +34 -6
  37. data/ruby-lsp.gemspec +7 -5
  38. data/sorbet/config +4 -0
  39. data/sorbet/rbi/.rubocop.yml +8 -0
  40. data/sorbet/rbi/gems/ansi@1.5.0.rbi +338 -0
  41. data/sorbet/rbi/gems/ast@2.4.2.rbi +522 -0
  42. data/sorbet/rbi/gems/builder@3.2.4.rbi +418 -0
  43. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  44. data/sorbet/rbi/gems/debug@1.5.0.rbi +1273 -0
  45. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +867 -0
  46. data/sorbet/rbi/gems/io-console@0.5.11.rbi +8 -0
  47. data/sorbet/rbi/gems/irb@1.4.1.rbi +376 -0
  48. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +7325 -0
  49. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  50. data/sorbet/rbi/gems/minitest-reporters@1.5.0.rbi +612 -0
  51. data/sorbet/rbi/gems/minitest@5.15.0.rbi +994 -0
  52. data/sorbet/rbi/gems/parallel@1.22.1.rbi +163 -0
  53. data/sorbet/rbi/gems/parser@3.1.2.0.rbi +3968 -0
  54. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +734 -0
  55. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  56. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +227 -0
  57. data/sorbet/rbi/gems/rake@13.0.6.rbi +1853 -0
  58. data/sorbet/rbi/gems/rbi@0.0.14.rbi +2337 -0
  59. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +1854 -0
  60. data/sorbet/rbi/gems/reline@0.3.1.rbi +1274 -0
  61. data/sorbet/rbi/gems/rexml@3.2.5.rbi +3852 -0
  62. data/sorbet/rbi/gems/rubocop-ast@1.18.0.rbi +4180 -0
  63. data/sorbet/rbi/gems/rubocop-minitest@0.20.0.rbi +1369 -0
  64. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +246 -0
  65. data/sorbet/rbi/gems/rubocop-shopify@2.6.0.rbi +8 -0
  66. data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +652 -0
  67. data/sorbet/rbi/gems/rubocop@1.30.0.rbi +36729 -0
  68. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +732 -0
  69. data/sorbet/rbi/gems/spoom@1.1.11.rbi +1600 -0
  70. data/sorbet/rbi/gems/syntax_tree@2.7.1.rbi +6777 -0
  71. data/sorbet/rbi/gems/tapioca@0.8.1.rbi +1972 -0
  72. data/sorbet/rbi/gems/thor@1.2.1.rbi +2921 -0
  73. data/sorbet/rbi/gems/unicode-display_width@2.1.0.rbi +27 -0
  74. data/sorbet/rbi/gems/unparser@0.6.5.rbi +2789 -0
  75. data/sorbet/rbi/gems/webrick@1.7.0.rbi +1779 -0
  76. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +289 -0
  77. data/sorbet/rbi/gems/yard@0.9.27.rbi +13048 -0
  78. data/sorbet/rbi/shims/fiddle.rbi +4 -0
  79. data/sorbet/rbi/shims/hash.rbi +6 -0
  80. data/sorbet/rbi/shims/rdoc.rbi +4 -0
  81. data/sorbet/tapioca/config.yml +13 -0
  82. data/sorbet/tapioca/require.rb +7 -0
  83. metadata +62 -13
  84. data/lib/ruby_lsp/requests/rubocop_request.rb +0 -49
  85. data/shipit.production.yml +0 -1
@@ -0,0 +1,1600 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `spoom` gem.
5
+ # Please instead update this file by running `bin/tapioca gem spoom`.
6
+
7
+ module Spoom
8
+ class << self
9
+ sig { params(cmd: ::String, arg: ::String, path: ::String, capture_err: T::Boolean).returns(::Spoom::ExecResult) }
10
+ def exec(cmd, *arg, path: T.unsafe(nil), capture_err: T.unsafe(nil)); end
11
+ end
12
+ end
13
+
14
+ module Spoom::Cli; end
15
+
16
+ class Spoom::Cli::Bump < ::Thor
17
+ include ::Spoom::Colorize
18
+ include ::Spoom::Cli::Helper
19
+
20
+ sig { params(directory: ::String).void }
21
+ def bump(directory = T.unsafe(nil)); end
22
+
23
+ def config_files(path: T.unsafe(nil)); end
24
+ def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
25
+ def print_changes(files, command:, from: T.unsafe(nil), to: T.unsafe(nil), dry: T.unsafe(nil), path: T.unsafe(nil)); end
26
+ def undo_changes(files, from_strictness); end
27
+ end
28
+
29
+ class Spoom::Cli::Config < ::Thor
30
+ include ::Spoom::Colorize
31
+ include ::Spoom::Cli::Helper
32
+
33
+ def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
34
+ def show; end
35
+ end
36
+
37
+ class Spoom::Cli::Coverage < ::Thor
38
+ include ::Spoom::Colorize
39
+ include ::Spoom::Cli::Helper
40
+
41
+ def bundle_install(path, sha); end
42
+ def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
43
+ def message_no_data(file); end
44
+ def open(file = T.unsafe(nil)); end
45
+ def parse_time(string, option); end
46
+ def report; end
47
+ def snapshot; end
48
+ def timeline; end
49
+ end
50
+
51
+ Spoom::Cli::Coverage::DATA_DIR = T.let(T.unsafe(nil), String)
52
+
53
+ module Spoom::Cli::Helper
54
+ include ::Spoom::Colorize
55
+
56
+ requires_ancestor { Thor }
57
+
58
+ sig { params(string: ::String).returns(::String) }
59
+ def blue(string); end
60
+
61
+ sig { params(exit_code: ::Integer, block: T.nilable(T.proc.void)).void }
62
+ def check_sorbet_segfault(exit_code, &block); end
63
+
64
+ # Is the `--color` option true?
65
+ sig { returns(T::Boolean) }
66
+ def color?; end
67
+
68
+ # Colorize a string if `color?`
69
+ sig { params(string: ::String, color: ::Spoom::Color).returns(::String) }
70
+ def colorize(string, *color); end
71
+
72
+ sig { params(string: ::String).returns(::String) }
73
+ def cyan(string); end
74
+
75
+ # Return the path specified through `--path`
76
+ sig { returns(::String) }
77
+ def exec_path; end
78
+
79
+ sig { params(string: ::String).returns(::String) }
80
+ def gray(string); end
81
+
82
+ sig { params(string: ::String).returns(::String) }
83
+ def green(string); end
84
+
85
+ sig { params(string: ::String).returns(::String) }
86
+ def highlight(string); end
87
+
88
+ # Enforce that `spoom` is ran inside a project with a `sorbet/config` file
89
+ #
90
+ # Display an error message and exit otherwise.
91
+ sig { void }
92
+ def in_sorbet_project!; end
93
+
94
+ # Is `spoom` ran inside a project with a `sorbet/config` file?
95
+ sig { returns(T::Boolean) }
96
+ def in_sorbet_project?; end
97
+
98
+ sig { params(string: ::String).returns(::String) }
99
+ def red(string); end
100
+
101
+ # Print `message` on `$stdout`
102
+ sig { params(message: ::String).void }
103
+ def say(message); end
104
+
105
+ # Print `message` on `$stderr`
106
+ #
107
+ # The message is prefixed by a status (default: `Error`).
108
+ sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void }
109
+ def say_error(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end
110
+
111
+ sig { returns(::Spoom::Sorbet::Config) }
112
+ def sorbet_config; end
113
+
114
+ sig { returns(::String) }
115
+ def sorbet_config_file; end
116
+
117
+ sig { params(string: ::String).returns(::String) }
118
+ def yellow(string); end
119
+ end
120
+
121
+ class Spoom::Cli::LSP < ::Thor
122
+ include ::Spoom::Colorize
123
+ include ::Spoom::Cli::Helper
124
+
125
+ # TODO: options, filter, limit, kind etc.. filter rbi
126
+ def defs(file, line, col); end
127
+
128
+ # TODO: options, filter, limit, kind etc.. filter rbi
129
+ def find(query); end
130
+
131
+ def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
132
+
133
+ # TODO: options, filter, limit, kind etc.. filter rbi
134
+ def hover(file, line, col); end
135
+
136
+ # TODO: options, filter, limit, kind etc.. filter rbi
137
+ def list; end
138
+
139
+ def lsp_client; end
140
+
141
+ # TODO: options, filter, limit, kind etc.. filter rbi
142
+ def refs(file, line, col); end
143
+
144
+ def run(&block); end
145
+ def show; end
146
+
147
+ # TODO: options, filter, limit, kind etc.. filter rbi
148
+ def sigs(file, line, col); end
149
+
150
+ def symbol_printer; end
151
+
152
+ # TODO: options, filter, limit, kind etc.. filter rbi
153
+ def symbols(file); end
154
+
155
+ def to_uri(path); end
156
+
157
+ # TODO: options, filter, limit, kind etc.. filter rbi
158
+ def types(file, line, col); end
159
+ end
160
+
161
+ class Spoom::Cli::Main < ::Thor
162
+ include ::Spoom::Colorize
163
+ include ::Spoom::Cli::Helper
164
+
165
+ def __print_version; end
166
+ def bump(*args); end
167
+ def config(*args); end
168
+ def coverage(*args); end
169
+ def files; end
170
+ def lsp(*args); end
171
+ def tc(*args); end
172
+
173
+ class << self
174
+ # Utils
175
+ #
176
+ # @return [Boolean]
177
+ def exit_on_failure?; end
178
+ end
179
+ end
180
+
181
+ class Spoom::Cli::Run < ::Thor
182
+ include ::Spoom::Colorize
183
+ include ::Spoom::Cli::Helper
184
+
185
+ def colorize_message(message); end
186
+ def format_error(error, format); end
187
+ def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
188
+ def tc(*arg); end
189
+ end
190
+
191
+ Spoom::Cli::Run::DEFAULT_FORMAT = T.let(T.unsafe(nil), String)
192
+ Spoom::Cli::Run::SORT_CODE = T.let(T.unsafe(nil), String)
193
+ Spoom::Cli::Run::SORT_ENUM = T.let(T.unsafe(nil), Array)
194
+ Spoom::Cli::Run::SORT_LOC = T.let(T.unsafe(nil), String)
195
+
196
+ class Spoom::Color < ::T::Enum
197
+ enums do
198
+ CLEAR = new
199
+ BOLD = new
200
+ BLACK = new
201
+ RED = new
202
+ GREEN = new
203
+ YELLOW = new
204
+ BLUE = new
205
+ MAGENTA = new
206
+ CYAN = new
207
+ WHITE = new
208
+ LIGHT_BLACK = new
209
+ LIGHT_RED = new
210
+ LIGHT_GREEN = new
211
+ LIGHT_YELLOW = new
212
+ LIGHT_BLUE = new
213
+ LIGHT_MAGENTA = new
214
+ LIGHT_CYAN = new
215
+ LIGHT_WHITE = new
216
+ end
217
+
218
+ sig { returns(::String) }
219
+ def ansi_code; end
220
+ end
221
+
222
+ module Spoom::Colorize
223
+ sig { params(string: ::String, color: ::Spoom::Color).returns(::String) }
224
+ def set_color(string, *color); end
225
+ end
226
+
227
+ module Spoom::Coverage
228
+ class << self
229
+ sig do
230
+ params(
231
+ snapshots: T::Array[::Spoom::Coverage::Snapshot],
232
+ palette: ::Spoom::Coverage::D3::ColorPalette,
233
+ path: ::String
234
+ ).returns(::Spoom::Coverage::Report)
235
+ end
236
+ def report(snapshots, palette:, path: T.unsafe(nil)); end
237
+
238
+ sig { params(path: ::String).returns(::Spoom::FileTree) }
239
+ def sigils_tree(path: T.unsafe(nil)); end
240
+
241
+ sig do
242
+ params(
243
+ path: ::String,
244
+ rbi: T::Boolean,
245
+ sorbet_bin: T.nilable(::String)
246
+ ).returns(::Spoom::Coverage::Snapshot)
247
+ end
248
+ def snapshot(path: T.unsafe(nil), rbi: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
249
+
250
+ sig { params(path: ::String).returns(::Spoom::Sorbet::Config) }
251
+ def sorbet_config(path: T.unsafe(nil)); end
252
+ end
253
+ end
254
+
255
+ module Spoom::Coverage::Cards; end
256
+
257
+ class Spoom::Coverage::Cards::Card < ::Spoom::Coverage::Template
258
+ sig { params(template: ::String, title: T.nilable(::String), body: T.nilable(::String)).void }
259
+ def initialize(template: T.unsafe(nil), title: T.unsafe(nil), body: T.unsafe(nil)); end
260
+
261
+ # @return [String, nil]
262
+ def body; end
263
+
264
+ sig { returns(T.nilable(::String)) }
265
+ def title; end
266
+ end
267
+
268
+ Spoom::Coverage::Cards::Card::TEMPLATE = T.let(T.unsafe(nil), String)
269
+
270
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
271
+ class Spoom::Coverage::Cards::Erb < ::Spoom::Coverage::Cards::Card
272
+ abstract!
273
+
274
+ sig { void }
275
+ def initialize; end
276
+
277
+ # @abstract
278
+ sig { abstract.returns(::String) }
279
+ def erb; end
280
+
281
+ sig { override.returns(::String) }
282
+ def html; end
283
+ end
284
+
285
+ class Spoom::Coverage::Cards::Map < ::Spoom::Coverage::Cards::Card
286
+ sig { params(sigils_tree: ::Spoom::FileTree, title: ::String).void }
287
+ def initialize(sigils_tree:, title: T.unsafe(nil)); end
288
+ end
289
+
290
+ class Spoom::Coverage::Cards::Snapshot < ::Spoom::Coverage::Cards::Card
291
+ sig { params(snapshot: ::Spoom::Coverage::Snapshot, title: ::String).void }
292
+ def initialize(snapshot:, title: T.unsafe(nil)); end
293
+
294
+ sig { returns(::Spoom::Coverage::D3::Pie::Calls) }
295
+ def pie_calls; end
296
+
297
+ sig { returns(::Spoom::Coverage::D3::Pie::Sigils) }
298
+ def pie_sigils; end
299
+
300
+ sig { returns(::Spoom::Coverage::D3::Pie::Sigs) }
301
+ def pie_sigs; end
302
+
303
+ sig { returns(::Spoom::Coverage::Snapshot) }
304
+ def snapshot; end
305
+ end
306
+
307
+ Spoom::Coverage::Cards::Snapshot::TEMPLATE = T.let(T.unsafe(nil), String)
308
+
309
+ class Spoom::Coverage::Cards::SorbetIntro < ::Spoom::Coverage::Cards::Erb
310
+ sig { params(sorbet_intro_commit: T.nilable(::String), sorbet_intro_date: T.nilable(::Time)).void }
311
+ def initialize(sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end
312
+
313
+ sig { override.returns(::String) }
314
+ def erb; end
315
+ end
316
+
317
+ class Spoom::Coverage::Cards::Timeline < ::Spoom::Coverage::Cards::Card
318
+ sig { params(title: ::String, timeline: ::Spoom::Coverage::D3::Timeline).void }
319
+ def initialize(title:, timeline:); end
320
+ end
321
+
322
+ class Spoom::Coverage::Cards::Timeline::Calls < ::Spoom::Coverage::Cards::Timeline
323
+ sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void }
324
+ def initialize(snapshots:, title: T.unsafe(nil)); end
325
+ end
326
+
327
+ class Spoom::Coverage::Cards::Timeline::RBIs < ::Spoom::Coverage::Cards::Timeline
328
+ sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void }
329
+ def initialize(snapshots:, title: T.unsafe(nil)); end
330
+ end
331
+
332
+ class Spoom::Coverage::Cards::Timeline::Runtimes < ::Spoom::Coverage::Cards::Timeline
333
+ sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void }
334
+ def initialize(snapshots:, title: T.unsafe(nil)); end
335
+ end
336
+
337
+ class Spoom::Coverage::Cards::Timeline::Sigils < ::Spoom::Coverage::Cards::Timeline
338
+ sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void }
339
+ def initialize(snapshots:, title: T.unsafe(nil)); end
340
+ end
341
+
342
+ class Spoom::Coverage::Cards::Timeline::Sigs < ::Spoom::Coverage::Cards::Timeline
343
+ sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void }
344
+ def initialize(snapshots:, title: T.unsafe(nil)); end
345
+ end
346
+
347
+ class Spoom::Coverage::Cards::Timeline::Versions < ::Spoom::Coverage::Cards::Timeline
348
+ sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void }
349
+ def initialize(snapshots:, title: T.unsafe(nil)); end
350
+ end
351
+
352
+ module Spoom::Coverage::D3
353
+ class << self
354
+ sig { params(palette: ::Spoom::Coverage::D3::ColorPalette).returns(::String) }
355
+ def header_script(palette); end
356
+
357
+ sig { returns(::String) }
358
+ def header_style; end
359
+ end
360
+ end
361
+
362
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
363
+ class Spoom::Coverage::D3::Base
364
+ abstract!
365
+
366
+ sig { params(id: ::String, data: T.untyped).void }
367
+ def initialize(id, data); end
368
+
369
+ sig { returns(::String) }
370
+ def html; end
371
+
372
+ sig { returns(::String) }
373
+ def id; end
374
+
375
+ # @abstract
376
+ sig { abstract.returns(::String) }
377
+ def script; end
378
+
379
+ sig { returns(::String) }
380
+ def tooltip; end
381
+
382
+ class << self
383
+ sig { returns(::String) }
384
+ def header_script; end
385
+
386
+ sig { returns(::String) }
387
+ def header_style; end
388
+ end
389
+ end
390
+
391
+ Spoom::Coverage::D3::COLOR_FALSE = T.let(T.unsafe(nil), String)
392
+ Spoom::Coverage::D3::COLOR_IGNORE = T.let(T.unsafe(nil), String)
393
+ Spoom::Coverage::D3::COLOR_STRICT = T.let(T.unsafe(nil), String)
394
+ Spoom::Coverage::D3::COLOR_STRONG = T.let(T.unsafe(nil), String)
395
+ Spoom::Coverage::D3::COLOR_TRUE = T.let(T.unsafe(nil), String)
396
+
397
+ class Spoom::Coverage::D3::CircleMap < ::Spoom::Coverage::D3::Base
398
+ sig { override.returns(::String) }
399
+ def script; end
400
+
401
+ class << self
402
+ sig { returns(::String) }
403
+ def header_script; end
404
+
405
+ sig { returns(::String) }
406
+ def header_style; end
407
+ end
408
+ end
409
+
410
+ class Spoom::Coverage::D3::CircleMap::Sigils < ::Spoom::Coverage::D3::CircleMap
411
+ sig { params(id: ::String, sigils_tree: ::Spoom::FileTree).void }
412
+ def initialize(id, sigils_tree); end
413
+
414
+ sig { params(node: ::Spoom::FileTree::Node).returns(::Float) }
415
+ def tree_node_score(node); end
416
+
417
+ sig { params(node: ::Spoom::FileTree::Node).returns(T.nilable(::String)) }
418
+ def tree_node_strictness(node); end
419
+
420
+ sig { params(node: ::Spoom::FileTree::Node).returns(T::Hash[::Symbol, T.untyped]) }
421
+ def tree_node_to_json(node); end
422
+ end
423
+
424
+ class Spoom::Coverage::D3::ColorPalette < ::T::Struct
425
+ prop :false, ::String
426
+ prop :ignore, ::String
427
+ prop :strict, ::String
428
+ prop :strong, ::String
429
+ prop :true, ::String
430
+
431
+ class << self
432
+ def inherited(s); end
433
+ end
434
+ end
435
+
436
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
437
+ class Spoom::Coverage::D3::Pie < ::Spoom::Coverage::D3::Base
438
+ abstract!
439
+
440
+ sig { params(id: ::String, title: ::String, data: T.untyped).void }
441
+ def initialize(id, title, data); end
442
+
443
+ sig { override.returns(::String) }
444
+ def script; end
445
+
446
+ class << self
447
+ sig { returns(::String) }
448
+ def header_script; end
449
+
450
+ sig { returns(::String) }
451
+ def header_style; end
452
+ end
453
+ end
454
+
455
+ class Spoom::Coverage::D3::Pie::Calls < ::Spoom::Coverage::D3::Pie
456
+ sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void }
457
+ def initialize(id, title, snapshot); end
458
+
459
+ sig { override.returns(::String) }
460
+ def tooltip; end
461
+ end
462
+
463
+ class Spoom::Coverage::D3::Pie::Sigils < ::Spoom::Coverage::D3::Pie
464
+ sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void }
465
+ def initialize(id, title, snapshot); end
466
+
467
+ sig { override.returns(::String) }
468
+ def tooltip; end
469
+ end
470
+
471
+ class Spoom::Coverage::D3::Pie::Sigs < ::Spoom::Coverage::D3::Pie
472
+ sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void }
473
+ def initialize(id, title, snapshot); end
474
+
475
+ sig { override.returns(::String) }
476
+ def tooltip; end
477
+ end
478
+
479
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
480
+ class Spoom::Coverage::D3::Timeline < ::Spoom::Coverage::D3::Base
481
+ abstract!
482
+
483
+ sig { params(id: ::String, data: T.untyped, keys: T::Array[::String]).void }
484
+ def initialize(id, data, keys); end
485
+
486
+ sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) }
487
+ def area(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end
488
+
489
+ sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) }
490
+ def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end
491
+
492
+ # @abstract
493
+ sig { abstract.returns(::String) }
494
+ def plot; end
495
+
496
+ sig { params(y: ::String).returns(::String) }
497
+ def points(y:); end
498
+
499
+ sig { override.returns(::String) }
500
+ def script; end
501
+
502
+ sig { returns(::String) }
503
+ def x_scale; end
504
+
505
+ sig { returns(::String) }
506
+ def x_ticks; end
507
+
508
+ sig { params(min: ::String, max: ::String, ticks: ::String).returns(::String) }
509
+ def y_scale(min:, max:, ticks:); end
510
+
511
+ sig { params(ticks: ::String, format: ::String, padding: ::Integer).returns(::String) }
512
+ def y_ticks(ticks:, format:, padding:); end
513
+
514
+ class << self
515
+ sig { returns(::String) }
516
+ def header_script; end
517
+
518
+ sig { returns(::String) }
519
+ def header_style; end
520
+ end
521
+ end
522
+
523
+ class Spoom::Coverage::D3::Timeline::Calls < ::Spoom::Coverage::D3::Timeline::Stacked
524
+ sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void }
525
+ def initialize(id, snapshots); end
526
+
527
+ sig { override.returns(::String) }
528
+ def tooltip; end
529
+ end
530
+
531
+ class Spoom::Coverage::D3::Timeline::RBIs < ::Spoom::Coverage::D3::Timeline::Stacked
532
+ sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void }
533
+ def initialize(id, snapshots); end
534
+
535
+ sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) }
536
+ def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end
537
+
538
+ sig { override.returns(::String) }
539
+ def plot; end
540
+
541
+ sig { override.returns(::String) }
542
+ def script; end
543
+
544
+ sig { override.returns(::String) }
545
+ def tooltip; end
546
+ end
547
+
548
+ class Spoom::Coverage::D3::Timeline::Runtimes < ::Spoom::Coverage::D3::Timeline
549
+ sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void }
550
+ def initialize(id, snapshots); end
551
+
552
+ sig { override.returns(::String) }
553
+ def plot; end
554
+
555
+ sig { override.returns(::String) }
556
+ def tooltip; end
557
+ end
558
+
559
+ class Spoom::Coverage::D3::Timeline::Sigils < ::Spoom::Coverage::D3::Timeline::Stacked
560
+ sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void }
561
+ def initialize(id, snapshots); end
562
+
563
+ sig { override.returns(::String) }
564
+ def tooltip; end
565
+ end
566
+
567
+ class Spoom::Coverage::D3::Timeline::Sigs < ::Spoom::Coverage::D3::Timeline::Stacked
568
+ sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void }
569
+ def initialize(id, snapshots); end
570
+
571
+ sig { override.returns(::String) }
572
+ def tooltip; end
573
+ end
574
+
575
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
576
+ class Spoom::Coverage::D3::Timeline::Stacked < ::Spoom::Coverage::D3::Timeline
577
+ abstract!
578
+
579
+ def initialize(*args, **_arg1, &blk); end
580
+
581
+ sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) }
582
+ def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end
583
+
584
+ sig { override.returns(::String) }
585
+ def plot; end
586
+
587
+ sig { override.returns(::String) }
588
+ def script; end
589
+ end
590
+
591
+ class Spoom::Coverage::D3::Timeline::Versions < ::Spoom::Coverage::D3::Timeline
592
+ sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void }
593
+ def initialize(id, snapshots); end
594
+
595
+ sig { override.returns(::String) }
596
+ def plot; end
597
+
598
+ sig { override.returns(::String) }
599
+ def tooltip; end
600
+ end
601
+
602
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
603
+ class Spoom::Coverage::Page < ::Spoom::Coverage::Template
604
+ abstract!
605
+
606
+ sig { params(title: ::String, palette: ::Spoom::Coverage::D3::ColorPalette, template: ::String).void }
607
+ def initialize(title:, palette:, template: T.unsafe(nil)); end
608
+
609
+ sig { returns(::String) }
610
+ def body_html; end
611
+
612
+ # @abstract
613
+ sig { abstract.returns(T::Array[::Spoom::Coverage::Cards::Card]) }
614
+ def cards; end
615
+
616
+ sig { returns(::String) }
617
+ def footer_html; end
618
+
619
+ sig { returns(::String) }
620
+ def header_html; end
621
+
622
+ sig { returns(::String) }
623
+ def header_script; end
624
+
625
+ sig { returns(::String) }
626
+ def header_style; end
627
+
628
+ sig { returns(::Spoom::Coverage::D3::ColorPalette) }
629
+ def palette; end
630
+
631
+ sig { returns(::String) }
632
+ def title; end
633
+ end
634
+
635
+ Spoom::Coverage::Page::TEMPLATE = T.let(T.unsafe(nil), String)
636
+
637
+ class Spoom::Coverage::Report < ::Spoom::Coverage::Page
638
+ sig do
639
+ params(
640
+ project_name: ::String,
641
+ palette: ::Spoom::Coverage::D3::ColorPalette,
642
+ snapshots: T::Array[::Spoom::Coverage::Snapshot],
643
+ sigils_tree: ::Spoom::FileTree,
644
+ sorbet_intro_commit: T.nilable(::String),
645
+ sorbet_intro_date: T.nilable(::Time)
646
+ ).void
647
+ end
648
+ def initialize(project_name:, palette:, snapshots:, sigils_tree:, sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end
649
+
650
+ sig { override.returns(T::Array[::Spoom::Coverage::Cards::Card]) }
651
+ def cards; end
652
+
653
+ sig { override.returns(::String) }
654
+ def header_html; end
655
+
656
+ sig { returns(::String) }
657
+ def project_name; end
658
+
659
+ sig { returns(::Spoom::FileTree) }
660
+ def sigils_tree; end
661
+
662
+ sig { returns(T::Array[::Spoom::Coverage::Snapshot]) }
663
+ def snapshots; end
664
+
665
+ sig { returns(T.nilable(::String)) }
666
+ def sorbet_intro_commit; end
667
+
668
+ sig { returns(T.nilable(::Time)) }
669
+ def sorbet_intro_date; end
670
+ end
671
+
672
+ class Spoom::Coverage::Snapshot < ::T::Struct
673
+ prop :calls_typed, ::Integer, default: T.unsafe(nil)
674
+ prop :calls_untyped, ::Integer, default: T.unsafe(nil)
675
+ prop :classes, ::Integer, default: T.unsafe(nil)
676
+ prop :commit_sha, T.nilable(::String), default: T.unsafe(nil)
677
+ prop :commit_timestamp, T.nilable(::Integer), default: T.unsafe(nil)
678
+ prop :duration, ::Integer, default: T.unsafe(nil)
679
+ prop :files, ::Integer, default: T.unsafe(nil)
680
+ prop :methods_with_sig, ::Integer, default: T.unsafe(nil)
681
+ prop :methods_without_sig, ::Integer, default: T.unsafe(nil)
682
+ prop :modules, ::Integer, default: T.unsafe(nil)
683
+ prop :rbi_files, ::Integer, default: T.unsafe(nil)
684
+ prop :sigils, T::Hash[::String, ::Integer], default: T.unsafe(nil)
685
+ prop :singleton_classes, ::Integer, default: T.unsafe(nil)
686
+ prop :timestamp, ::Integer, default: T.unsafe(nil)
687
+ prop :version_runtime, T.nilable(::String), default: T.unsafe(nil)
688
+ prop :version_static, T.nilable(::String), default: T.unsafe(nil)
689
+
690
+ sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void }
691
+ def print(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end
692
+
693
+ sig { params(arg: T.untyped).returns(::String) }
694
+ def to_json(*arg); end
695
+
696
+ class << self
697
+ sig { params(json: ::String).returns(::Spoom::Coverage::Snapshot) }
698
+ def from_json(json); end
699
+
700
+ sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) }
701
+ def from_obj(obj); end
702
+
703
+ def inherited(s); end
704
+ end
705
+ end
706
+
707
+ # The strictness name as found in the Sorbet metrics file
708
+ Spoom::Coverage::Snapshot::STRICTNESSES = T.let(T.unsafe(nil), Array)
709
+
710
+ class Spoom::Coverage::SnapshotPrinter < ::Spoom::Printer
711
+ sig { params(snapshot: ::Spoom::Coverage::Snapshot).void }
712
+ def print_snapshot(snapshot); end
713
+
714
+ private
715
+
716
+ sig { params(value: T.nilable(::Integer), total: T.nilable(::Integer)).returns(::String) }
717
+ def percent(value, total); end
718
+
719
+ sig { params(hash: T::Hash[::String, ::Integer], total: ::Integer).void }
720
+ def print_map(hash, total); end
721
+ end
722
+
723
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
724
+ class Spoom::Coverage::Template
725
+ abstract!
726
+
727
+ # Create a new template from an Erb file path
728
+ sig { params(template: ::String).void }
729
+ def initialize(template:); end
730
+
731
+ sig { returns(::String) }
732
+ def erb; end
733
+
734
+ sig { returns(::Binding) }
735
+ def get_binding; end
736
+
737
+ sig { returns(::String) }
738
+ def html; end
739
+ end
740
+
741
+ class Spoom::Error < ::StandardError; end
742
+
743
+ class Spoom::ExecResult < ::T::Struct
744
+ const :err, ::String
745
+ const :exit_code, ::Integer
746
+ const :out, ::String
747
+ const :status, T::Boolean
748
+
749
+ class << self
750
+ def inherited(s); end
751
+ end
752
+ end
753
+
754
+ # Build a file hierarchy from a set of file paths.
755
+ class Spoom::FileTree
756
+ sig { params(paths: T::Enumerable[::String], strip_prefix: T.nilable(::String)).void }
757
+ def initialize(paths = T.unsafe(nil), strip_prefix: T.unsafe(nil)); end
758
+
759
+ # Add a `path` to the tree
760
+ #
761
+ # This will create all nodes until the root of `path`.
762
+ sig { params(path: ::String).returns(::Spoom::FileTree::Node) }
763
+ def add_path(path); end
764
+
765
+ # Add all `paths` to the tree
766
+ sig { params(paths: T::Enumerable[::String]).void }
767
+ def add_paths(paths); end
768
+
769
+ # All the nodes in this tree
770
+ sig { returns(T::Array[::Spoom::FileTree::Node]) }
771
+ def nodes; end
772
+
773
+ # All the paths in this tree
774
+ sig { returns(T::Array[::String]) }
775
+ def paths; end
776
+
777
+ sig do
778
+ params(
779
+ out: T.any(::IO, ::StringIO),
780
+ show_strictness: T::Boolean,
781
+ colors: T::Boolean,
782
+ indent_level: ::Integer
783
+ ).void
784
+ end
785
+ def print(out: T.unsafe(nil), show_strictness: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end
786
+
787
+ # All root nodes
788
+ sig { returns(T::Array[::Spoom::FileTree::Node]) }
789
+ def roots; end
790
+
791
+ sig { returns(T.nilable(::String)) }
792
+ def strip_prefix; end
793
+
794
+ private
795
+
796
+ sig do
797
+ params(
798
+ node: ::Spoom::FileTree::Node,
799
+ collected_nodes: T::Array[::Spoom::FileTree::Node]
800
+ ).returns(T::Array[::Spoom::FileTree::Node])
801
+ end
802
+ def collect_nodes(node, collected_nodes = T.unsafe(nil)); end
803
+ end
804
+
805
+ # A node representing either a file or a directory inside a FileTree
806
+ class Spoom::FileTree::Node < ::T::Struct
807
+ const :children, T::Hash[::String, ::Spoom::FileTree::Node], default: T.unsafe(nil)
808
+ const :name, ::String
809
+ const :parent, T.nilable(::Spoom::FileTree::Node)
810
+
811
+ # Full path to this node from root
812
+ sig { returns(::String) }
813
+ def path; end
814
+
815
+ class << self
816
+ def inherited(s); end
817
+ end
818
+ end
819
+
820
+ # An internal class used to print a FileTree
821
+ #
822
+ # See `FileTree#print`
823
+ class Spoom::FileTree::TreePrinter < ::Spoom::Printer
824
+ sig do
825
+ params(
826
+ tree: ::Spoom::FileTree,
827
+ out: T.any(::IO, ::StringIO),
828
+ show_strictness: T::Boolean,
829
+ colors: T::Boolean,
830
+ indent_level: ::Integer
831
+ ).void
832
+ end
833
+ def initialize(tree:, out: T.unsafe(nil), show_strictness: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end
834
+
835
+ sig { params(node: ::Spoom::FileTree::Node).void }
836
+ def print_node(node); end
837
+
838
+ sig { params(nodes: T::Array[::Spoom::FileTree::Node]).void }
839
+ def print_nodes(nodes); end
840
+
841
+ sig { void }
842
+ def print_tree; end
843
+
844
+ sig { returns(::Spoom::FileTree) }
845
+ def tree; end
846
+
847
+ private
848
+
849
+ sig { params(node: ::Spoom::FileTree::Node).returns(T.nilable(::String)) }
850
+ def node_strictness(node); end
851
+
852
+ sig { params(strictness: T.nilable(::String)).returns(::Spoom::Color) }
853
+ def strictness_color(strictness); end
854
+ end
855
+
856
+ # Execute git commands
857
+ module Spoom::Git
858
+ class << self
859
+ # Git commands
860
+ sig { params(arg: ::String, path: ::String).returns(::Spoom::ExecResult) }
861
+ def checkout(*arg, path: T.unsafe(nil)); end
862
+
863
+ # Get the commit Time for a `sha`
864
+ sig { params(sha: ::String, path: ::String).returns(T.nilable(::Time)) }
865
+ def commit_time(sha, path: T.unsafe(nil)); end
866
+
867
+ # Get the commit epoch timestamp for a `sha`
868
+ sig { params(sha: ::String, path: ::String).returns(T.nilable(::Integer)) }
869
+ def commit_timestamp(sha, path: T.unsafe(nil)); end
870
+
871
+ sig { params(path: ::String).returns(T.nilable(::String)) }
872
+ def current_branch(path: T.unsafe(nil)); end
873
+
874
+ sig { params(arg: ::String, path: ::String).returns(::Spoom::ExecResult) }
875
+ def diff(*arg, path: T.unsafe(nil)); end
876
+
877
+ # Translate a git epoch timestamp into a Time
878
+ sig { params(timestamp: ::String).returns(::Time) }
879
+ def epoch_to_time(timestamp); end
880
+
881
+ # Execute a `command`
882
+ sig { params(command: ::String, arg: ::String, path: ::String).returns(::Spoom::ExecResult) }
883
+ def exec(command, *arg, path: T.unsafe(nil)); end
884
+
885
+ # Get the last commit sha
886
+ sig { params(path: ::String).returns(T.nilable(::String)) }
887
+ def last_commit(path: T.unsafe(nil)); end
888
+
889
+ sig { params(arg: ::String, path: ::String).returns(::Spoom::ExecResult) }
890
+ def log(*arg, path: T.unsafe(nil)); end
891
+
892
+ sig { params(arg: ::String, path: ::String).returns(::Spoom::ExecResult) }
893
+ def rev_parse(*arg, path: T.unsafe(nil)); end
894
+
895
+ sig { params(arg: ::String, path: ::String).returns(::Spoom::ExecResult) }
896
+ def show(*arg, path: T.unsafe(nil)); end
897
+
898
+ # Get the hash of the commit introducing the `sorbet/config` file
899
+ sig { params(path: ::String).returns(T.nilable(::String)) }
900
+ def sorbet_intro_commit(path: T.unsafe(nil)); end
901
+
902
+ # Get the hash of the commit removing the `sorbet/config` file
903
+ sig { params(path: ::String).returns(T.nilable(::String)) }
904
+ def sorbet_removal_commit(path: T.unsafe(nil)); end
905
+
906
+ # Is there uncommited changes in `path`?
907
+ sig { params(path: ::String).returns(T::Boolean) }
908
+ def workdir_clean?(path: T.unsafe(nil)); end
909
+ end
910
+ end
911
+
912
+ module Spoom::LSP; end
913
+
914
+ class Spoom::LSP::Client
915
+ sig { params(sorbet_bin: ::String, sorbet_args: ::String, path: ::String).void }
916
+ def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end
917
+
918
+ sig { void }
919
+ def close; end
920
+
921
+ sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) }
922
+ def definitions(uri, line, column); end
923
+
924
+ sig { params(uri: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) }
925
+ def document_symbols(uri); end
926
+
927
+ sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T.nilable(::Spoom::LSP::Hover)) }
928
+ def hover(uri, line, column); end
929
+
930
+ sig { returns(::Integer) }
931
+ def next_id; end
932
+
933
+ # LSP requests
934
+ #
935
+ # @raise [Error::AlreadyOpen]
936
+ sig { params(workspace_path: ::String).void }
937
+ def open(workspace_path); end
938
+
939
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
940
+ def read; end
941
+
942
+ # @raise [Error::BadHeaders]
943
+ sig { returns(T.nilable(::String)) }
944
+ def read_raw; end
945
+
946
+ sig do
947
+ params(
948
+ uri: ::String,
949
+ line: ::Integer,
950
+ column: ::Integer,
951
+ include_decl: T::Boolean
952
+ ).returns(T::Array[::Spoom::LSP::Location])
953
+ end
954
+ def references(uri, line, column, include_decl = T.unsafe(nil)); end
955
+
956
+ sig { params(message: ::Spoom::LSP::Message).returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
957
+ def send(message); end
958
+
959
+ sig { params(json_string: ::String).void }
960
+ def send_raw(json_string); end
961
+
962
+ sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::SignatureHelp]) }
963
+ def signatures(uri, line, column); end
964
+
965
+ sig { params(query: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) }
966
+ def symbols(query); end
967
+
968
+ sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) }
969
+ def type_definitions(uri, line, column); end
970
+ end
971
+
972
+ class Spoom::LSP::Diagnostic < ::T::Struct
973
+ include ::Spoom::LSP::PrintableSymbol
974
+
975
+ const :code, ::Integer
976
+ const :informations, ::Object
977
+ const :message, ::String
978
+ const :range, ::Spoom::LSP::Range
979
+
980
+ sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void }
981
+ def accept_printer(printer); end
982
+
983
+ sig { returns(::String) }
984
+ def to_s; end
985
+
986
+ class << self
987
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) }
988
+ def from_json(json); end
989
+
990
+ def inherited(s); end
991
+ end
992
+ end
993
+
994
+ class Spoom::LSP::DocumentSymbol < ::T::Struct
995
+ include ::Spoom::LSP::PrintableSymbol
996
+
997
+ const :children, T::Array[::Spoom::LSP::DocumentSymbol]
998
+ const :detail, T.nilable(::String)
999
+ const :kind, ::Integer
1000
+ const :location, T.nilable(::Spoom::LSP::Location)
1001
+ const :name, ::String
1002
+ const :range, T.nilable(::Spoom::LSP::Range)
1003
+
1004
+ sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void }
1005
+ def accept_printer(printer); end
1006
+
1007
+ sig { returns(::String) }
1008
+ def kind_string; end
1009
+
1010
+ sig { returns(::String) }
1011
+ def to_s; end
1012
+
1013
+ class << self
1014
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) }
1015
+ def from_json(json); end
1016
+
1017
+ def inherited(s); end
1018
+ end
1019
+ end
1020
+
1021
+ Spoom::LSP::DocumentSymbol::SYMBOL_KINDS = T.let(T.unsafe(nil), Hash)
1022
+ class Spoom::LSP::Error < ::StandardError; end
1023
+ class Spoom::LSP::Error::AlreadyOpen < ::Spoom::LSP::Error; end
1024
+ class Spoom::LSP::Error::BadHeaders < ::Spoom::LSP::Error; end
1025
+
1026
+ class Spoom::LSP::Error::Diagnostics < ::Spoom::LSP::Error
1027
+ sig { params(uri: ::String, diagnostics: T::Array[::Spoom::LSP::Diagnostic]).void }
1028
+ def initialize(uri, diagnostics); end
1029
+
1030
+ sig { returns(T::Array[::Spoom::LSP::Diagnostic]) }
1031
+ def diagnostics; end
1032
+
1033
+ sig { returns(::String) }
1034
+ def uri; end
1035
+
1036
+ class << self
1037
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Error::Diagnostics) }
1038
+ def from_json(json); end
1039
+ end
1040
+ end
1041
+
1042
+ class Spoom::LSP::Hover < ::T::Struct
1043
+ include ::Spoom::LSP::PrintableSymbol
1044
+
1045
+ const :contents, ::String
1046
+ const :range, T.nilable(T::Range[T.untyped])
1047
+
1048
+ sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void }
1049
+ def accept_printer(printer); end
1050
+
1051
+ sig { returns(::String) }
1052
+ def to_s; end
1053
+
1054
+ class << self
1055
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) }
1056
+ def from_json(json); end
1057
+
1058
+ def inherited(s); end
1059
+ end
1060
+ end
1061
+
1062
+ class Spoom::LSP::Location < ::T::Struct
1063
+ include ::Spoom::LSP::PrintableSymbol
1064
+
1065
+ const :range, ::Spoom::LSP::Range
1066
+ const :uri, ::String
1067
+
1068
+ sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void }
1069
+ def accept_printer(printer); end
1070
+
1071
+ sig { returns(::String) }
1072
+ def to_s; end
1073
+
1074
+ class << self
1075
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) }
1076
+ def from_json(json); end
1077
+
1078
+ def inherited(s); end
1079
+ end
1080
+ end
1081
+
1082
+ # A general message as defined by JSON-RPC.
1083
+ #
1084
+ # The language server protocol always uses `"2.0"` as the `jsonrpc` version.
1085
+ class Spoom::LSP::Message
1086
+ sig { void }
1087
+ def initialize; end
1088
+
1089
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
1090
+ def as_json; end
1091
+
1092
+ sig { returns(::String) }
1093
+ def jsonrpc; end
1094
+
1095
+ sig { params(args: T.untyped).returns(::String) }
1096
+ def to_json(*args); end
1097
+ end
1098
+
1099
+ # A notification message.
1100
+ #
1101
+ # A processed notification message must not send a response back. They work like events.
1102
+ class Spoom::LSP::Notification < ::Spoom::LSP::Message
1103
+ sig { params(method: ::String, params: T::Hash[T.untyped, T.untyped]).void }
1104
+ def initialize(method, params); end
1105
+
1106
+ sig { returns(::String) }
1107
+ def method; end
1108
+
1109
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
1110
+ def params; end
1111
+ end
1112
+
1113
+ class Spoom::LSP::Position < ::T::Struct
1114
+ include ::Spoom::LSP::PrintableSymbol
1115
+
1116
+ const :char, ::Integer
1117
+ const :line, ::Integer
1118
+
1119
+ sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void }
1120
+ def accept_printer(printer); end
1121
+
1122
+ sig { returns(::String) }
1123
+ def to_s; end
1124
+
1125
+ class << self
1126
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) }
1127
+ def from_json(json); end
1128
+
1129
+ def inherited(s); end
1130
+ end
1131
+ end
1132
+
1133
+ # @abstract Subclasses must implement the `abstract` methods below.
1134
+ module Spoom::LSP::PrintableSymbol
1135
+ interface!
1136
+
1137
+ # @abstract
1138
+ sig { abstract.params(printer: ::Spoom::LSP::SymbolPrinter).void }
1139
+ def accept_printer(printer); end
1140
+ end
1141
+
1142
+ class Spoom::LSP::Range < ::T::Struct
1143
+ include ::Spoom::LSP::PrintableSymbol
1144
+
1145
+ const :end, ::Spoom::LSP::Position
1146
+ const :start, ::Spoom::LSP::Position
1147
+
1148
+ sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void }
1149
+ def accept_printer(printer); end
1150
+
1151
+ sig { returns(::String) }
1152
+ def to_s; end
1153
+
1154
+ class << self
1155
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) }
1156
+ def from_json(json); end
1157
+
1158
+ def inherited(s); end
1159
+ end
1160
+ end
1161
+
1162
+ # A request message to describe a request between the client and the server.
1163
+ #
1164
+ # Every processed request must send a response back to the sender of the request.
1165
+ class Spoom::LSP::Request < ::Spoom::LSP::Message
1166
+ sig { params(id: ::Integer, method: ::String, params: T::Hash[T.untyped, T.untyped]).void }
1167
+ def initialize(id, method, params); end
1168
+
1169
+ sig { returns(::Integer) }
1170
+ def id; end
1171
+
1172
+ sig { returns(::String) }
1173
+ def method; end
1174
+
1175
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
1176
+ def params; end
1177
+ end
1178
+
1179
+ class Spoom::LSP::ResponseError < ::Spoom::LSP::Error
1180
+ sig { params(code: ::Integer, message: ::String, data: T::Hash[T.untyped, T.untyped]).void }
1181
+ def initialize(code, message, data); end
1182
+
1183
+ sig { returns(::Integer) }
1184
+ def code; end
1185
+
1186
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
1187
+ def data; end
1188
+
1189
+ sig { returns(::String) }
1190
+ def message; end
1191
+
1192
+ class << self
1193
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::ResponseError) }
1194
+ def from_json(json); end
1195
+ end
1196
+ end
1197
+
1198
+ class Spoom::LSP::SignatureHelp < ::T::Struct
1199
+ include ::Spoom::LSP::PrintableSymbol
1200
+
1201
+ const :doc, ::Object
1202
+ const :label, T.nilable(::String)
1203
+ const :params, T::Array[T.untyped]
1204
+
1205
+ sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void }
1206
+ def accept_printer(printer); end
1207
+
1208
+ sig { returns(::String) }
1209
+ def to_s; end
1210
+
1211
+ class << self
1212
+ sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) }
1213
+ def from_json(json); end
1214
+
1215
+ def inherited(s); end
1216
+ end
1217
+ end
1218
+
1219
+ class Spoom::LSP::SymbolPrinter < ::Spoom::Printer
1220
+ sig do
1221
+ params(
1222
+ out: T.any(::IO, ::StringIO),
1223
+ colors: T::Boolean,
1224
+ indent_level: ::Integer,
1225
+ prefix: T.nilable(::String)
1226
+ ).void
1227
+ end
1228
+ def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil), prefix: T.unsafe(nil)); end
1229
+
1230
+ sig { params(uri: ::String).returns(::String) }
1231
+ def clean_uri(uri); end
1232
+
1233
+ sig { returns(T.nilable(::String)) }
1234
+ def prefix; end
1235
+
1236
+ # @return [String, nil]
1237
+ def prefix=(_arg0); end
1238
+
1239
+ sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void }
1240
+ def print_list(objects); end
1241
+
1242
+ sig { params(object: T.nilable(::Spoom::LSP::PrintableSymbol)).void }
1243
+ def print_object(object); end
1244
+
1245
+ sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void }
1246
+ def print_objects(objects); end
1247
+
1248
+ sig { returns(T::Set[::Integer]) }
1249
+ def seen; end
1250
+
1251
+ # @return [Set<Integer>]
1252
+ def seen=(_arg0); end
1253
+ end
1254
+
1255
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
1256
+ class Spoom::Printer
1257
+ include ::Spoom::Colorize
1258
+
1259
+ abstract!
1260
+
1261
+ sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void }
1262
+ def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end
1263
+
1264
+ # Colorize `string` with color if `@colors`
1265
+ sig { params(string: ::String, color: ::Spoom::Color).returns(::String) }
1266
+ def colorize(string, *color); end
1267
+
1268
+ # Decrease indent level
1269
+ sig { void }
1270
+ def dedent; end
1271
+
1272
+ # Increase indent level
1273
+ sig { void }
1274
+ def indent; end
1275
+
1276
+ sig { returns(T.any(::IO, ::StringIO)) }
1277
+ def out; end
1278
+
1279
+ # @return [IO, StringIO]
1280
+ def out=(_arg0); end
1281
+
1282
+ # Print `string` into `out`
1283
+ sig { params(string: T.nilable(::String)).void }
1284
+ def print(string); end
1285
+
1286
+ # Print `string` colored with `color` into `out`
1287
+ #
1288
+ # Does not use colors unless `@colors`.
1289
+ sig { params(string: T.nilable(::String), color: ::Spoom::Color).void }
1290
+ def print_colored(string, *color); end
1291
+
1292
+ # Print `string` with indent and newline
1293
+ sig { params(string: T.nilable(::String)).void }
1294
+ def printl(string); end
1295
+
1296
+ # Print a new line into `out`
1297
+ sig { void }
1298
+ def printn; end
1299
+
1300
+ # Print an indent space into `out`
1301
+ sig { void }
1302
+ def printt; end
1303
+ end
1304
+
1305
+ Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String)
1306
+
1307
+ module Spoom::Sorbet
1308
+ class << self
1309
+ sig do
1310
+ params(
1311
+ arg: ::String,
1312
+ path: ::String,
1313
+ capture_err: T::Boolean,
1314
+ sorbet_bin: T.nilable(::String)
1315
+ ).returns(::Spoom::ExecResult)
1316
+ end
1317
+ def srb(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
1318
+
1319
+ # List all files typechecked by Sorbet from its `config`
1320
+ sig { params(config: ::Spoom::Sorbet::Config, path: ::String).returns(T::Array[::String]) }
1321
+ def srb_files(config, path: T.unsafe(nil)); end
1322
+
1323
+ sig do
1324
+ params(
1325
+ arg: ::String,
1326
+ path: ::String,
1327
+ capture_err: T::Boolean,
1328
+ sorbet_bin: T.nilable(::String)
1329
+ ).returns(T.nilable(T::Hash[::String, ::Integer]))
1330
+ end
1331
+ def srb_metrics(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
1332
+
1333
+ sig do
1334
+ params(
1335
+ arg: ::String,
1336
+ path: ::String,
1337
+ capture_err: T::Boolean,
1338
+ sorbet_bin: T.nilable(::String)
1339
+ ).returns(::Spoom::ExecResult)
1340
+ end
1341
+ def srb_tc(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
1342
+
1343
+ sig do
1344
+ params(
1345
+ arg: ::String,
1346
+ path: ::String,
1347
+ capture_err: T::Boolean,
1348
+ sorbet_bin: T.nilable(::String)
1349
+ ).returns(T.nilable(::String))
1350
+ end
1351
+ def srb_version(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
1352
+
1353
+ # Get `gem` version from the `Gemfile.lock` content
1354
+ #
1355
+ # Returns `nil` if `gem` cannot be found in the Gemfile.
1356
+ sig { params(gem: ::String, path: ::String).returns(T.nilable(::String)) }
1357
+ def version_from_gemfile_lock(gem: T.unsafe(nil), path: T.unsafe(nil)); end
1358
+ end
1359
+ end
1360
+
1361
+ Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String)
1362
+ Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String)
1363
+
1364
+ # Parse Sorbet config files
1365
+ #
1366
+ # Parses a Sorbet config file:
1367
+ #
1368
+ # ```ruby
1369
+ # config = Spoom::Sorbet::Config.parse_file("sorbet/config")
1370
+ # puts config.paths # "."
1371
+ # ```
1372
+ #
1373
+ # Parses a Sorbet config string:
1374
+ #
1375
+ # ```ruby
1376
+ # config = Spoom::Sorbet::Config.parse_string(<<~CONFIG)
1377
+ # a
1378
+ # --file=b
1379
+ # --ignore=c
1380
+ # CONFIG
1381
+ # puts config.paths # "a", "b"
1382
+ # puts config.ignore # "c"
1383
+ # ```
1384
+ class Spoom::Sorbet::Config
1385
+ sig { void }
1386
+ def initialize; end
1387
+
1388
+ # @return [Array<String>]
1389
+ def allowed_extensions; end
1390
+
1391
+ sig { returns(::Spoom::Sorbet::Config) }
1392
+ def copy; end
1393
+
1394
+ # @return [Array<String>]
1395
+ def ignore; end
1396
+
1397
+ sig { returns(T::Boolean) }
1398
+ def no_stdlib; end
1399
+
1400
+ # @return [Boolean]
1401
+ def no_stdlib=(_arg0); end
1402
+
1403
+ # Returns self as a string of options that can be passed to Sorbet
1404
+ #
1405
+ # Example:
1406
+ # ~~~rb
1407
+ # config = Sorbet::Config.new
1408
+ # config.paths << "/foo"
1409
+ # config.paths << "/bar"
1410
+ # config.ignore << "/baz"
1411
+ # config.allowed_extensions << ".rb"
1412
+ #
1413
+ # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb"
1414
+ # ~~~
1415
+ sig { returns(::String) }
1416
+ def options_string; end
1417
+
1418
+ sig { returns(T::Array[::String]) }
1419
+ def paths; end
1420
+
1421
+ class << self
1422
+ sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) }
1423
+ def parse_file(sorbet_config_path); end
1424
+
1425
+ sig { params(sorbet_config: ::String).returns(::Spoom::Sorbet::Config) }
1426
+ def parse_string(sorbet_config); end
1427
+
1428
+ private
1429
+
1430
+ sig { params(line: ::String).returns(::String) }
1431
+ def parse_option(line); end
1432
+ end
1433
+ end
1434
+
1435
+ module Spoom::Sorbet::Errors
1436
+ class << self
1437
+ sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(T::Array[::Spoom::Sorbet::Errors::Error]) }
1438
+ def sort_errors_by_code(errors); end
1439
+ end
1440
+ end
1441
+
1442
+ Spoom::Sorbet::Errors::DEFAULT_ERROR_URL_BASE = T.let(T.unsafe(nil), String)
1443
+
1444
+ class Spoom::Sorbet::Errors::Error
1445
+ include ::Comparable
1446
+
1447
+ sig do
1448
+ params(
1449
+ file: T.nilable(::String),
1450
+ line: T.nilable(::Integer),
1451
+ message: T.nilable(::String),
1452
+ code: T.nilable(::Integer),
1453
+ more: T::Array[::String]
1454
+ ).void
1455
+ end
1456
+ def initialize(file, line, message, code, more = T.unsafe(nil)); end
1457
+
1458
+ # By default errors are sorted by location
1459
+ sig { params(other: T.untyped).returns(::Integer) }
1460
+ def <=>(other); end
1461
+
1462
+ # @return [Integer, nil]
1463
+ def code; end
1464
+
1465
+ sig { returns(T.nilable(::String)) }
1466
+ def file; end
1467
+
1468
+ sig { returns(T.nilable(::Integer)) }
1469
+ def line; end
1470
+
1471
+ # @return [String, nil]
1472
+ def message; end
1473
+
1474
+ sig { returns(T::Array[::String]) }
1475
+ def more; end
1476
+
1477
+ sig { returns(::String) }
1478
+ def to_s; end
1479
+ end
1480
+
1481
+ # Parse errors from Sorbet output
1482
+ class Spoom::Sorbet::Errors::Parser
1483
+ sig { params(error_url_base: ::String).void }
1484
+ def initialize(error_url_base: T.unsafe(nil)); end
1485
+
1486
+ sig { params(output: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) }
1487
+ def parse(output); end
1488
+
1489
+ private
1490
+
1491
+ sig { params(line: ::String).void }
1492
+ def append_error(line); end
1493
+
1494
+ sig { void }
1495
+ def close_error; end
1496
+
1497
+ sig { params(error_url_base: ::String).returns(::Regexp) }
1498
+ def error_line_match_regexp(error_url_base); end
1499
+
1500
+ sig { params(line: ::String).returns(T.nilable(::Spoom::Sorbet::Errors::Error)) }
1501
+ def match_error_line(line); end
1502
+
1503
+ sig { params(error: ::Spoom::Sorbet::Errors::Error).void }
1504
+ def open_error(error); end
1505
+
1506
+ class << self
1507
+ sig { params(output: ::String, error_url_base: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) }
1508
+ def parse_string(output, error_url_base: T.unsafe(nil)); end
1509
+ end
1510
+ end
1511
+
1512
+ Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array)
1513
+ Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String)
1514
+
1515
+ module Spoom::Sorbet::MetricsParser
1516
+ class << self
1517
+ sig { params(path: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) }
1518
+ def parse_file(path, prefix = T.unsafe(nil)); end
1519
+
1520
+ sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(T::Hash[::String, ::Integer]) }
1521
+ def parse_hash(obj, prefix = T.unsafe(nil)); end
1522
+
1523
+ sig { params(string: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) }
1524
+ def parse_string(string, prefix = T.unsafe(nil)); end
1525
+ end
1526
+ end
1527
+
1528
+ Spoom::Sorbet::MetricsParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String)
1529
+ Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer)
1530
+
1531
+ module Spoom::Sorbet::Sigils
1532
+ class << self
1533
+ # changes the sigil in the file at the passed path to the specified new strictness
1534
+ sig { params(path: T.any(::Pathname, ::String), new_strictness: ::String).returns(T::Boolean) }
1535
+ def change_sigil_in_file(path, new_strictness); end
1536
+
1537
+ # changes the sigil to have a new strictness in a list of files
1538
+ sig { params(path_list: T::Array[::String], new_strictness: ::String).returns(T::Array[::String]) }
1539
+ def change_sigil_in_files(path_list, new_strictness); end
1540
+
1541
+ # returns a string containing the strictness of a sigil in a file at the passed path
1542
+ # * returns nil if no sigil
1543
+ sig { params(path: T.any(::Pathname, ::String)).returns(T.nilable(::String)) }
1544
+ def file_strictness(path); end
1545
+
1546
+ # finds all files in the specified directory with the passed strictness
1547
+ sig do
1548
+ params(
1549
+ directory: T.any(::Pathname, ::String),
1550
+ strictness: ::String,
1551
+ extension: ::String
1552
+ ).returns(T::Array[::String])
1553
+ end
1554
+ def files_with_sigil_strictness(directory, strictness, extension: T.unsafe(nil)); end
1555
+
1556
+ # returns the full sigil comment string for the passed strictness
1557
+ sig { params(strictness: ::String).returns(::String) }
1558
+ def sigil_string(strictness); end
1559
+
1560
+ # returns the strictness of a sigil in the passed file content string (nil if no sigil)
1561
+ sig { params(content: ::String).returns(T.nilable(::String)) }
1562
+ def strictness_in_content(content); end
1563
+
1564
+ # returns a string which is the passed content but with the sigil updated to a new strictness
1565
+ sig { params(content: ::String, new_strictness: ::String).returns(::String) }
1566
+ def update_sigil(content, new_strictness); end
1567
+
1568
+ # returns true if the passed string is a valid strictness (else false)
1569
+ sig { params(strictness: ::String).returns(T::Boolean) }
1570
+ def valid_strictness?(strictness); end
1571
+ end
1572
+ end
1573
+
1574
+ Spoom::Sorbet::Sigils::SIGIL_REGEXP = T.let(T.unsafe(nil), Regexp)
1575
+ Spoom::Sorbet::Sigils::STRICTNESS_FALSE = T.let(T.unsafe(nil), String)
1576
+ Spoom::Sorbet::Sigils::STRICTNESS_IGNORE = T.let(T.unsafe(nil), String)
1577
+ Spoom::Sorbet::Sigils::STRICTNESS_INTERNAL = T.let(T.unsafe(nil), String)
1578
+ Spoom::Sorbet::Sigils::STRICTNESS_STRICT = T.let(T.unsafe(nil), String)
1579
+ Spoom::Sorbet::Sigils::STRICTNESS_STRONG = T.let(T.unsafe(nil), String)
1580
+ Spoom::Sorbet::Sigils::STRICTNESS_TRUE = T.let(T.unsafe(nil), String)
1581
+ Spoom::Sorbet::Sigils::VALID_STRICTNESS = T.let(T.unsafe(nil), Array)
1582
+
1583
+ class Spoom::Timeline
1584
+ sig { params(from: ::Time, to: ::Time, path: ::String).void }
1585
+ def initialize(from, to, path: T.unsafe(nil)); end
1586
+
1587
+ # Return one commit for each date in `dates`
1588
+ sig { params(dates: T::Array[::Time]).returns(T::Array[::String]) }
1589
+ def commits_for_dates(dates); end
1590
+
1591
+ # Return all months between `from` and `to`
1592
+ sig { returns(T::Array[::Time]) }
1593
+ def months; end
1594
+
1595
+ # Return one commit for each month between `from` and `to`
1596
+ sig { returns(T::Array[::String]) }
1597
+ def ticks; end
1598
+ end
1599
+
1600
+ Spoom::VERSION = T.let(T.unsafe(nil), String)