ruby-lsp 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/VERSION +1 -1
  4. data/lib/ruby_lsp/handler.rb +0 -19
  5. data/lib/ruby_lsp/requests/document_link.rb +59 -0
  6. data/lib/ruby_lsp/requests/semantic_highlighting.rb +11 -5
  7. data/lib/ruby_lsp/requests/support/highlight_target.rb +2 -1
  8. data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +9 -2
  9. data/lib/ruby_lsp/requests.rb +2 -0
  10. data/lib/ruby_lsp/server.rb +51 -19
  11. metadata +3 -69
  12. data/.github/dependabot.yml +0 -11
  13. data/.github/probots.yml +0 -2
  14. data/.github/pull_request_template.md +0 -15
  15. data/.github/workflows/ci.yml +0 -31
  16. data/.github/workflows/publish_docs.yml +0 -32
  17. data/.gitignore +0 -9
  18. data/.rubocop.yml +0 -40
  19. data/.vscode/extensions.json +0 -5
  20. data/.vscode/settings.json +0 -5
  21. data/.vscode/tasks.json +0 -25
  22. data/CODE_OF_CONDUCT.md +0 -78
  23. data/Gemfile +0 -18
  24. data/Gemfile.lock +0 -126
  25. data/Rakefile +0 -28
  26. data/bin/console +0 -19
  27. data/bin/rubocop +0 -29
  28. data/bin/tapioca +0 -29
  29. data/bin/test +0 -9
  30. data/dev.yml +0 -20
  31. data/rakelib/check_docs.rake +0 -81
  32. data/ruby-lsp.gemspec +0 -27
  33. data/service.yml +0 -2
  34. data/sorbet/config +0 -4
  35. data/sorbet/rbi/.rubocop.yml +0 -8
  36. data/sorbet/rbi/gems/ansi@1.5.0.rbi +0 -338
  37. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -522
  38. data/sorbet/rbi/gems/builder@3.2.4.rbi +0 -418
  39. data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -8
  40. data/sorbet/rbi/gems/debug@1.5.0.rbi +0 -1273
  41. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -867
  42. data/sorbet/rbi/gems/io-console@0.5.11.rbi +0 -8
  43. data/sorbet/rbi/gems/irb@1.4.1.rbi +0 -376
  44. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +0 -7325
  45. data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -8
  46. data/sorbet/rbi/gems/minitest-reporters@1.5.0.rbi +0 -612
  47. data/sorbet/rbi/gems/minitest@5.15.0.rbi +0 -994
  48. data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -163
  49. data/sorbet/rbi/gems/parser@3.1.2.0.rbi +0 -3968
  50. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -734
  51. data/sorbet/rbi/gems/pry@0.14.1.rbi +0 -8
  52. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -227
  53. data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -1853
  54. data/sorbet/rbi/gems/rbi@0.0.14.rbi +0 -2337
  55. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +0 -1854
  56. data/sorbet/rbi/gems/reline@0.3.1.rbi +0 -1274
  57. data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -3852
  58. data/sorbet/rbi/gems/rubocop-ast@1.18.0.rbi +0 -4180
  59. data/sorbet/rbi/gems/rubocop-minitest@0.20.0.rbi +0 -1369
  60. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +0 -246
  61. data/sorbet/rbi/gems/rubocop-shopify@2.6.0.rbi +0 -8
  62. data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +0 -652
  63. data/sorbet/rbi/gems/rubocop@1.30.0.rbi +0 -36729
  64. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -732
  65. data/sorbet/rbi/gems/spoom@1.1.11.rbi +0 -1600
  66. data/sorbet/rbi/gems/syntax_tree@2.7.1.rbi +0 -6777
  67. data/sorbet/rbi/gems/tapioca@0.8.1.rbi +0 -1972
  68. data/sorbet/rbi/gems/thor@1.2.1.rbi +0 -2921
  69. data/sorbet/rbi/gems/unicode-display_width@2.1.0.rbi +0 -27
  70. data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -2789
  71. data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -1779
  72. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +0 -289
  73. data/sorbet/rbi/gems/yard@0.9.27.rbi +0 -13048
  74. data/sorbet/rbi/shims/fiddle.rbi +0 -4
  75. data/sorbet/rbi/shims/hash.rbi +0 -6
  76. data/sorbet/rbi/shims/rdoc.rbi +0 -4
  77. data/sorbet/tapioca/config.yml +0 -13
  78. data/sorbet/tapioca/require.rb +0 -7
@@ -1,8 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `io-console` gem.
5
- # Please instead update this file by running `bin/tapioca gem io-console`.
6
-
7
- # THIS IS AN EMPTY RBI FILE.
8
- # see https://github.com/Shopify/tapioca/wiki/Manual-Gem-Requires
@@ -1,376 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `irb` gem.
5
- # Please instead update this file by running `bin/tapioca gem irb`.
6
-
7
- module IRB::Color
8
- class << self
9
- def clear(colorable: T.unsafe(nil)); end
10
-
11
- # @return [Boolean]
12
- def colorable?; end
13
-
14
- def colorize(text, seq, colorable: T.unsafe(nil)); end
15
-
16
- # If `complete` is false (code is incomplete), this does not warn compile_error.
17
- # This option is needed to avoid warning a user when the compile_error is happening
18
- # because the input is not wrong but just incomplete.
19
- def colorize_code(code, complete: T.unsafe(nil), ignore_error: T.unsafe(nil), colorable: T.unsafe(nil)); end
20
-
21
- # @return [Boolean]
22
- def inspect_colorable?(obj, seen: T.unsafe(nil)); end
23
-
24
- private
25
-
26
- def dispatch_seq(token, expr, str, in_symbol:); end
27
- def scan(code, allow_last_error:); end
28
- def without_circular_ref(obj, seen:, &block); end
29
- end
30
- end
31
-
32
- # A constant of all-bit 1 to match any Ripper's state in #dispatch_seq
33
- IRB::Color::ALL = T.let(T.unsafe(nil), Integer)
34
-
35
- IRB::Color::BLUE = T.let(T.unsafe(nil), Integer)
36
- IRB::Color::BOLD = T.let(T.unsafe(nil), Integer)
37
- IRB::Color::CLEAR = T.let(T.unsafe(nil), Integer)
38
- IRB::Color::CYAN = T.let(T.unsafe(nil), Integer)
39
- IRB::Color::DIM = T.let(T.unsafe(nil), Integer)
40
- IRB::Color::ERROR_TOKENS = T.let(T.unsafe(nil), Array)
41
- IRB::Color::GREEN = T.let(T.unsafe(nil), Integer)
42
- IRB::Color::MAGENTA = T.let(T.unsafe(nil), Integer)
43
- IRB::Color::RED = T.let(T.unsafe(nil), Integer)
44
- IRB::Color::REVERSE = T.let(T.unsafe(nil), Integer)
45
-
46
- # A class to manage a state to know whether the current token is for Symbol or not.
47
- class IRB::Color::SymbolState
48
- # @return [SymbolState] a new instance of SymbolState
49
- def initialize; end
50
-
51
- # Return true if the token is a part of Symbol.
52
- def scan_token(token); end
53
- end
54
-
55
- IRB::Color::TOKEN_KEYWORDS = T.let(T.unsafe(nil), Hash)
56
- IRB::Color::TOKEN_SEQ_EXPRS = T.let(T.unsafe(nil), Hash)
57
- IRB::Color::UNDERLINE = T.let(T.unsafe(nil), Integer)
58
- IRB::Color::YELLOW = T.let(T.unsafe(nil), Integer)
59
-
60
- class IRB::ColorPrinter < ::PP
61
- def pp(obj); end
62
- def text(str, width = T.unsafe(nil)); end
63
-
64
- class << self
65
- def pp(obj, out = T.unsafe(nil), width = T.unsafe(nil)); end
66
-
67
- private
68
-
69
- def screen_width; end
70
- end
71
- end
72
-
73
- # An output formatter used internally by the lexer.
74
- module IRB::Notifier
75
- private
76
-
77
- # Define a new Notifier output source, returning a new CompositeNotifier
78
- # with the given +prefix+ and +output_method+.
79
- #
80
- # The optional +prefix+ will be appended to all objects being inspected
81
- # during output, using the given +output_method+ as the output source. If
82
- # no +output_method+ is given, StdioOutputMethod will be used, and all
83
- # expressions will be sent directly to STDOUT without any additional
84
- # formatting.
85
- def def_notifier(prefix = T.unsafe(nil), output_method = T.unsafe(nil)); end
86
-
87
- class << self
88
- # Define a new Notifier output source, returning a new CompositeNotifier
89
- # with the given +prefix+ and +output_method+.
90
- #
91
- # The optional +prefix+ will be appended to all objects being inspected
92
- # during output, using the given +output_method+ as the output source. If
93
- # no +output_method+ is given, StdioOutputMethod will be used, and all
94
- # expressions will be sent directly to STDOUT without any additional
95
- # formatting.
96
- def def_notifier(prefix = T.unsafe(nil), output_method = T.unsafe(nil)); end
97
- end
98
- end
99
-
100
- # An abstract class, or superclass, for CompositeNotifier and
101
- # LeveledNotifier to inherit. It provides several wrapper methods for the
102
- # OutputMethod object used by the Notifier.
103
- class IRB::Notifier::AbstractNotifier
104
- # Creates a new Notifier object
105
- #
106
- # @return [AbstractNotifier] a new instance of AbstractNotifier
107
- def initialize(prefix, base_notifier); end
108
-
109
- # Execute the given block if notifications are enabled.
110
- #
111
- # @yield [@base_notifier]
112
- def exec_if; end
113
-
114
- # A wrapper method used to determine whether notifications are enabled.
115
- #
116
- # Defaults to +true+.
117
- #
118
- # @return [Boolean]
119
- def notify?; end
120
-
121
- # Same as #ppx, except it uses the #prefix given during object
122
- # initialization.
123
- # See OutputMethod#ppx for more detail.
124
- def pp(*objs); end
125
-
126
- # Same as #pp, except it concatenates the given +prefix+ with the #prefix
127
- # given during object initialization.
128
- #
129
- # See OutputMethod#ppx for more detail.
130
- def ppx(prefix, *objs); end
131
-
132
- # The +prefix+ for this Notifier, which is appended to all objects being
133
- # inspected during output.
134
- def prefix; end
135
-
136
- # See OutputMethod#print for more detail.
137
- def print(*opts); end
138
-
139
- # See OutputMethod#printf for more detail.
140
- def printf(format, *opts); end
141
-
142
- # See OutputMethod#printn for more detail.
143
- def printn(*opts); end
144
-
145
- # See OutputMethod#puts for more detail.
146
- def puts(*objs); end
147
- end
148
-
149
- # A class that can be used to create a group of notifier objects with the
150
- # intent of representing a leveled notification system for irb.
151
- #
152
- # This class will allow you to generate other notifiers, and assign them
153
- # the appropriate level for output.
154
- #
155
- # The Notifier class provides a class-method Notifier.def_notifier to
156
- # create a new composite notifier. Using the first composite notifier
157
- # object you create, sibling notifiers can be initialized with
158
- # #def_notifier.
159
- class IRB::Notifier::CompositeNotifier < ::IRB::Notifier::AbstractNotifier
160
- # Create a new composite notifier object with the given +prefix+, and
161
- # +base_notifier+ to use for output.
162
- #
163
- # @return [CompositeNotifier] a new instance of CompositeNotifier
164
- def initialize(prefix, base_notifier); end
165
-
166
- # Creates a new LeveledNotifier in the composite #notifiers group.
167
- #
168
- # The given +prefix+ will be assigned to the notifier, and +level+ will
169
- # be used as the index of the #notifiers Array.
170
- #
171
- # This method returns the newly created instance.
172
- def def_notifier(level, prefix = T.unsafe(nil)); end
173
-
174
- # Returns the leveled notifier for this object
175
- def level; end
176
-
177
- # Sets the leveled notifier for this object.
178
- #
179
- # When the given +value+ is an instance of AbstractNotifier,
180
- # #level_notifier is set to the given object.
181
- #
182
- # When an Integer is given, #level_notifier is set to the notifier at the
183
- # index +value+ in the #notifiers Array.
184
- #
185
- # If no notifier exists at the index +value+ in the #notifiers Array, an
186
- # ErrUndefinedNotifier exception is raised.
187
- #
188
- # An ErrUnrecognizedLevel exception is raised if the given +value+ is not
189
- # found in the existing #notifiers Array, or an instance of
190
- # AbstractNotifier
191
- def level=(value); end
192
-
193
- # Returns the leveled notifier for this object
194
- def level_notifier; end
195
-
196
- # Sets the leveled notifier for this object.
197
- #
198
- # When the given +value+ is an instance of AbstractNotifier,
199
- # #level_notifier is set to the given object.
200
- #
201
- # When an Integer is given, #level_notifier is set to the notifier at the
202
- # index +value+ in the #notifiers Array.
203
- #
204
- # If no notifier exists at the index +value+ in the #notifiers Array, an
205
- # ErrUndefinedNotifier exception is raised.
206
- #
207
- # An ErrUnrecognizedLevel exception is raised if the given +value+ is not
208
- # found in the existing #notifiers Array, or an instance of
209
- # AbstractNotifier
210
- def level_notifier=(value); end
211
-
212
- # List of notifiers in the group
213
- def notifiers; end
214
- end
215
-
216
- class IRB::Notifier::ErrUndefinedNotifier < ::StandardError
217
- # @return [ErrUndefinedNotifier] a new instance of ErrUndefinedNotifier
218
- def initialize(val); end
219
- end
220
-
221
- class IRB::Notifier::ErrUnrecognizedLevel < ::StandardError
222
- # @return [ErrUnrecognizedLevel] a new instance of ErrUnrecognizedLevel
223
- def initialize(val); end
224
- end
225
-
226
- # A leveled notifier is comparable to the composite group from
227
- # CompositeNotifier#notifiers.
228
- class IRB::Notifier::LeveledNotifier < ::IRB::Notifier::AbstractNotifier
229
- include ::Comparable
230
-
231
- # Create a new leveled notifier with the given +base+, and +prefix+ to
232
- # send to AbstractNotifier.new
233
- #
234
- # The given +level+ is used to compare other leveled notifiers in the
235
- # CompositeNotifier group to determine whether or not to output
236
- # notifications.
237
- #
238
- # @return [LeveledNotifier] a new instance of LeveledNotifier
239
- def initialize(base, level, prefix); end
240
-
241
- # Compares the level of this notifier object with the given +other+
242
- # notifier.
243
- #
244
- # See the Comparable module for more information.
245
- def <=>(other); end
246
-
247
- # The current level of this notifier object
248
- def level; end
249
-
250
- # Whether to output messages to the output method, depending on the level
251
- # of this notifier object.
252
- #
253
- # @return [Boolean]
254
- def notify?; end
255
- end
256
-
257
- # NoMsgNotifier is a LeveledNotifier that's used as the default notifier
258
- # when creating a new CompositeNotifier.
259
- #
260
- # This notifier is used as the +zero+ index, or level +0+, for
261
- # CompositeNotifier#notifiers, and will not output messages of any sort.
262
- class IRB::Notifier::NoMsgNotifier < ::IRB::Notifier::LeveledNotifier
263
- # Creates a new notifier that should not be used to output messages.
264
- #
265
- # @return [NoMsgNotifier] a new instance of NoMsgNotifier
266
- def initialize; end
267
-
268
- # Ensures notifications are ignored, see AbstractNotifier#notify? for
269
- # more information.
270
- #
271
- # @return [Boolean]
272
- def notify?; end
273
- end
274
-
275
- # An abstract output class for IO in irb. This is mainly used internally by
276
- # IRB::Notifier. You can define your own output method to use with Irb.new,
277
- # or Context.new
278
- class IRB::OutputMethod
279
- # Returns an array of the given +format+ and +opts+ to be used by
280
- # Kernel#sprintf, if there was a successful Regexp match in the given
281
- # +format+ from #printf
282
- #
283
- # %
284
- # <flag> [#0- +]
285
- # <minimum field width> (\*|\*[1-9][0-9]*\$|[1-9][0-9]*)
286
- # <precision>.(\*|\*[1-9][0-9]*\$|[1-9][0-9]*|)?
287
- # #<length modifier>(hh|h|l|ll|L|q|j|z|t)
288
- # <conversion specifier>[diouxXeEfgGcsb%]
289
- def parse_printf_format(format, opts); end
290
-
291
- # Prints the given +objs+ calling Object#inspect on each.
292
- #
293
- # See #puts for more detail.
294
- def pp(*objs); end
295
-
296
- # Prints the given +objs+ calling Object#inspect on each and appending the
297
- # given +prefix+.
298
- #
299
- # See #puts for more detail.
300
- def ppx(prefix, *objs); end
301
-
302
- # Open this method to implement your own output method, raises a
303
- # NotImplementedError if you don't define #print in your own class.
304
- #
305
- # @raise [NotImplementedError]
306
- def print(*opts); end
307
-
308
- # Extends IO#printf to format the given +opts+ for Kernel#sprintf using
309
- # #parse_printf_format
310
- def printf(format, *opts); end
311
-
312
- # Prints the given +opts+, with a newline delimiter.
313
- def printn(*opts); end
314
-
315
- # Calls #print on each element in the given +objs+, followed by a newline
316
- # character.
317
- def puts(*objs); end
318
- end
319
-
320
- class IRB::OutputMethod::NotImplementedError < ::StandardError
321
- # @return [NotImplementedError] a new instance of NotImplementedError
322
- def initialize(val); end
323
- end
324
-
325
- # :stopdoc:
326
- class RubyLex
327
- # @return [RubyLex] a new instance of RubyLex
328
- def initialize; end
329
-
330
- def check_code_block(code, tokens = T.unsafe(nil)); end
331
- def check_corresponding_token_depth(lines, line_index); end
332
- def check_newline_depth_difference; end
333
- def check_state(code, tokens = T.unsafe(nil), context: T.unsafe(nil)); end
334
- def check_string_literal(tokens); end
335
- def check_termination_in_prev_line(code, context: T.unsafe(nil)); end
336
- def each_top_level_statement; end
337
- def find_prev_spaces(line_index); end
338
- def initialize_input; end
339
-
340
- # @return [Boolean]
341
- def is_method_calling?(tokens, index); end
342
-
343
- def is_the_in_correspond_to_a_for(tokens, index); end
344
- def lex; end
345
- def process_continue(tokens = T.unsafe(nil)); end
346
- def process_literal_type(tokens = T.unsafe(nil)); end
347
- def process_nesting_level(tokens = T.unsafe(nil)); end
348
- def prompt; end
349
- def set_auto_indent(context); end
350
-
351
- # io functions
352
- def set_input(io, p = T.unsafe(nil), context: T.unsafe(nil), &block); end
353
-
354
- def set_prompt(p = T.unsafe(nil), &block); end
355
- def take_corresponding_syntax_to_kw_do(tokens, index); end
356
-
357
- private
358
-
359
- # @return [Boolean]
360
- def heredoc_scope?; end
361
-
362
- # @return [Boolean]
363
- def in_keyword_case_scope?; end
364
-
365
- class << self
366
- def compile_with_errors_suppressed(code, line_no: T.unsafe(nil)); end
367
- def ripper_lex_without_warning(code, context: T.unsafe(nil)); end
368
- end
369
- end
370
-
371
- RubyLex::ERROR_TOKENS = T.let(T.unsafe(nil), Array)
372
-
373
- class RubyLex::TerminateLineInput < ::StandardError
374
- # @return [TerminateLineInput] a new instance of TerminateLineInput
375
- def initialize; end
376
- end