From 0d13ed3ead9147f41efb462d22ed408606e2e496 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Sat, 2 Nov 2024 20:20:47 +0800 Subject: [PATCH] Bump ruby-lsp to 0.21 (#49) --- Gemfile.lock | 32 +- lib/ruby_lsp/ruby_lsp_rspec/addon.rb | 2 +- .../ruby_lsp_rspec/indexing_enhancement.rb | 10 +- ruby-lsp-rspec.gemspec | 2 +- .../gems/{json@2.7.2.rbi => json@2.7.5.rbi} | 195 ++- ...{parser@3.3.5.0.rbi => parser@3.3.5.1.rbi} | 0 ...-core@3.13.1.rbi => rspec-core@3.13.2.rbi} | 274 ++-- ...-ast@1.32.3.rbi => rubocop-ast@1.33.0.rbi} | 392 +++-- ...bet@0.8.6.rbi => rubocop-sorbet@0.8.7.rbi} | 0 ...{rubocop@1.67.0.rbi => rubocop@1.68.0.rbi} | 1262 +++++++++++------ ...uby-lsp@0.20.1.rbi => ruby-lsp@0.21.2.rbi} | 726 ++++++---- sorbet/rbi/shims/ruby_lsp.rbi | 11 + 12 files changed, 1860 insertions(+), 1046 deletions(-) rename sorbet/rbi/gems/{json@2.7.2.rbi => json@2.7.5.rbi} (91%) rename sorbet/rbi/gems/{parser@3.3.5.0.rbi => parser@3.3.5.1.rbi} (100%) rename sorbet/rbi/gems/{rspec-core@3.13.1.rbi => rspec-core@3.13.2.rbi} (98%) rename sorbet/rbi/gems/{rubocop-ast@1.32.3.rbi => rubocop-ast@1.33.0.rbi} (96%) rename sorbet/rbi/gems/{rubocop-sorbet@0.8.6.rbi => rubocop-sorbet@0.8.7.rbi} (100%) rename sorbet/rbi/gems/{rubocop@1.67.0.rbi => rubocop@1.68.0.rbi} (98%) rename sorbet/rbi/gems/{ruby-lsp@0.20.1.rbi => ruby-lsp@0.21.2.rbi} (91%) create mode 100644 sorbet/rbi/shims/ruby_lsp.rbi diff --git a/Gemfile.lock b/Gemfile.lock index dacbe2f..fcb38a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: ruby-lsp-rspec (0.1.17) - ruby-lsp (~> 0.20.1) + ruby-lsp (~> 0.21.0) GEM remote: https://rubygems.org/ @@ -17,12 +17,12 @@ GEM irb (1.14.1) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.7.2) + json (2.7.5) language_server-protocol (3.17.0.3) logger (1.6.1) netrc (0.11.0) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.5.1) ast (~> 2.4.1) racc prism (1.2.0) @@ -45,7 +45,7 @@ GEM rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.1) + rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) @@ -54,7 +54,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) - rubocop (1.67.0) + rubocop (1.68.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -64,28 +64,28 @@ GEM rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + rubocop-ast (1.33.0) parser (>= 3.3.1.0) rubocop-rake (0.6.0) rubocop (~> 1.0) rubocop-shopify (2.15.1) rubocop (~> 1.51) - rubocop-sorbet (0.8.6) + rubocop-sorbet (0.8.7) rubocop (>= 1) - ruby-lsp (0.20.1) + ruby-lsp (0.21.2) language_server-protocol (~> 3.17.0) prism (>= 1.2, < 2.0) rbs (>= 3, < 4) sorbet-runtime (>= 0.5.10782) ruby-progressbar (1.13.0) - sorbet (0.5.11604) - sorbet-static (= 0.5.11604) - sorbet-runtime (0.5.11604) - sorbet-static (0.5.11604-universal-darwin) - sorbet-static (0.5.11604-x86_64-linux) - sorbet-static-and-runtime (0.5.11604) - sorbet (= 0.5.11604) - sorbet-runtime (= 0.5.11604) + sorbet (0.5.11633) + sorbet-static (= 0.5.11633) + sorbet-runtime (0.5.11633) + sorbet-static (0.5.11633-universal-darwin) + sorbet-static (0.5.11633-x86_64-linux) + sorbet-static-and-runtime (0.5.11633) + sorbet (= 0.5.11633) + sorbet-runtime (= 0.5.11633) spoom (1.5.0) erubi (>= 1.10.0) prism (>= 0.28.0) diff --git a/lib/ruby_lsp/ruby_lsp_rspec/addon.rb b/lib/ruby_lsp/ruby_lsp_rspec/addon.rb index 3cde027..7932a1a 100644 --- a/lib/ruby_lsp/ruby_lsp_rspec/addon.rb +++ b/lib/ruby_lsp/ruby_lsp_rspec/addon.rb @@ -17,7 +17,7 @@ class Addon < ::RubyLsp::Addon sig { override.params(global_state: GlobalState, message_queue: Thread::Queue).void } def activate(global_state, message_queue) @index = T.let(global_state.index, T.nilable(RubyIndexer::Index)) - global_state.index.register_enhancement(IndexingEnhancement.new) + global_state.index.register_enhancement(IndexingEnhancement.new(global_state.index)) end sig { override.void } diff --git a/lib/ruby_lsp/ruby_lsp_rspec/indexing_enhancement.rb b/lib/ruby_lsp/ruby_lsp_rspec/indexing_enhancement.rb index 29fefc4..2f007f8 100644 --- a/lib/ruby_lsp/ruby_lsp_rspec/indexing_enhancement.rb +++ b/lib/ruby_lsp/ruby_lsp_rspec/indexing_enhancement.rb @@ -3,13 +3,11 @@ module RubyLsp module RSpec - class IndexingEnhancement + class IndexingEnhancement < RubyIndexer::Enhancement extend T::Sig - include RubyIndexer::Enhancement sig do override.params( - index: RubyIndexer::Index, owner: T.nilable(RubyIndexer::Entry::Namespace), node: Prism::CallNode, file_path: String, @@ -19,7 +17,7 @@ class IndexingEnhancement ), ).void end - def on_call_node(index, owner, node, file_path, code_units_cache) + def on_call_node_enter(owner, node, file_path, code_units_cache) return if node.receiver name = node.name @@ -45,7 +43,7 @@ def on_call_node(index, owner, node, file_path, code_units_cache) return unless method_name - index.add(RubyIndexer::Entry::Method.new( + @index.add(RubyIndexer::Entry::Method.new( method_name, file_path, RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache), @@ -78,7 +76,7 @@ def on_call_node(index, owner, node, file_path, code_units_cache) return unless method_name - index.add(RubyIndexer::Entry::Method.new( + @index.add(RubyIndexer::Entry::Method.new( method_name, file_path, RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache), diff --git a/ruby-lsp-rspec.gemspec b/ruby-lsp-rspec.gemspec index 11dce4a..a4f148b 100644 --- a/ruby-lsp-rspec.gemspec +++ b/ruby-lsp-rspec.gemspec @@ -41,5 +41,5 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "ruby-lsp", "~> 0.20.1" + spec.add_dependency "ruby-lsp", "~> 0.21.0" end diff --git a/sorbet/rbi/gems/json@2.7.2.rbi b/sorbet/rbi/gems/json@2.7.5.rbi similarity index 91% rename from sorbet/rbi/gems/json@2.7.2.rbi rename to sorbet/rbi/gems/json@2.7.5.rbi index 43f4f56..86bb100 100644 --- a/sorbet/rbi/gems/json@2.7.2.rbi +++ b/sorbet/rbi/gems/json@2.7.5.rbi @@ -7,7 +7,7 @@ # Extends any Class to include _json_creatable?_ method. # -# source://json/lib/json/common.rb#690 +# source://json/lib/json/common.rb#726 class Class < ::Module # Returns true if this class can be used to create an instance # from a serialised JSON string. The class has to implement a class @@ -16,7 +16,7 @@ class Class < ::Module # # @return [Boolean] # - # source://json/lib/json/common.rb#695 + # source://json/lib/json/common.rb#731 def json_creatable?; end end @@ -599,7 +599,7 @@ end # Without custom addition: "#" (String) # With custom addition: # (Foo) # -# source://json/lib/json/version.rb#2 +# source://json/lib/json/version.rb#3 module JSON private @@ -631,7 +631,7 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json/lib/json/common.rb#615 + # source://json/lib/json/common.rb#630 def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end # :call-seq: @@ -648,13 +648,13 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json/lib/json/common.rb#329 + # source://json/lib/json/common.rb#337 def fast_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json/lib/json/common.rb#329 + # source://json/lib/json/common.rb#337 def fast_unparse(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -693,7 +693,7 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json/lib/json/common.rb#300 + # source://json/lib/json/common.rb#308 def generate(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -824,7 +824,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # :call-seq: @@ -835,7 +835,7 @@ module JSON # # See method #parse. # - # source://json/lib/json/common.rb#249 + # source://json/lib/json/common.rb#257 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -846,10 +846,10 @@ module JSON # # See method #parse! # - # source://json/lib/json/common.rb#260 + # source://json/lib/json/common.rb#268 def load_file!(filespec, opts = T.unsafe(nil)); end - # source://json/lib/json/common.rb#643 + # source://json/lib/json/common.rb#674 def merge_dump_options(opts, strict: T.unsafe(nil)); end # :call-seq: @@ -900,7 +900,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json/lib/json/common.rb#219 + # source://json/lib/json/common.rb#218 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -915,7 +915,7 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json/lib/json/common.rb#234 + # source://json/lib/json/common.rb#242 def parse!(source, opts = T.unsafe(nil)); end # :call-seq: @@ -948,28 +948,28 @@ module JSON # } # } # - # source://json/lib/json/common.rb#374 + # source://json/lib/json/common.rb#382 def pretty_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json/lib/json/common.rb#374 + # source://json/lib/json/common.rb#382 def pretty_unparse(obj, opts = T.unsafe(nil)); end # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_ # - # source://json/lib/json/common.rb#559 + # source://json/lib/json/common.rb#575 def recurse_proc(result, &proc); end - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and # later delete them. # - # source://json/lib/json/common.rb#300 + # source://json/lib/json/common.rb#308 def unparse(obj, opts = T.unsafe(nil)); end class << self @@ -988,23 +988,23 @@ module JSON # source://json/lib/json/common.rb#22 def [](object, opts = T.unsafe(nil)); end - # source://json/lib/json/common.rb#85 + # source://json/lib/json/common.rb#90 def create_fast_state; end # Returns the current create identifier. # See also JSON.create_id=. # - # source://json/lib/json/common.rb#130 + # source://json/lib/json/common.rb#129 def create_id; end # Sets create identifier, which is used to decide if the _json_create_ # hook of a class should be called; initial value is +json_class+: # JSON.create_id # => 'json_class' # - # source://json/lib/json/common.rb#124 + # source://json/lib/json/common.rb#123 def create_id=(new_value); end - # source://json/lib/json/common.rb#95 + # source://json/lib/json/common.rb#100 def create_pretty_state; end # Return the constant located at _path_. The format of _path_ has to be @@ -1012,7 +1012,7 @@ module JSON # level (absolute namespace path?). If there doesn't exist a constant at # the given path, an ArgumentError is raised. # - # source://json/lib/json/common.rb#46 + # source://json/lib/json/common.rb#51 def deep_const_get(path); end # :call-seq: @@ -1043,23 +1043,23 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json/lib/json/common.rb#615 + # source://json/lib/json/common.rb#630 def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end # Sets or returns the default options for the JSON.dump method. # Initially: # opts = JSON.dump_default_options - # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} + # opts # => {:max_nesting=>false, :allow_nan=>true} # - # source://json/lib/json/common.rb#580 + # source://json/lib/json/common.rb#596 def dump_default_options; end # Sets or returns the default options for the JSON.dump method. # Initially: # opts = JSON.dump_default_options - # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} + # opts # => {:max_nesting=>false, :allow_nan=>true} # - # source://json/lib/json/common.rb#580 + # source://json/lib/json/common.rb#596 def dump_default_options=(_arg0); end # :call-seq: @@ -1076,13 +1076,13 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json/lib/json/common.rb#329 + # source://json/lib/json/common.rb#337 def fast_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json/lib/json/common.rb#329 + # source://json/lib/json/common.rb#337 def fast_unparse(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -1121,24 +1121,24 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json/lib/json/common.rb#300 + # source://json/lib/json/common.rb#308 def generate(obj, opts = T.unsafe(nil)); end # Returns the JSON generator module that is used by JSON. This is # either JSON::Ext::Generator or JSON::Pure::Generator: # JSON.generator # => JSON::Ext::Generator # - # source://json/lib/json/common.rb#107 + # source://json/lib/json/common.rb#112 def generator; end # Set the module _generator_ to be used by JSON. # - # source://json/lib/json/common.rb#62 + # source://json/lib/json/common.rb#67 def generator=(generator); end # Encodes string using String.encode. # - # source://json/lib/json/common.rb#639 + # source://json/lib/json/common.rb#670 def iconv(to, from, string); end # :call-seq: @@ -1269,7 +1269,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # Sets or returns default options for the JSON.load method. @@ -1277,7 +1277,7 @@ module JSON # opts = JSON.load_default_options # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true} # - # source://json/lib/json/common.rb#404 + # source://json/lib/json/common.rb#412 def load_default_options; end # Sets or returns default options for the JSON.load method. @@ -1285,7 +1285,7 @@ module JSON # opts = JSON.load_default_options # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true} # - # source://json/lib/json/common.rb#404 + # source://json/lib/json/common.rb#412 def load_default_options=(_arg0); end # :call-seq: @@ -1296,7 +1296,7 @@ module JSON # # See method #parse. # - # source://json/lib/json/common.rb#249 + # source://json/lib/json/common.rb#257 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1307,7 +1307,7 @@ module JSON # # See method #parse! # - # source://json/lib/json/common.rb#260 + # source://json/lib/json/common.rb#268 def load_file!(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1358,7 +1358,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json/lib/json/common.rb#219 + # source://json/lib/json/common.rb#218 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -1373,19 +1373,19 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json/lib/json/common.rb#234 + # source://json/lib/json/common.rb#242 def parse!(source, opts = T.unsafe(nil)); end # Returns the JSON parser class that is used by JSON. This is either # JSON::Ext::Parser or JSON::Pure::Parser: # JSON.parser # => JSON::Ext::Parser # - # source://json/lib/json/common.rb#33 + # source://json/lib/json/common.rb#38 def parser; end # Set the JSON parser class _parser_ to be used by JSON. # - # source://json/lib/json/common.rb#36 + # source://json/lib/json/common.rb#41 def parser=(parser); end # :call-seq: @@ -1418,56 +1418,123 @@ module JSON # } # } # - # source://json/lib/json/common.rb#374 + # source://json/lib/json/common.rb#382 def pretty_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json/lib/json/common.rb#374 + # source://json/lib/json/common.rb#382 def pretty_unparse(obj, opts = T.unsafe(nil)); end # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_ # - # source://json/lib/json/common.rb#559 + # source://json/lib/json/common.rb#575 def recurse_proc(result, &proc); end - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # Sets or Returns the JSON generator state class that is used by JSON. This is # either JSON::Ext::Generator::State or JSON::Pure::Generator::State: # JSON.state # => JSON::Ext::Generator::State # - # source://json/lib/json/common.rb#112 + # source://json/lib/json/common.rb#117 def state; end # Sets or Returns the JSON generator state class that is used by JSON. This is # either JSON::Ext::Generator::State or JSON::Pure::Generator::State: # JSON.state # => JSON::Ext::Generator::State # - # source://json/lib/json/common.rb#112 + # source://json/lib/json/common.rb#117 def state=(_arg0); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and # later delete them. # - # source://json/lib/json/common.rb#300 + # source://json/lib/json/common.rb#308 def unparse(obj, opts = T.unsafe(nil)); end private - # source://json/lib/json/common.rb#643 + # source://json/lib/json/common.rb#674 def merge_dump_options(opts, strict: T.unsafe(nil)); end end end -# source://json/lib/json/common.rb#118 -JSON::CREATE_ID_TLS_KEY = T.let(T.unsafe(nil), String) +# source://json/lib/json/ext/generator/state.rb#6 +class JSON::Ext::Generator::State + # call-seq: new(opts = {}) + # + # Instantiates a new State object, configured by _opts_. + # + # _opts_ can have the following keys: + # + # * *indent*: a string used to indent levels (default: ''), + # * *space*: a string that is put after, a : or , delimiter (default: ''), + # * *space_before*: a string that is put before a : pair delimiter (default: ''), + # * *object_nl*: a string that is put at the end of a JSON object (default: ''), + # * *array_nl*: a string that is put at the end of a JSON array (default: ''), + # * *allow_nan*: true if NaN, Infinity, and -Infinity should be + # generated, otherwise an exception is thrown, if these values are + # encountered. This options defaults to false. + # * *ascii_only*: true if only ASCII characters should be generated. This + # option defaults to false. + # * *buffer_initial_length*: sets the initial length of the generator's + # internal buffer. + # + # @return [State] a new instance of State + # + # source://json/lib/json/ext/generator/state.rb#25 + def initialize(opts = T.unsafe(nil)); end + + # call-seq: [](name) + # + # Returns the value returned by method +name+. + # + # source://json/lib/json/ext/generator/state.rb#113 + def [](name); end + + # call-seq: []=(name, value) + # + # Sets the attribute name to value. + # + # source://json/lib/json/ext/generator/state.rb#125 + def []=(name, value); end -# source://json/lib/json/common.rb#115 -JSON::DEFAULT_CREATE_ID = T.let(T.unsafe(nil), String) + # call-seq: configure(opts) + # + # Configure this State instance with the Hash _opts_, and return + # itself. + # + # source://json/lib/json/ext/generator/state.rb#35 + def configure(opts); end + + # call-seq: configure(opts) + # + # Configure this State instance with the Hash _opts_, and return + # itself. + # + # source://json/lib/json/ext/generator/state.rb#35 + def merge(opts); end + + # call-seq: to_h + # + # Returns the configuration instance variables as a hash, that can be + # passed to the configure method. + # + # source://json/lib/json/ext/generator/state.rb#84 + def to_h; end + + # call-seq: to_h + # + # Returns the configuration instance variables as a hash, that can be + # passed to the configure method. + # + # source://json/lib/json/ext/generator/state.rb#84 + def to_hash; end +end # source://json/lib/json/generic_object.rb#9 class JSON::GenericObject < ::OpenStruct @@ -1512,10 +1579,10 @@ end # The base exception for JSON errors. # -# source://json/lib/json/common.rb#141 +# source://json/lib/json/common.rb#140 class JSON::JSONError < ::StandardError class << self - # source://json/lib/json/common.rb#142 + # source://json/lib/json/common.rb#141 def wrap(exception); end end end @@ -1523,18 +1590,18 @@ end # source://json/lib/json/common.rb#7 JSON::NOT_SET = T.let(T.unsafe(nil), Object) -# source://json/lib/json/common.rb#39 +# source://json/lib/json/common.rb#44 JSON::Parser = JSON::Ext::Parser -# source://json/lib/json/common.rb#77 +# source://json/lib/json/common.rb#82 JSON::State = JSON::Ext::Generator::State # For backwards compatibility # -# source://json/lib/json/common.rb#163 +# source://json/lib/json/common.rb#162 JSON::UnparserError = JSON::GeneratorError -# source://json/lib/json/common.rb#653 +# source://json/lib/json/common.rb#684 module Kernel private @@ -1545,18 +1612,18 @@ module Kernel # The _opts_ argument is passed through to generate/parse respectively. See # generate and parse for their documentation. # - # source://json/lib/json/common.rb#680 + # source://json/lib/json/common.rb#711 def JSON(object, *args); end # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in # one line. # - # source://json/lib/json/common.rb#658 + # source://json/lib/json/common.rb#689 def j(*objs); end # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with # indentation and over many lines. # - # source://json/lib/json/common.rb#667 + # source://json/lib/json/common.rb#698 def jj(*objs); end end diff --git a/sorbet/rbi/gems/parser@3.3.5.0.rbi b/sorbet/rbi/gems/parser@3.3.5.1.rbi similarity index 100% rename from sorbet/rbi/gems/parser@3.3.5.0.rbi rename to sorbet/rbi/gems/parser@3.3.5.1.rbi diff --git a/sorbet/rbi/gems/rspec-core@3.13.1.rbi b/sorbet/rbi/gems/rspec-core@3.13.2.rbi similarity index 98% rename from sorbet/rbi/gems/rspec-core@3.13.1.rbi rename to sorbet/rbi/gems/rspec-core@3.13.2.rbi index e0bcc81..27a3a98 100644 --- a/sorbet/rbi/gems/rspec-core@3.13.1.rbi +++ b/sorbet/rbi/gems/rspec-core@3.13.2.rbi @@ -468,7 +468,7 @@ class RSpec::Core::Configuration # @see #before # @see #prepend_before # - # source://rspec-core/lib/rspec/core/configuration.rb#2026 + # source://rspec-core/lib/rspec/core/configuration.rb#2031 def after(scope = T.unsafe(nil), *meta, &block); end # Creates a method that defines an example group with the provided @@ -609,7 +609,7 @@ class RSpec::Core::Configuration # @see #before # @see #prepend_before # - # source://rspec-core/lib/rspec/core/configuration.rb#2056 + # source://rspec-core/lib/rspec/core/configuration.rb#2061 def append_after(scope = T.unsafe(nil), *meta, &block); end # Defines a `before` hook. See {Hooks#before} for full docs. @@ -623,20 +623,20 @@ class RSpec::Core::Configuration # @see #after # @see #append_after # - # source://rspec-core/lib/rspec/core/configuration.rb#1971 + # source://rspec-core/lib/rspec/core/configuration.rb#1976 def append_before(scope = T.unsafe(nil), *meta, &block); end # @private # @raise [SystemStackError] # - # source://rspec-core/lib/rspec/core/configuration.rb#1936 + # source://rspec-core/lib/rspec/core/configuration.rb#1941 def apply_derived_metadata_to(metadata); end # Registers `block` as an `around` hook. # # See {Hooks#around} for full `around` hook docs. # - # source://rspec-core/lib/rspec/core/configuration.rb#2074 + # source://rspec-core/lib/rspec/core/configuration.rb#2079 def around(scope = T.unsafe(nil), *meta, &block); end # Regexps used to exclude lines from backtraces. @@ -700,7 +700,7 @@ class RSpec::Core::Configuration # @see #after # @see #append_after # - # source://rspec-core/lib/rspec/core/configuration.rb#1971 + # source://rspec-core/lib/rspec/core/configuration.rb#1976 def before(scope = T.unsafe(nil), *meta, &block); end # Determines which bisect runner implementation gets used to run subsets @@ -730,7 +730,7 @@ class RSpec::Core::Configuration # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#2120 + # source://rspec-core/lib/rspec/core/configuration.rb#2125 def bisect_runner_class; end # Enables color output if the output is a TTY. As of RSpec 3.6, this is @@ -788,12 +788,12 @@ class RSpec::Core::Configuration # # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1577 + # source://rspec-core/lib/rspec/core/configuration.rb#1580 def configure_example(example, example_hooks); end # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1617 + # source://rspec-core/lib/rspec/core/configuration.rb#1622 def configure_expectation_framework; end # Used internally to extend a group with modules using `include`, `prepend` and/or @@ -801,12 +801,12 @@ class RSpec::Core::Configuration # # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1565 + # source://rspec-core/lib/rspec/core/configuration.rb#1568 def configure_group(group); end # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1611 + # source://rspec-core/lib/rspec/core/configuration.rb#1616 def configure_mock_framework; end # The default output color. Defaults to `:white` but can be set to one of @@ -889,7 +889,7 @@ class RSpec::Core::Configuration # @yieldparam metadata [Hash] original metadata hash from an example or # group. Mutate this in your block as needed. # - # source://rspec-core/lib/rspec/core/configuration.rb#1895 + # source://rspec-core/lib/rspec/core/configuration.rb#1900 def define_derived_metadata(*filters, &block); end # Determines where deprecation warnings are printed. @@ -930,7 +930,7 @@ class RSpec::Core::Configuration # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1876 + # source://rspec-core/lib/rspec/core/configuration.rb#1881 def disable_monkey_patching; end # Enables zero monkey patching mode for RSpec. It removes monkey @@ -968,12 +968,12 @@ class RSpec::Core::Configuration # (or similar) they will still have monkey patching active # in their test environment from mocha. # - # source://rspec-core/lib/rspec/core/configuration.rb#1868 + # source://rspec-core/lib/rspec/core/configuration.rb#1873 def disable_monkey_patching!; end # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1876 + # source://rspec-core/lib/rspec/core/configuration.rb#1881 def disable_monkey_patching=(_arg0); end # Run examples over DRb (default: `false`). RSpec doesn't supply the DRb @@ -1158,7 +1158,7 @@ class RSpec::Core::Configuration # end # @param method_name [Symbol] the name of the helper method # - # source://rspec-core/lib/rspec/core/configuration.rb#1806 + # source://rspec-core/lib/rspec/core/configuration.rb#1811 def expose_current_running_example_as(method_name); end # Use this to expose the core RSpec DSL via `Module` and the `main` @@ -1215,7 +1215,7 @@ class RSpec::Core::Configuration # @see #include # @see #prepend # - # source://rspec-core/lib/rspec/core/configuration.rb#1515 + # source://rspec-core/lib/rspec/core/configuration.rb#1518 def extend(mod, *filters); end # If specified, indicates the number of failures required before cleaning @@ -1499,12 +1499,12 @@ class RSpec::Core::Configuration # config.format_docstrings { |s| s.strip } # end # - # source://rspec-core/lib/rspec/core/configuration.rb#1656 + # source://rspec-core/lib/rspec/core/configuration.rb#1661 def format_docstrings(&block); end # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1661 + # source://rspec-core/lib/rspec/core/configuration.rb#1666 def format_docstrings_block; end # Adds a formatter to the set RSpec will use for this run. @@ -1580,12 +1580,12 @@ class RSpec::Core::Configuration # # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#2104 + # source://rspec-core/lib/rspec/core/configuration.rb#2109 def hooks; end # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1602 + # source://rspec-core/lib/rspec/core/configuration.rb#1607 def in_project_source_dir_regex; end # Tells RSpec to include `mod` in example groups. Methods defined in @@ -1620,6 +1620,9 @@ class RSpec::Core::Configuration # # # included in examples with `:type => :request` metadata # config.include(AuthenticationHelpers, :type => :request) + # + # # included in examples where the `:type` metadata matches a proc condition + # config.include(AuthenticationHelpers, :type => proc { |type, _metadata| [:request, :controller].include?(type) }) # end # # describe "edit profile", :preferences, :type => :request do @@ -1639,7 +1642,7 @@ class RSpec::Core::Configuration # @see #extend # @see #prepend # - # source://rspec-core/lib/rspec/core/configuration.rb#1425 + # source://rspec-core/lib/rspec/core/configuration.rb#1428 def include(mod, *filters); end # Tells RSpec to include the named shared example group in example groups. @@ -1682,7 +1685,7 @@ class RSpec::Core::Configuration # example. # @see #include # - # source://rspec-core/lib/rspec/core/configuration.rb#1472 + # source://rspec-core/lib/rspec/core/configuration.rb#1475 def include_context(shared_group_name, *filters); end # Returns the `inclusion_filter`. If none has been set, returns an empty @@ -1722,7 +1725,7 @@ class RSpec::Core::Configuration # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1625 + # source://rspec-core/lib/rspec/core/configuration.rb#1630 def load_spec_files; end # @private @@ -1794,14 +1797,14 @@ class RSpec::Core::Configuration # Invokes block before defining an example group # - # source://rspec-core/lib/rspec/core/configuration.rb#2109 + # source://rspec-core/lib/rspec/core/configuration.rb#2114 def on_example_group_definition(&block); end # Returns an array of blocks to call before defining an example group # # @api private # - # source://rspec-core/lib/rspec/core/configuration.rb#2115 + # source://rspec-core/lib/rspec/core/configuration.rb#2120 def on_example_group_definition_callbacks; end # Indicates if the `--only-failures` (or `--next-failure`) flag is being used. @@ -1827,7 +1830,7 @@ class RSpec::Core::Configuration # # @see #register_ordering # - # source://rspec-core/lib/rspec/core/configuration.rb#1668 + # source://rspec-core/lib/rspec/core/configuration.rb#1673 def order=(*args, &block); end # @private @@ -1835,7 +1838,7 @@ class RSpec::Core::Configuration # source://rspec-core/lib/rspec/core/configuration.rb#522 def ordering_manager; end - # source://rspec-core/lib/rspec/core/configuration.rb#1668 + # source://rspec-core/lib/rspec/core/configuration.rb#1673 def ordering_registry(*args, &block); end # Determines where RSpec will send its output. @@ -1945,7 +1948,7 @@ class RSpec::Core::Configuration # @see #include # @see #extend # - # source://rspec-core/lib/rspec/core/configuration.rb#1554 + # source://rspec-core/lib/rspec/core/configuration.rb#1557 def prepend(mod, *filters); end # Defines a `after` hook. See {Hooks#after} for full docs. @@ -1959,7 +1962,7 @@ class RSpec::Core::Configuration # @see #before # @see #prepend_before # - # source://rspec-core/lib/rspec/core/configuration.rb#2026 + # source://rspec-core/lib/rspec/core/configuration.rb#2031 def prepend_after(scope = T.unsafe(nil), *meta, &block); end # Adds `block` to the start of the list of `before` blocks in the same @@ -1977,7 +1980,7 @@ class RSpec::Core::Configuration # @see #after # @see #append_after # - # source://rspec-core/lib/rspec/core/configuration.rb#2001 + # source://rspec-core/lib/rspec/core/configuration.rb#2006 def prepend_before(scope = T.unsafe(nil), *meta, &block); end # Defaults `profile_examples` to 10 examples when `@profile_examples` is @@ -2037,7 +2040,7 @@ class RSpec::Core::Configuration # rspec.raise_errors_for_deprecations! # end # - # source://rspec-core/lib/rspec/core/configuration.rb#1828 + # source://rspec-core/lib/rspec/core/configuration.rb#1833 def raise_errors_for_deprecations!; end # Turns RSpec warnings into errors. This can be useful when @@ -2050,7 +2053,7 @@ class RSpec::Core::Configuration # rspec.raise_on_warning = true # end # - # source://rspec-core/lib/rspec/core/configuration.rb#1776 + # source://rspec-core/lib/rspec/core/configuration.rb#1781 def raise_on_warning=(value); end # Registers a named ordering strategy that can later be @@ -2092,7 +2095,7 @@ class RSpec::Core::Configuration # @yieldparam list [Array, Array] The examples or groups to order # @yieldreturn [Array, Array] The re-ordered examples or groups # - # source://rspec-core/lib/rspec/core/configuration.rb#1668 + # source://rspec-core/lib/rspec/core/configuration.rb#1673 def register_ordering(*args, &block); end # @return [RSpec::Core::Reporter] the currently configured reporter @@ -2109,7 +2112,7 @@ class RSpec::Core::Configuration # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1594 + # source://rspec-core/lib/rspec/core/configuration.rb#1597 def requires=(paths); end # @private @@ -2160,15 +2163,15 @@ class RSpec::Core::Configuration # We recommend, actually, that you use the command line approach so you # don't accidentally leave the seed encoded. # - # source://rspec-core/lib/rspec/core/configuration.rb#1668 + # source://rspec-core/lib/rspec/core/configuration.rb#1673 def seed(*args, &block); end # Sets the seed value and sets the default global ordering to random. # - # source://rspec-core/lib/rspec/core/configuration.rb#1668 + # source://rspec-core/lib/rspec/core/configuration.rb#1673 def seed=(*args, &block); end - # source://rspec-core/lib/rspec/core/configuration.rb#1668 + # source://rspec-core/lib/rspec/core/configuration.rb#1673 def seed_used?(*args, &block); end # Configures how RSpec treats metadata passed as part of a shared example @@ -2314,12 +2317,12 @@ class RSpec::Core::Configuration # Set Ruby warnings on or off. # - # source://rspec-core/lib/rspec/core/configuration.rb#1755 + # source://rspec-core/lib/rspec/core/configuration.rb#1760 def warnings=(value); end # @return [Boolean] Whether or not ruby warnings are enabled. # - # source://rspec-core/lib/rspec/core/configuration.rb#1760 + # source://rspec-core/lib/rspec/core/configuration.rb#1765 def warnings?; end # Defines a callback that runs after the first example with matching @@ -2341,12 +2344,12 @@ class RSpec::Core::Configuration # end # end # - # source://rspec-core/lib/rspec/core/configuration.rb#1918 + # source://rspec-core/lib/rspec/core/configuration.rb#1923 def when_first_matching_example_defined(*filters); end # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#2086 + # source://rspec-core/lib/rspec/core/configuration.rb#2091 def with_suite_hooks; end # @private @@ -2365,111 +2368,111 @@ class RSpec::Core::Configuration # # @return [Boolean] # - # source://rspec-core/lib/rspec/core/configuration.rb#2249 + # source://rspec-core/lib/rspec/core/configuration.rb#2254 def absolute_pattern?(pattern); end - # source://rspec-core/lib/rspec/core/configuration.rb#2350 + # source://rspec-core/lib/rspec/core/configuration.rb#2355 def add_hook_to_existing_matching_groups(meta, scope, &block); end # @raise [MustBeConfiguredBeforeExampleGroupsError] # - # source://rspec-core/lib/rspec/core/configuration.rb#2289 + # source://rspec-core/lib/rspec/core/configuration.rb#2294 def assert_no_example_groups_defined(config_option); end - # source://rspec-core/lib/rspec/core/configuration.rb#2339 + # source://rspec-core/lib/rspec/core/configuration.rb#2344 def clear_values_derived_from_example_status_persistence_file_path; end - # source://rspec-core/lib/rspec/core/configuration.rb#2271 + # source://rspec-core/lib/rspec/core/configuration.rb#2276 def command; end - # source://rspec-core/lib/rspec/core/configuration.rb#2315 + # source://rspec-core/lib/rspec/core/configuration.rb#2320 def conditionally_disable_expectations_monkey_patching; end - # source://rspec-core/lib/rspec/core/configuration.rb#2306 + # source://rspec-core/lib/rspec/core/configuration.rb#2311 def conditionally_disable_mocks_monkey_patching; end - # source://rspec-core/lib/rspec/core/configuration.rb#2344 + # source://rspec-core/lib/rspec/core/configuration.rb#2349 def configure_group_with(group, module_list, application_method); end - # source://rspec-core/lib/rspec/core/configuration.rb#2279 + # source://rspec-core/lib/rspec/core/configuration.rb#2284 def define_built_in_hooks; end - # source://rspec-core/lib/rspec/core/configuration.rb#2402 + # source://rspec-core/lib/rspec/core/configuration.rb#2407 def define_mixed_in_module(mod, filters, mod_list, config_method, &block); end - # source://rspec-core/lib/rspec/core/configuration.rb#2254 + # source://rspec-core/lib/rspec/core/configuration.rb#2259 def extract_location(path); end - # source://rspec-core/lib/rspec/core/configuration.rb#2231 + # source://rspec-core/lib/rspec/core/configuration.rb#2236 def file_glob_from(path, pattern); end - # source://rspec-core/lib/rspec/core/configuration.rb#2220 + # source://rspec-core/lib/rspec/core/configuration.rb#2225 def gather_directories(path); end - # source://rspec-core/lib/rspec/core/configuration.rb#2199 + # source://rspec-core/lib/rspec/core/configuration.rb#2204 def get_files_to_run(paths); end - # source://rspec-core/lib/rspec/core/configuration.rb#2226 + # source://rspec-core/lib/rspec/core/configuration.rb#2231 def get_matching_files(path, pattern); end - # source://rspec-core/lib/rspec/core/configuration.rb#2166 + # source://rspec-core/lib/rspec/core/configuration.rb#2171 def handle_suite_hook(scope, meta); end - # source://rspec-core/lib/rspec/core/configuration.rb#2138 + # source://rspec-core/lib/rspec/core/configuration.rb#2143 def load_file_handling_errors(method, file); end # @return [Boolean] # - # source://rspec-core/lib/rspec/core/configuration.rb#2372 + # source://rspec-core/lib/rspec/core/configuration.rb#2377 def metadata_applies_to_group?(meta, group); end - # source://rspec-core/lib/rspec/core/configuration.rb#2364 + # source://rspec-core/lib/rspec/core/configuration.rb#2369 def on_existing_matching_groups(meta); end # @return [Boolean] # - # source://rspec-core/lib/rspec/core/configuration.rb#2302 + # source://rspec-core/lib/rspec/core/configuration.rb#2307 def output_to_tty?(output = T.unsafe(nil)); end - # source://rspec-core/lib/rspec/core/configuration.rb#2298 + # source://rspec-core/lib/rspec/core/configuration.rb#2303 def output_wrapper; end - # source://rspec-core/lib/rspec/core/configuration.rb#2211 + # source://rspec-core/lib/rspec/core/configuration.rb#2216 def paths_to_check(paths); end # @return [Boolean] # - # source://rspec-core/lib/rspec/core/configuration.rb#2216 + # source://rspec-core/lib/rspec/core/configuration.rb#2221 def pattern_might_load_specs_from_vendored_dirs?; end # @return [Boolean] # - # source://rspec-core/lib/rspec/core/configuration.rb#2325 + # source://rspec-core/lib/rspec/core/configuration.rb#2330 def rspec_expectations_loaded?; end # @return [Boolean] # - # source://rspec-core/lib/rspec/core/configuration.rb#2321 + # source://rspec-core/lib/rspec/core/configuration.rb#2326 def rspec_mocks_loaded?; end - # source://rspec-core/lib/rspec/core/configuration.rb#2181 + # source://rspec-core/lib/rspec/core/configuration.rb#2186 def run_suite_hooks(hook_description, hooks); end - # source://rspec-core/lib/rspec/core/configuration.rb#2387 + # source://rspec-core/lib/rspec/core/configuration.rb#2392 def safe_extend(mod, host); end # :nocov: # - # source://rspec-core/lib/rspec/core/configuration.rb#2383 + # source://rspec-core/lib/rspec/core/configuration.rb#2388 def safe_include(mod, host); end - # source://rspec-core/lib/rspec/core/configuration.rb#2377 + # source://rspec-core/lib/rspec/core/configuration.rb#2382 def safe_prepend(mod, host); end - # source://rspec-core/lib/rspec/core/configuration.rb#2329 + # source://rspec-core/lib/rspec/core/configuration.rb#2334 def update_pattern_attr(name, value); end - # source://rspec-core/lib/rspec/core/configuration.rb#2275 + # source://rspec-core/lib/rspec/core/configuration.rb#2280 def value_for(key); end class << self @@ -2505,14 +2508,14 @@ class RSpec::Core::Configuration # @private # - # source://rspec-core/lib/rspec/core/configuration.rb#1666 + # source://rspec-core/lib/rspec/core/configuration.rb#1671 def delegate_to_ordering_manager(*methods); end end end # @private # -# source://rspec-core/lib/rspec/core/configuration.rb#1646 +# source://rspec-core/lib/rspec/core/configuration.rb#1651 RSpec::Core::Configuration::DEFAULT_FORMATTER = T.let(T.unsafe(nil), Proc) # This buffer is used to capture all messages sent to the reporter during @@ -2538,7 +2541,7 @@ end # @private # -# source://rspec-core/lib/rspec/core/configuration.rb#1816 +# source://rspec-core/lib/rspec/core/configuration.rb#1821 module RSpec::Core::Configuration::ExposeCurrentExample; end # @private @@ -2568,7 +2571,7 @@ RSpec::Core::Configuration::PENDING_STATUS = T.let(T.unsafe(nil), String) # @private # -# source://rspec-core/lib/rspec/core/configuration.rb#1765 +# source://rspec-core/lib/rspec/core/configuration.rb#1770 RSpec::Core::Configuration::RAISE_ERROR_WARNING_NOTIFIER = T.let(T.unsafe(nil), Proc) # Module that holds `attr_reader` declarations. It's in a separate @@ -2738,7 +2741,9 @@ class RSpec::Core::ConfigurationOptions # source://rspec-core/lib/rspec/core/configuration_options.rb#146 def custom_options; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#188 + # :nocov: + # + # source://rspec-core/lib/rspec/core/configuration_options.rb#190 def custom_options_file; end # source://rspec-core/lib/rspec/core/configuration_options.rb#133 @@ -2755,10 +2760,10 @@ class RSpec::Core::ConfigurationOptions # source://rspec-core/lib/rspec/core/configuration_options.rb#158 def global_options; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#200 + # source://rspec-core/lib/rspec/core/configuration_options.rb#202 def global_options_file; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#211 + # source://rspec-core/lib/rspec/core/configuration_options.rb#213 def home_options_file_path; end # source://rspec-core/lib/rspec/core/configuration_options.rb#121 @@ -2767,10 +2772,12 @@ class RSpec::Core::ConfigurationOptions # source://rspec-core/lib/rspec/core/configuration_options.rb#150 def local_options; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#196 + # source://rspec-core/lib/rspec/core/configuration_options.rb#198 def local_options_file; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#180 + # :nocov: + # + # source://rspec-core/lib/rspec/core/configuration_options.rb#181 def options_file_as_erb_string(path); end # source://rspec-core/lib/rspec/core/configuration_options.rb#162 @@ -2791,16 +2798,16 @@ class RSpec::Core::ConfigurationOptions # source://rspec-core/lib/rspec/core/configuration_options.rb#154 def project_options; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#192 + # source://rspec-core/lib/rspec/core/configuration_options.rb#194 def project_options_file; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#227 + # source://rspec-core/lib/rspec/core/configuration_options.rb#229 def resolve_xdg_config_home; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#204 + # source://rspec-core/lib/rspec/core/configuration_options.rb#206 def xdg_options_file_if_exists; end - # source://rspec-core/lib/rspec/core/configuration_options.rb#220 + # source://rspec-core/lib/rspec/core/configuration_options.rb#222 def xdg_options_file_path; end end @@ -2908,8 +2915,9 @@ class RSpec::Core::DidYouMean def initialize(relative_file_name); end # return a hint if API for ::DidYouMean::SpellChecker not supported + # :nocov: # - # source://rspec-core/lib/rspec/core/did_you_mean.rb#14 + # source://rspec-core/lib/rspec/core/did_you_mean.rb#15 def call; end # Returns the value of attribute relative_file_name. @@ -2919,13 +2927,15 @@ class RSpec::Core::DidYouMean private - # source://rspec-core/lib/rspec/core/did_you_mean.rb#30 + # :nocov: + # + # source://rspec-core/lib/rspec/core/did_you_mean.rb#35 def formats(probables); end - # source://rspec-core/lib/rspec/core/did_you_mean.rb#40 + # source://rspec-core/lib/rspec/core/did_you_mean.rb#45 def red_font(mytext); end - # source://rspec-core/lib/rspec/core/did_you_mean.rb#35 + # source://rspec-core/lib/rspec/core/did_you_mean.rb#40 def top_and_tail(rspec_format); end end @@ -5401,7 +5411,7 @@ class RSpec::Core::Formatters::ExceptionPresenter private - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#224 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#226 def add_shared_group_lines(lines, colorizer); end # Returns the value of attribute backtrace_formatter. @@ -5414,9 +5424,9 @@ class RSpec::Core::Formatters::ExceptionPresenter # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#12 def detail_formatter; end - # for 1.8.7 + # :nocov: # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#282 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#286 def encoded_description(description); end # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#120 @@ -5427,16 +5437,18 @@ class RSpec::Core::Formatters::ExceptionPresenter # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#116 def encoding_of(string); end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#292 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#298 def exception_backtrace; end # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#150 def exception_class_name(exception = T.unsafe(nil)); end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#202 + # :nocov: + # + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#204 def exception_lines; end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#184 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#185 def exception_message_string(exception); end # Returns the value of attribute extra_detail_formatter. @@ -5444,7 +5456,7 @@ class RSpec::Core::Formatters::ExceptionPresenter # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#12 def extra_detail_formatter; end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#213 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#215 def extra_failure_lines; end # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#156 @@ -5456,10 +5468,10 @@ class RSpec::Core::Formatters::ExceptionPresenter # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#104 def final_exception(exception, previous = T.unsafe(nil)); end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#258 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#262 def find_failed_line; end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#273 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#277 def formatted_message_and_backtrace(colorizer); end # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#134 @@ -5470,7 +5482,7 @@ class RSpec::Core::Formatters::ExceptionPresenter # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#12 def message_color; end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#234 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#236 def read_failed_lines; end end @@ -5481,49 +5493,49 @@ end # # @private # -# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#301 +# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#307 class RSpec::Core::Formatters::ExceptionPresenter::Factory # @return [Factory] a new instance of Factory # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#308 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#314 def initialize(example); end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#302 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#308 def build; end private - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#363 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#369 def multiple_exception_summarizer(exception, prior_detail_formatter, color); end # @return [Boolean] # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#359 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#365 def multiple_exceptions_error?(exception); end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#318 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#324 def options; end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#322 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#328 def pending_options; end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#384 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#390 def sub_failure_list_formatter(exception, message_color); end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#343 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#349 def with_multiple_error_options_as_needed(exception, options); end end # @private # -# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#417 +# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#423 class RSpec::Core::Formatters::ExceptionPresenter::Factory::CommonBacktraceTruncater # @return [CommonBacktraceTruncater] a new instance of CommonBacktraceTruncater # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#418 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#424 def initialize(parent); end - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#422 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#428 def with_truncated_backtrace(child); end end @@ -5532,17 +5544,17 @@ end # # @private # -# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#410 +# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#416 module RSpec::Core::Formatters::ExceptionPresenter::Factory::EmptyBacktraceFormatter class << self - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#411 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#417 def format_backtrace(*_arg0); end end end # @private # -# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#442 +# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#448 RSpec::Core::Formatters::ExceptionPresenter::PENDING_DETAIL_FORMATTER = T.let(T.unsafe(nil), Proc) # @private @@ -8171,57 +8183,57 @@ end # individual spec has multiple exceptions, such as one in the `it` block # and one in an `after` block. # -# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#452 +# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#458 class RSpec::Core::MultipleExceptionError < ::StandardError include ::RSpec::Core::MultipleExceptionError::InterfaceTag # @param exceptions [Array] The initial list of exceptions. # @return [MultipleExceptionError] a new instance of MultipleExceptionError # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#513 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#519 def initialize(*exceptions); end # @return [nil] Provided only for interface compatibility with # `RSpec::Expectations::MultipleExpectationsNotMetError`. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#510 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#516 def aggregation_block_label; end # @return [Hash] Metadata used by RSpec for formatting purposes. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#506 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#512 def aggregation_metadata; end # @return [Array] The list of failures and other exceptions, combined. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#503 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#509 def all_exceptions; end # return [String] A description of the failure/error counts. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#538 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#544 def exception_count_description; end # @return [Array] The list of failures. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#497 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#503 def failures; end # @note RSpec does not actually use this -- instead it formats each exception # individually. # @return [String] Combines all the exception messages into a single string. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#528 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#534 def message; end # @return [Array] The list of other errors. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#500 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#506 def other_errors; end # @return [String] A summary of the failure, including the block label and a count of failures. # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#533 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#539 def summary; end end @@ -8232,14 +8244,14 @@ end # # @private # -# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#458 +# source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#464 module RSpec::Core::MultipleExceptionError::InterfaceTag # Appends the provided exception to the list. # # @param exception [Exception] Exception to append to the list. # @private # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#462 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#468 def add(exception); end class << self @@ -8249,7 +8261,7 @@ module RSpec::Core::MultipleExceptionError::InterfaceTag # # @private # - # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#488 + # source://rspec-core/lib/rspec/core/formatters/exception_presenter.rb#494 def for(ex); end end end @@ -9450,16 +9462,16 @@ class RSpec::Core::Parser private - # source://rspec-core/lib/rspec/core/option_parser.rb#310 + # source://rspec-core/lib/rspec/core/option_parser.rb#312 def add_tag_filter(options, filter_type, tag_name, value = T.unsafe(nil)); end - # source://rspec-core/lib/rspec/core/option_parser.rb#318 + # source://rspec-core/lib/rspec/core/option_parser.rb#320 def configure_only_failures(options); end # source://rspec-core/lib/rspec/core/option_parser.rb#39 def parser(options); end - # source://rspec-core/lib/rspec/core/option_parser.rb#314 + # source://rspec-core/lib/rspec/core/option_parser.rb#316 def set_fail_fast(options, value); end class << self diff --git a/sorbet/rbi/gems/rubocop-ast@1.32.3.rbi b/sorbet/rbi/gems/rubocop-ast@1.33.0.rbi similarity index 96% rename from sorbet/rbi/gems/rubocop-ast@1.32.3.rbi rename to sorbet/rbi/gems/rubocop-ast@1.33.0.rbi index c438aaa..690ffec 100644 --- a/sorbet/rbi/gems/rubocop-ast@1.32.3.rbi +++ b/sorbet/rbi/gems/rubocop-ast@1.33.0.rbi @@ -443,18 +443,18 @@ class RuboCop::AST::Builder < ::Parser::Builders::Default # # @return [Node] the generated node # - # source://rubocop-ast/lib/rubocop/ast/builder.rb#99 + # source://rubocop-ast/lib/rubocop/ast/builder.rb#105 def n(type, children, source_map); end # TODO: Figure out what to do about literal encoding handling... # More details here https://github.com/whitequark/parser/issues/283 # - # source://rubocop-ast/lib/rubocop/ast/builder.rb#105 + # source://rubocop-ast/lib/rubocop/ast/builder.rb#111 def string_value(token); end private - # source://rubocop-ast/lib/rubocop/ast/builder.rb#111 + # source://rubocop-ast/lib/rubocop/ast/builder.rb#117 def node_klass(type); end end @@ -574,26 +574,17 @@ end # # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#8 class RuboCop::AST::CasgnNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConstantNode + # The expression being assigned to the variable. # # @return [Node] the expression being assigned. # - # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#26 + # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#16 def expression; end - # The name of the variable being assigned as a symbol. - # - # @return [Symbol] the name of the variable being assigned - # - # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#19 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#14 def name; end - - # The namespace of the constant being assigned. - # - # @return [Node, nil] the node associated with the scope (e.g. cbase, const, ...) - # - # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#12 - def namespace; end end # A node extension for `class` nodes. This will be used in place of a plain @@ -1084,16 +1075,24 @@ end # # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#6 class RuboCop::AST::ConstNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConstantNode +end + +# Common functionality for nodes that deal with constants: +# `const`, `casgn`. +# +# source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#7 +module RuboCop::AST::ConstantNode # @return [Boolean] if the constant starts with `::` (aka s(:cbase)) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#26 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#27 def absolute?; end # @return [Boolean] if the constant is a Module / Class, according to the standard convention. # Note: some classes might have uppercase in which case this method # returns false # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#20 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#21 def class_name?; end # Yield nodes for the namespace @@ -1103,29 +1102,29 @@ class RuboCop::AST::ConstNode < ::RuboCop::AST::Node # s(:const, :Foo), then # s(:const, s(:const, :Foo), :Bar) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#43 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#44 def each_path(&block); end # @return [Boolean] if the constant is a Module / Class, according to the standard convention. # Note: some classes might have uppercase in which case this method # returns false # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#20 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#21 def module_name?; end # @return [Node, nil] the node associated with the scope (e.g. cbase, const, ...) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#8 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#9 def namespace; end # @return [Boolean] if the constant does not start with `::` (aka s(:cbase)) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#33 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#34 def relative?; end # @return [Symbol] the demodulized name of the constant: "::Foo::Bar" => :Bar # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#13 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#14 def short_name; end end @@ -2046,6 +2045,71 @@ class RuboCop::AST::LambdaNode < ::RuboCop::AST::Node def first_argument_index; end end +# A node extension for `masgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#8 +class RuboCop::AST::MasgnNode < ::RuboCop::AST::Node + # @return [Array] the assignment nodes of the multiple assignment + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#16 + def assignments; end + + # The RHS (right hand side) of the multiple assignment. This returns + # the nodes as parsed: either a single node if the RHS has a single value, + # or an `array` node containing multiple nodes. + # + # NOTE: Due to how parsing works, `expression` will return the same for + # `a, b = x, y` and `a, b = [x, y]`. + # + # @return [Node] the right hand side of a multiple assignment. + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#39 + def expression; end + + # @return [MlhsNode] the `mlhs` node + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#10 + def lhs; end + + # @return [Array] names of all the variables being assigned + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#21 + def names; end + + # The RHS (right hand side) of the multiple assignment. This returns + # the nodes as parsed: either a single node if the RHS has a single value, + # or an `array` node containing multiple nodes. + # + # NOTE: Due to how parsing works, `expression` will return the same for + # `a, b = x, y` and `a, b = [x, y]`. + # + # @return [Node] the right hand side of a multiple assignment. + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#39 + def rhs; end + + # In contrast to `expression`, `values` always returns a Ruby array + # containing all the nodes being assigned on the RHS. + # + # Literal arrays are considered a singular value; but unlike `expression`, + # implied `array` nodes from assigning multiple values on the RHS are treated + # as separate. + # + # @return [Array] individual values being assigned on the RHS of the multiple assignment + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#52 + def values; end + + private + + # @return [Boolean] + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#58 + def multiple_rhs?; end +end + # Common functionality for nodes that are a kind of method dispatch: # `send`, `csend`, `super`, `zsuper`, `yield`, `defined?`, # and (modern only): `index`, `indexasgn`, `lambda` @@ -2478,6 +2542,22 @@ RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_UNARY_OPERATOR_METHODS = T # source://rubocop-ast/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb#20 RuboCop::AST::MethodIdentifierPredicates::OPERATOR_METHODS = T.let(T.unsafe(nil), Set) +# A node extension for `mlhs` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# source://rubocop-ast/lib/rubocop/ast/node/mlhs_node.rb#8 +class RuboCop::AST::MlhsNode < ::RuboCop::AST::Node + # Returns all the assignment nodes on the left hand side (LHS) of a multiple assignment. + # These are generally assignment nodes (`lvasgn`, `ivasgn`, `cvasgn`, `gvasgn`, `casgn`) + # but can also be `send` nodes in case of `foo.bar, ... =` or `foo[:bar], ... =`. + # + # @return [Array] the assignment nodes of the multiple assignment LHS + # + # source://rubocop-ast/lib/rubocop/ast/node/mlhs_node.rb#14 + def assignments; end +end + # Common functionality for nodes that can be used as modifiers: # `if`, `while`, `until` # @@ -4459,7 +4539,7 @@ class RuboCop::AST::NodePattern::LexerRex # The current location in the parse. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#104 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#103 def location; end # The StringScanner for this lexer. @@ -4474,22 +4554,22 @@ class RuboCop::AST::NodePattern::LexerRex # Lex the next token. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#113 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#112 def next_token; end # Parse the given string. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#84 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#83 def parse(str); end # Read in and parse the file at +path+. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#94 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#93 def parse_file(path); end # The current scanner class. Must be overridden in subclasses. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#77 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#76 def scanner_class; end # The StringScanner for this lexer. @@ -4863,116 +4943,116 @@ class RuboCop::AST::NodePattern::Parser < ::Racc::Parser # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.rb#19 def initialize(builder = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#333 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#335 def _reduce_10(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#337 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#339 def _reduce_11(val, _values); end # reduce 12 omitted # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#343 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#345 def _reduce_13(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#347 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#349 def _reduce_14(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#351 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#353 def _reduce_15(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#355 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#357 def _reduce_16(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#359 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#361 def _reduce_17(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#363 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#365 def _reduce_18(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#367 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#369 def _reduce_19(val, _values); end # reduce 1 omitted # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#301 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#303 def _reduce_2(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#371 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#373 def _reduce_20(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#375 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#377 def _reduce_21(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#379 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#381 def _reduce_22(val, _values); end # reduce 24 omitted # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#387 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#389 def _reduce_25(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#393 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#395 def _reduce_26(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#305 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#307 def _reduce_3(val, _values); end # reduce 32 omitted # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#413 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#415 def _reduce_33(val, _values); end # reduce 36 omitted # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#423 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#425 def _reduce_37(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#427 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#429 def _reduce_38(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#431 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#433 def _reduce_39(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#309 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#311 def _reduce_4(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#435 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#437 def _reduce_40(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#439 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#441 def _reduce_41(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#443 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#445 def _reduce_42(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#447 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#449 def _reduce_43(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#451 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#453 def _reduce_44(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#455 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#457 def _reduce_45(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#459 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#461 def _reduce_46(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#313 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#315 def _reduce_5(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#317 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#319 def _reduce_6(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#321 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#323 def _reduce_7(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#325 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#327 def _reduce_8(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#329 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#331 def _reduce_9(val, _values); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#463 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#465 def _reduce_none(val, _values); end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -5032,10 +5112,10 @@ RuboCop::AST::NodePattern::Parser::Lexer = RuboCop::AST::NodePattern::Lexer # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#227 RuboCop::AST::NodePattern::Parser::Racc_arg = T.let(T.unsafe(nil), Array) -# source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#293 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#295 RuboCop::AST::NodePattern::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) -# source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#243 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#244 RuboCop::AST::NodePattern::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) # Overrides Parser to use `WithMeta` variants and provide additional methods @@ -5322,7 +5402,7 @@ RuboCop::AST::NodePattern::Sets::SET_READ_BINREAD = T.let(T.unsafe(nil), Set) RuboCop::AST::NodePattern::Sets::SET_REDUCE_INJECT = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 -RuboCop::AST::NodePattern::Sets::SET_REJECT_DELETE_IF_REJECT = T.let(T.unsafe(nil), Set) +RuboCop::AST::NodePattern::Sets::SET_REJECT_REJECT = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(nil), Set) @@ -5331,7 +5411,7 @@ RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(n RuboCop::AST::NodePattern::Sets::SET_SELECT_FILTER_FIND_ALL = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 -RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT = T.let(T.unsafe(nil), Set) +RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT_FILTER_FILTER = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_SEND_PUBLIC_SEND___SEND__ = T.let(T.unsafe(nil), Set) @@ -6975,6 +7055,18 @@ class RuboCop::AST::UntilNode < ::RuboCop::AST::Node def keyword; end end +# A node extension for `lvar`, `ivar`, `cvar` and `gvar` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# source://rubocop-ast/lib/rubocop/ast/node/var_node.rb#8 +class RuboCop::AST::VarNode < ::RuboCop::AST::Node + # @return [Symbol] The name of the variable. + # + # source://rubocop-ast/lib/rubocop/ast/node/var_node.rb#10 + def name; end +end + # source://rubocop-ast/lib/rubocop/ast/version.rb#5 module RuboCop::AST::Version; end @@ -7076,28 +7168,28 @@ class RuboCop::AST::YieldNode < ::RuboCop::AST::Node end class RuboCop::CommentConfig - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#34 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#34 def initialize(processed_source); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#63 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#63 def comment_only_line?(line_number); end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def config(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#51 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#51 def cop_disabled_line_ranges; end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#39 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#39 def cop_enabled_at_line?(cop, line_number); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#47 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#47 def cop_opted_in?(cop); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#55 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#55 def extra_enabled_comments; end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#30 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#30 def processed_source; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7105,51 +7197,51 @@ class RuboCop::CommentConfig private - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#96 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#96 def analyze; end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#124 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#124 def analyze_cop(analysis, directive); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#144 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#144 def analyze_disabled(analysis, directive); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#155 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#155 def analyze_rest(analysis, directive); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#135 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#135 def analyze_single_line(analysis, directive); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#164 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#164 def cop_line_ranges(analysis); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#170 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#170 def each_directive; end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#69 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#69 def extra_enabled_comments_with_names(extras:, names:); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#190 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#190 def handle_enable_all(directive, names, extras); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#204 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#204 def handle_switch(directive, names, extras); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#115 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#115 def inject_disabled_cops_directives(analyses); end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#183 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#183 def non_comment_token_line_numbers; end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#83 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#83 def opt_in_cops; end - # source://rubocop/1.66.1lib/rubocop/comment_config.rb#179 + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#179 def qualified_cop_name(cop_name); end end class RuboCop::Config - # source://rubocop/1.66.1lib/rubocop/config.rb#30 + # source://rubocop/1.68.0lib/rubocop/config.rb#30 def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7158,37 +7250,37 @@ class RuboCop::Config # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def []=(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#170 + # source://rubocop/1.68.0lib/rubocop/config.rb#170 def active_support_extensions_enabled?; end - # source://rubocop/1.66.1lib/rubocop/config.rb#96 + # source://rubocop/1.68.0lib/rubocop/config.rb#96 def add_excludes_from_higher_level(highest_config); end - # source://rubocop/1.66.1lib/rubocop/config.rb#197 + # source://rubocop/1.68.0lib/rubocop/config.rb#197 def allowed_camel_case_file?(file); end - # source://rubocop/1.66.1lib/rubocop/config.rb#241 + # source://rubocop/1.68.0lib/rubocop/config.rb#241 def base_dir_for_path_parameters; end - # source://rubocop/1.66.1lib/rubocop/config.rb#271 + # source://rubocop/1.68.0lib/rubocop/config.rb#271 def bundler_lock_file_path; end - # source://rubocop/1.66.1lib/rubocop/config.rb#51 + # source://rubocop/1.68.0lib/rubocop/config.rb#51 def check; end - # source://rubocop/1.66.1lib/rubocop/config.rb#142 + # source://rubocop/1.68.0lib/rubocop/config.rb#142 def clusivity_config_for_badge?(badge); end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def delete(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#108 + # source://rubocop/1.68.0lib/rubocop/config.rb#108 def deprecation_check; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def dig(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#162 + # source://rubocop/1.68.0lib/rubocop/config.rb#162 def disabled_new_cops?; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7197,37 +7289,37 @@ class RuboCop::Config # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def each_key(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#166 + # source://rubocop/1.68.0lib/rubocop/config.rb#166 def enabled_new_cops?; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def fetch(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#219 + # source://rubocop/1.68.0lib/rubocop/config.rb#219 def file_to_exclude?(file); end - # source://rubocop/1.66.1lib/rubocop/config.rb#178 + # source://rubocop/1.68.0lib/rubocop/config.rb#178 def file_to_include?(file); end - # source://rubocop/1.66.1lib/rubocop/config.rb#158 + # source://rubocop/1.68.0lib/rubocop/config.rb#158 def for_all_cops; end - # source://rubocop/1.66.1lib/rubocop/config.rb#128 + # source://rubocop/1.68.0lib/rubocop/config.rb#128 def for_badge(badge); end - # source://rubocop/1.66.1lib/rubocop/config.rb#122 + # source://rubocop/1.68.0lib/rubocop/config.rb#122 def for_cop(cop); end - # source://rubocop/1.66.1lib/rubocop/config.rb#153 + # source://rubocop/1.68.0lib/rubocop/config.rb#153 def for_department(department_name); end - # source://rubocop/1.66.1lib/rubocop/config.rb#296 + # source://rubocop/1.68.0lib/rubocop/config.rb#296 def gem_versions_in_target; end - # source://rubocop/1.66.1lib/rubocop/config.rb#300 + # source://rubocop/1.68.0lib/rubocop/config.rb#300 def inspect; end - # source://rubocop/1.66.1lib/rubocop/config.rb#76 + # source://rubocop/1.68.0lib/rubocop/config.rb#76 def internal?; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7236,13 +7328,13 @@ class RuboCop::Config # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def keys(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#47 + # source://rubocop/1.68.0lib/rubocop/config.rb#47 def loaded_features; end - # source://rubocop/1.66.1lib/rubocop/config.rb#20 + # source://rubocop/1.68.0lib/rubocop/config.rb#20 def loaded_path; end - # source://rubocop/1.66.1lib/rubocop/config.rb#81 + # source://rubocop/1.68.0lib/rubocop/config.rb#81 def make_excludes_absolute; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7251,37 +7343,37 @@ class RuboCop::Config # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def merge(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#251 + # source://rubocop/1.68.0lib/rubocop/config.rb#251 def parser_engine; end - # source://rubocop/1.66.1lib/rubocop/config.rb#232 + # source://rubocop/1.68.0lib/rubocop/config.rb#232 def path_relative_to_config(path); end - # source://rubocop/1.66.1lib/rubocop/config.rb#228 + # source://rubocop/1.68.0lib/rubocop/config.rb#228 def patterns_to_exclude; end - # source://rubocop/1.66.1lib/rubocop/config.rb#224 + # source://rubocop/1.68.0lib/rubocop/config.rb#224 def patterns_to_include; end - # source://rubocop/1.66.1lib/rubocop/config.rb#282 + # source://rubocop/1.68.0lib/rubocop/config.rb#282 def pending_cops; end - # source://rubocop/1.66.1lib/rubocop/config.rb#211 + # source://rubocop/1.68.0lib/rubocop/config.rb#211 def possibly_include_hidden?; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def replace(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#71 + # source://rubocop/1.68.0lib/rubocop/config.rb#71 def signature; end - # source://rubocop/1.66.1lib/rubocop/config.rb#266 + # source://rubocop/1.68.0lib/rubocop/config.rb#266 def smart_loaded_path; end - # source://rubocop/1.66.1lib/rubocop/config.rb#174 + # source://rubocop/1.68.0lib/rubocop/config.rb#174 def string_literals_frozen_by_default?; end - # source://rubocop/1.66.1lib/rubocop/config.rb#255 + # source://rubocop/1.68.0lib/rubocop/config.rb#255 def target_rails_version; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7293,7 +7385,7 @@ class RuboCop::Config # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def to_hash(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#67 + # source://rubocop/1.68.0lib/rubocop/config.rb#67 def to_s; end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7302,37 +7394,37 @@ class RuboCop::Config # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def validate(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config.rb#58 + # source://rubocop/1.68.0lib/rubocop/config.rb#58 def validate_after_resolution; end private - # source://rubocop/1.66.1lib/rubocop/config.rb#350 + # source://rubocop/1.68.0lib/rubocop/config.rb#350 def department_of(qualified_cop_name); end - # source://rubocop/1.66.1lib/rubocop/config.rb#338 + # source://rubocop/1.68.0lib/rubocop/config.rb#338 def enable_cop?(qualified_cop_name, cop_options); end - # source://rubocop/1.66.1lib/rubocop/config.rb#325 + # source://rubocop/1.68.0lib/rubocop/config.rb#325 def gem_version_to_major_minor_float(gem_version); end - # source://rubocop/1.66.1lib/rubocop/config.rb#331 + # source://rubocop/1.68.0lib/rubocop/config.rb#331 def read_gem_versions_from_target_lockfile; end - # source://rubocop/1.66.1lib/rubocop/config.rb#312 + # source://rubocop/1.68.0lib/rubocop/config.rb#312 def read_rails_version_from_bundler_lock_file; end - # source://rubocop/1.66.1lib/rubocop/config.rb#307 + # source://rubocop/1.68.0lib/rubocop/config.rb#307 def target_rails_version_from_bundler_lock_file; end class << self - # source://rubocop/1.66.1lib/rubocop/config.rb#22 + # source://rubocop/1.68.0lib/rubocop/config.rb#22 def create(hash, path, check: T.unsafe(nil)); end end end class RuboCop::ConfigValidator - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#26 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#27 def initialize(config); end # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 @@ -7341,66 +7433,66 @@ class RuboCop::ConfigValidator # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def smart_loaded_path(*_arg0, **_arg1, &_arg2); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#62 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#63 def target_ruby_version; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#32 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#33 def validate; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#58 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#59 def validate_after_resolution; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#66 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#67 def validate_section_presence(name); end private - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#103 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#104 def alert_about_unrecognized_cops(invalid_cop_names); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#253 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#254 def check_cop_config_value(hash, parent = T.unsafe(nil)); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#76 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#77 def check_obsoletions; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#83 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#84 def check_target_ruby; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#194 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#195 def each_invalid_parameter(cop_name); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#119 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#120 def list_unknown_cops(invalid_cop_names); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#273 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#274 def param_error_message(parent, key, value, supposed_values); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#241 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#242 def reject_conflicting_safe_settings; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#232 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#233 def reject_mutually_exclusive_defaults; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#141 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#142 def suggestion(name); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#74 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#75 def target_ruby; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#206 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#207 def validate_enforced_styles(valid_cop_names); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#168 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#169 def validate_new_cops_parameter; end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#179 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#180 def validate_parameter_names(valid_cop_names); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#226 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#227 def validate_support_and_has_list(name, formats, valid); end - # source://rubocop/1.66.1lib/rubocop/config_validator.rb#157 + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#158 def validate_syntax_cop; end end diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.8.6.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi similarity index 100% rename from sorbet/rbi/gems/rubocop-sorbet@0.8.6.rbi rename to sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi diff --git a/sorbet/rbi/gems/rubocop@1.67.0.rbi b/sorbet/rbi/gems/rubocop@1.68.0.rbi similarity index 98% rename from sorbet/rbi/gems/rubocop@1.67.0.rbi rename to sorbet/rbi/gems/rubocop@1.68.0.rbi index 893be8c..ce6f4ef 100644 --- a/sorbet/rbi/gems/rubocop@1.67.0.rbi +++ b/sorbet/rbi/gems/rubocop@1.68.0.rbi @@ -741,8 +741,8 @@ class RuboCop::CachedData # @api private # - # source://rubocop/lib/rubocop/cached_data.rb#56 - def location_from_source_buffer(offense, source_buffer); end + # source://rubocop/lib/rubocop/cached_data.rb#54 + def location_from_source_buffer(offense); end # @api private # @@ -753,6 +753,15 @@ class RuboCop::CachedData # # source://rubocop/lib/rubocop/cached_data.rb#23 def serialize_offense(offense); end + + # Delay creation until needed. Some type of offenses will have no buffer associated with them + # and be global only. For these, trying to create the buffer will likely fail, for example + # because of unknown encoding comments. + # + # @api private + # + # source://rubocop/lib/rubocop/cached_data.rb#67 + def source_buffer; end end # and provides a way to check if each cop is enabled at arbitrary line. @@ -771,7 +780,7 @@ class RuboCop::CommentConfig # source://rubocop/lib/rubocop/comment_config.rb#63 def comment_only_line?(line_number); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def config(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/comment_config.rb#51 @@ -795,7 +804,7 @@ class RuboCop::CommentConfig # source://rubocop/lib/rubocop/comment_config.rb#30 def processed_source; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def registry(*_arg0, **_arg1, &_arg2); end private @@ -971,10 +980,10 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#30 def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def [](*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def []=(*_arg0, **_arg1, &_arg2); end # @return [Boolean] @@ -1013,13 +1022,13 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#142 def clusivity_config_for_badge?(badge); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def delete(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#108 def deprecation_check; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def dig(*_arg0, **_arg1, &_arg2); end # @return [Boolean] @@ -1027,10 +1036,10 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#162 def disabled_new_cops?; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def each(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def each_key(*_arg0, **_arg1, &_arg2); end # @return [Boolean] @@ -1038,7 +1047,7 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#166 def enabled_new_cops?; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def fetch(*_arg0, **_arg1, &_arg2); end # @return [Boolean] @@ -1092,10 +1101,10 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#76 def internal?; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def key?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def keys(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#47 @@ -1109,10 +1118,10 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#81 def make_excludes_absolute; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def map(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def merge(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#251 @@ -1138,7 +1147,7 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#211 def possibly_include_hidden?; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def replace(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#71 @@ -1155,22 +1164,22 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#255 def target_rails_version; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def target_ruby_version(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def to_h(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def to_hash(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#67 def to_s; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def transform_values(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def validate(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#58 @@ -2263,10 +2272,10 @@ class RuboCop::ConfigValidator # source://rubocop/lib/rubocop/config_validator.rb#27 def initialize(config); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def for_all_cops(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def smart_loaded_path(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config_validator.rb#63 @@ -2460,7 +2469,7 @@ class RuboCop::Cop::AlignmentCorrector private - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#124 + # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#113 def alignment_column(align_to); end # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#40 @@ -2485,7 +2494,7 @@ class RuboCop::Cop::AlignmentCorrector # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#75 def delimited_string_literal?(node); end - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#110 + # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#99 def each_line(expr); end # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#60 @@ -2494,10 +2503,7 @@ class RuboCop::Cop::AlignmentCorrector # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#54 def inside_string_ranges(node); end - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#99 - def remove(range, corrector); end - - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#118 + # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#107 def whitespace_range(node); end end end @@ -2798,31 +2804,44 @@ module RuboCop::Cop::AutocorrectLogic # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#51 def disable_offense(offense_range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#118 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#138 def disable_offense_at_end_of_line(range, eol_comment); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#122 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#142 def disable_offense_before_and_after(range_by_lines); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#61 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#63 def disable_offense_with_eol_or_surround_comment(range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#114 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#134 def max_line_length; end # Expand the given range to include all of any lines it covers. Does not # include newline at end of the last line. # - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#104 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#124 def range_by_lines(range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#95 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#115 def range_of_first_line(range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#72 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#107 + def range_overlaps_offense?(offense_range, range); end + + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#97 + def string_continuation(offense_range); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#111 + def string_continuation?(node); end + + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#74 def surrounding_heredoc(offense_range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#83 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#85 def surrounding_percent_array(offense_range); end end @@ -4084,64 +4103,69 @@ module RuboCop::Cop::CheckLineBreakable # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#200 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#202 def all_on_same_line?(nodes); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#220 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#222 def already_on_multiple_lines?(node); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#133 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#135 def breakable_collection?(node, elements); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#228 + def chained_to_heredoc?(node); end + # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#187 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#189 def children_could_be_broken_up?(children); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#150 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#152 def contained_by_breakable_collection_on_same_line?(node); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#170 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#172 def contained_by_multiline_collection_that_could_be_broken_up?(node); end # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#60 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#62 def extract_breakable_node_from_elements(node, elements, max); end # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#72 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#74 def extract_first_element_over_column_limit(node, elements, max); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#92 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#94 def first_argument_is_heredoc?(node); end # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#207 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#209 def process_args(args); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#117 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#119 def safe_to_ignore?(node); end # If a send node contains a heredoc argument, splitting cannot happen @@ -4149,13 +4173,13 @@ module RuboCop::Cop::CheckLineBreakable # # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#101 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#103 def shift_elements_for_heredoc_arg(node, elements, index); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#112 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#114 def within_column_limit?(element, max, line); end end @@ -5102,7 +5126,7 @@ class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter # Legacy # - # source://parser/3.3.5.0lib/parser/source/tree_rewriter.rb#252 + # source://parser/3.3.5.1lib/parser/source/tree_rewriter.rb#252 def rewrite; end # Swaps sources at the given ranges. @@ -5447,6 +5471,19 @@ end # source://rubocop/lib/rubocop/cop/mixin/end_keyword_alignment.rb#10 RuboCop::Cop::EndKeywordAlignment::MSG = T.let(T.unsafe(nil), String) +# Common functionality for rewriting endless methods to normal method definitions +# +# source://rubocop/lib/rubocop/cop/mixin/endless_method_rewriter.rb#6 +module RuboCop::Cop::EndlessMethodRewriter + # source://rubocop/lib/rubocop/cop/mixin/endless_method_rewriter.rb#7 + def correct_to_multiline(corrector, node); end + + private + + # source://rubocop/lib/rubocop/cop/mixin/endless_method_rewriter.rb#19 + def arguments(node, missing = T.unsafe(nil)); end +end + # Common functionality for enforcing a specific superclass. # # IMPORTANT: RuboCop core depended on this module when it supported Rails department. @@ -5618,7 +5655,7 @@ end module RuboCop::Cop::FrozenStringLiteral private - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#35 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#37 def frozen_heredoc?(node); end # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#21 @@ -5627,22 +5664,22 @@ module RuboCop::Cop::FrozenStringLiteral # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#15 def frozen_string_literal_comment_exists?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#76 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#78 def frozen_string_literal_specified?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#70 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#72 def frozen_string_literals_disabled?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#42 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#44 def frozen_string_literals_enabled?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#86 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#88 def leading_comment_lines; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#82 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#84 def leading_magic_comments; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#35 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#37 def uninterpolated_heredoc?(node); end # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#31 @@ -12413,13 +12450,15 @@ RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) # `#:nodoc`, `=begin`- and `=end` comments, "shebang" directives, # or rackup options. # -# @example -# -# # bad -# #Some comment +# @example AllowSteepAnnotation: true # # # good -# # Some comment +# +# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] +# list << n +# end +# +# name = 'John' #: String # @example AllowDoxygenCommentStyle: false (default) # # # bad @@ -12464,82 +12503,107 @@ RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) # # attr_reader :name #: String # attr_reader :age #: Integer? +# @example AllowSteepAnnotation: false (default) +# +# # bad +# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] +# list << n +# end # -# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#70 +# name = 'John' #: String +# @example +# +# # bad +# #Some comment +# +# # good +# # Some comment +# +# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#89 class RuboCop::Cop::Layout::LeadingCommentSpace < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#76 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#95 def on_new_investigation; end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#114 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#134 def allow_doxygen_comment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#122 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#142 def allow_gemfile_ruby_comment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#138 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#158 def allow_rbs_inline_annotation?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#98 - def allowed_on_first_line?(comment); end + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#166 + def allow_steep_annotation?; end # @return [Boolean] # # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#118 + def allowed_on_first_line?(comment); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#138 def doxygen_comment_style?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#126 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#146 def gemfile?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#134 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#154 def gemfile_ruby_comment?(comment); end - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#94 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#114 def hash_mark(expr); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#110 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#130 def rackup_config_file?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#106 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#126 def rackup_options?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#142 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#162 def rbs_inline_annotation?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#130 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#150 def ruby_comment_in_gemfile?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#102 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#122 def shebang?(comment); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#170 + def steep_annotation?(comment); end end -# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#74 +# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#93 RuboCop::Cop::Layout::LeadingCommentSpace::MSG = T.let(T.unsafe(nil), String) # Checks for unnecessary leading blank lines at the beginning @@ -15872,67 +15936,72 @@ class RuboCop::Cop::Layout::SpaceInsideBlockBraces < ::RuboCop::Cop::Base include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#85 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#89 def on_block(node); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#85 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#89 def on_numblock(node); end private - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#122 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#126 def adjacent_braces(left_brace, right_brace); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#161 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#165 def aligned_braces?(inner, right_brace, column); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#130 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#134 def braces_with_contents_inside(node, inner); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#105 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#109 def check_inside(node, left_brace, right_brace); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#137 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#141 def check_left_brace(inner, left_brace, args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#145 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#149 def check_right_brace(node, inner, left_brace, right_brace, single_line); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#165 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#169 def inner_last_space_count(inner); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#157 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#161 def multiline_block?(left_brace, right_brace); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#222 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#226 def no_space(begin_pos, end_pos, msg); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#169 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#173 def no_space_inside_left_brace(left_brace, args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#238 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#242 def offense(begin_pos, end_pos, msg, style_param = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#201 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#205 def pipe?(args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#230 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#234 def space(begin_pos, end_pos, msg); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#186 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#190 def space_inside_left_brace(left_brace, args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#205 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#209 def space_inside_right_brace(inner, right_brace, column); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#253 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#257 def style_for_empty_braces; end + + class << self + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#85 + def autocorrect_incompatible_with; end + end end # Checks that braces used for hash literals have or don't have @@ -17889,6 +17958,9 @@ RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil # With `IgnoreConstantBranches: true`, branches are not registered # as offenses if they return a constant value. # +# With `IgnoreDuplicateElseBranch: true`, in conditionals with multiple branches, +# duplicate 'else' branches are not registered as offenses. +# # @example # # bad # if foo @@ -17954,59 +18026,78 @@ RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil # when "large" then LARGE_SIZE # else MEDIUM_SIZE # end +# @example IgnoreDuplicateElseBranch: true +# # good +# if foo +# do_foo +# elsif bar +# do_bar +# else +# do_foo +# end # -# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#86 +# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#99 class RuboCop::Cop::Lint::DuplicateBranch < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_branching_statement(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_case(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_case_match(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#114 def on_if(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_rescue(node); end private - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#117 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#136 def branches(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#121 - def consider_branch?(branch); end + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#140 + def consider_branch?(branches, branch); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#147 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#174 def const_branch?(branch); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#132 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#178 + def duplicate_else_branch?(branches, branch); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#155 def ignore_constant_branches?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#128 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#159 + def ignore_duplicate_else_branches?; end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#151 def ignore_literal_branches?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#136 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#163 def literal_branch?(branch); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#103 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#122 def offense_range(duplicate_branch); end end -# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#87 +# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#100 RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String) # Checks that there are no repeated conditions @@ -21066,17 +21157,17 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#151 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#152 def force_method?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#159 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#166 def force_method_name?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#155 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#162 def force_option?(node); end # @return [Boolean] @@ -21093,8 +21184,13 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#101 def register_offense(node, exist_node); end - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#139 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#140 def replacement_method(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#156 + def require_mode_keyword?(node); end end # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#50 @@ -23060,25 +23156,30 @@ class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base # @param send_node [RuboCop::AST::SendNode] # @return [String] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#58 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#67 def add_safe_navigation_operator(offense_range:, send_node:); end # @param corrector [RuboCop::Cop::Corrector] # @param offense_range [Parser::Source::Range] # @param send_node [RuboCop::AST::SendNode] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#77 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#86 def autocorrect(corrector, offense_range:, send_node:); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#86 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#95 def brackets?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#90 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#99 def require_parentheses?(send_node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#57 + def require_safe_navigation?(node); end end # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#29 @@ -23147,31 +23248,31 @@ class RuboCop::Cop::Lint::SafeNavigationConsistency < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#83 def find_consistent_parts(grouped_operands); end - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#120 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#122 def most_left_indices(grouped_operands); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#150 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#152 def nilable?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#134 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#136 def operand_in_and?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#142 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#144 def operand_in_or?(node); end - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#111 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#113 def operand_nodes(operand, operand_nodes); end # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#74 def receiver_name_as_key(method, fully_receivers); end - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#100 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#102 def register_offense(operand, dot_operator); end end @@ -24268,6 +24369,58 @@ end # source://rubocop/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#44 RuboCop::Cop::Lint::UnderscorePrefixedVariableName::MSG = T.let(T.unsafe(nil), String) +# Checks for Regexpes (both literals and via `Regexp.new` / `Regexp.compile`) +# that contain unescaped `]` characters. +# +# It emulates the following Ruby warning: +# +# [source,ruby] +# ---- +# $ ruby -e '/abc]123/' +# -e:1: warning: regular expression has ']' without escape: /abc]123/ +# ---- +# +# @example +# # bad +# /abc]123/ +# %r{abc]123} +# Regexp.new('abc]123') +# Regexp.compile('abc]123') +# +# # good +# /abc\]123/ +# %r{abc\]123} +# Regexp.new('abc\]123') +# Regexp.compile('abc\]123') +# +# source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#30 +class RuboCop::Cop::Lint::UnescapedBracketInRegexp < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#45 + def on_regexp(node); end + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#53 + def on_send(node); end + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#37 + def regexp_constructor(param0); end + + private + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#66 + def detect_offenses(node, expr); end + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#81 + def range_at_index(node, index, offset); end +end + +# source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#33 +RuboCop::Cop::Lint::UnescapedBracketInRegexp::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#34 +RuboCop::Cop::Lint::UnescapedBracketInRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks for a block that is known to need more positional # block arguments than are given (by default this is configured for # `Enumerable` methods needing 2 arguments). Optional arguments are allowed, @@ -26453,23 +26606,26 @@ RuboCop::Cop::Metrics::CollectionLiteralLength::RESTRICT_ON_SEND = T.let(T.unsaf # and ||/or is shorthand for a sequence of ifs, so they also add one. # Loops can be said to have an exit condition, so they add one. # Blocks that are calls to builtin iteration methods -# (e.g. `ary.map{...}) also add one, others are ignored. +# (e.g. `ary.map{...}`) also add one, others are ignored. +# +# @example # # def each_child_node(*types) # count begins: 1 -# unless block_given? # unless: +1 -# return to_enum(__method__, *types) +# unless block_given? # unless: +1 +# return to_enum(__method__, *types) +# end # -# children.each do |child| # each{}: +1 -# next unless child.is_a?(Node) # unless: +1 +# children.each do |child| # each{}: +1 +# next unless child.is_a?(Node) # unless: +1 # -# yield child if types.empty? || # if: +1, ||: +1 -# types.include?(child.type) -# end +# yield child if types.empty? || # if: +1, ||: +1 +# types.include?(child.type) +# end # -# self +# self # end # total: 6 # -# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#32 +# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#35 class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern @@ -26479,19 +26635,19 @@ class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base private - # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#42 + # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#45 def complexity_score_for(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#49 + # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#52 def count_block?(block); end end -# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#37 +# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#40 RuboCop::Cop::Metrics::CyclomaticComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#36 +# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#39 RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) # Checks if the length of a method exceeds some maximum value. @@ -29175,7 +29331,7 @@ class RuboCop::Cop::Offense # @api private # @return [Offense] a new instance of Offense # - # source://rubocop/lib/rubocop/cop/offense.rb#84 + # source://rubocop/lib/rubocop/cop/offense.rb#83 def initialize(severity, location, message, cop_name, status = T.unsafe(nil), corrector = T.unsafe(nil)); end # Returns `-1`, `0`, or `+1` @@ -29184,105 +29340,104 @@ class RuboCop::Cop::Offense # @api public # @return [Integer] comparison result # - # source://rubocop/lib/rubocop/cop/offense.rb#230 + # source://rubocop/lib/rubocop/cop/offense.rb#229 def <=>(other); end # @api public # @return [Boolean] returns `true` if two offenses contain same attributes # - # source://rubocop/lib/rubocop/cop/offense.rb#211 + # source://rubocop/lib/rubocop/cop/offense.rb#210 def ==(other); end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#160 + # source://rubocop/lib/rubocop/cop/offense.rb#159 def column; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#170 + # source://rubocop/lib/rubocop/cop/offense.rb#169 def column_length; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#194 + # source://rubocop/lib/rubocop/cop/offense.rb#193 def column_range; end # @api public # @example - # 'LineLength' - # @return [String] a cop class name without department. - # i.e. type of the violation. + # 'Layout/LineLength' + # @return [String] the cop name as a String for which this offense is for. # - # source://rubocop/lib/rubocop/cop/offense.rb#51 + # source://rubocop/lib/rubocop/cop/offense.rb#50 def cop_name; end # @api public # @return [Boolean] whether this offense can be automatically corrected via autocorrect. # This includes todo comments, for example when requested with `--disable-uncorrectable`. # - # source://rubocop/lib/rubocop/cop/offense.rb#102 + # source://rubocop/lib/rubocop/cop/offense.rb#101 def correctable?; end # @api public # @return [Boolean] whether this offense is automatically corrected via # autocorrect or a todo. # - # source://rubocop/lib/rubocop/cop/offense.rb#113 + # source://rubocop/lib/rubocop/cop/offense.rb#112 def corrected?; end # @api public # @return [Boolean] whether this offense is automatically disabled via a todo. # - # source://rubocop/lib/rubocop/cop/offense.rb#123 + # source://rubocop/lib/rubocop/cop/offense.rb#122 def corrected_with_todo?; end # @api public # @return [Corrector | nil] the autocorrection for this offense, or `nil` when not available # - # source://rubocop/lib/rubocop/cop/offense.rb#62 + # source://rubocop/lib/rubocop/cop/offense.rb#61 def corrector; end # @api public # @return [Boolean] whether this offense was locally disabled with a # disable or todo where it occurred. # - # source://rubocop/lib/rubocop/cop/offense.rb#134 + # source://rubocop/lib/rubocop/cop/offense.rb#133 def disabled?; end # @api public # @return [Boolean] returns `true` if two offenses contain same attributes # - # source://rubocop/lib/rubocop/cop/offense.rb#211 + # source://rubocop/lib/rubocop/cop/offense.rb#210 def eql?(other); end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#179 + # source://rubocop/lib/rubocop/cop/offense.rb#178 def first_line; end - # source://rubocop/lib/rubocop/cop/offense.rb#219 + # source://rubocop/lib/rubocop/cop/offense.rb#218 def hash; end # @api public # @return [Parser::Source::Range] the range of the code that is highlighted # - # source://rubocop/lib/rubocop/cop/offense.rb#142 + # source://rubocop/lib/rubocop/cop/offense.rb#141 def highlighted_area; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#189 + # source://rubocop/lib/rubocop/cop/offense.rb#188 def last_column; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#184 + # source://rubocop/lib/rubocop/cop/offense.rb#183 def last_line; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#155 + # source://rubocop/lib/rubocop/cop/offense.rb#154 def line; end # @api public @@ -29306,7 +29461,7 @@ class RuboCop::Cop::Offense # # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#203 + # source://rubocop/lib/rubocop/cop/offense.rb#202 def real_column; end # @api public @@ -29317,19 +29472,19 @@ class RuboCop::Cop::Offense # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#165 + # source://rubocop/lib/rubocop/cop/offense.rb#164 def source_line; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#54 + # source://rubocop/lib/rubocop/cop/offense.rb#53 def status; end # This is just for debugging purpose. # # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#148 + # source://rubocop/lib/rubocop/cop/offense.rb#147 def to_s; end end @@ -29338,10 +29493,10 @@ end # source://rubocop/lib/rubocop/cop/offense.rb#10 RuboCop::Cop::Offense::COMPARISON_ATTRIBUTES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/offense.rb#81 +# source://rubocop/lib/rubocop/cop/offense.rb#80 RuboCop::Cop::Offense::NO_LOCATION = T.let(T.unsafe(nil), RuboCop::Cop::Offense::PseudoSourceRange) -# source://rubocop/lib/rubocop/cop/offense.rb#64 +# source://rubocop/lib/rubocop/cop/offense.rb#63 class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # Returns the value of attribute begin_pos # @@ -29365,7 +29520,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # @return [Object] the newly set value def column=(_); end - # source://rubocop/lib/rubocop/cop/offense.rb#70 + # source://rubocop/lib/rubocop/cop/offense.rb#69 def column_range; end # Returns the value of attribute end_pos @@ -29394,7 +29549,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # @return [Object] the current value of line def last_line; end - # source://rubocop/lib/rubocop/cop/offense.rb#74 + # source://rubocop/lib/rubocop/cop/offense.rb#73 def length; end # Returns the value of attribute line @@ -29408,7 +29563,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # @return [Object] the newly set value def line=(_); end - # source://rubocop/lib/rubocop/cop/offense.rb#74 + # source://rubocop/lib/rubocop/cop/offense.rb#73 def size; end # Returns the value of attribute source_line @@ -29711,7 +29866,7 @@ class RuboCop::Cop::PercentLiteralCorrector # source://rubocop/lib/rubocop/cop/correctors/percent_literal_corrector.rb#34 def delimiters_for(type); end - # source://rubocop/lib/rubocop/cop/correctors/percent_literal_corrector.rb#100 + # source://rubocop/lib/rubocop/cop/correctors/percent_literal_corrector.rb#110 def end_content(source); end # @return [Boolean] @@ -31249,6 +31404,57 @@ RuboCop::Cop::Style::Alias::MSG_SYMBOL_ARGS = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/alias.rb#39 RuboCop::Cop::Style::Alias::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +# Looks for endless methods inside operations of lower precedence (`and`, `or`, and +# modifier forms of `if`, `unless`, `while`, `until`) that are ambiguous due to +# lack of parentheses. This may lead to unexpected behavior as the code may appear +# to use these keywords as part of the method but in fact they modify +# the method definition itself. +# +# In these cases, using a normal method definition is more clear. +# +# @example +# +# # bad +# def foo = true if bar +# +# # good - using a non-endless method is more explicit +# def foo +# true +# end if bar +# +# # ok - method body is explicit +# def foo = (true if bar) +# +# # ok - method definition is explicit +# (def foo = true) if bar +# +# source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#29 +class RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::EndlessMethodRewriter + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::TargetRubyVersion + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#40 + def ambiguous_endless_method_body(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#48 + def on_def(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#69 + def keyword(operation); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#63 + def modifier_form?(operation); end +end + +# source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#37 +RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition::MSG = T.let(T.unsafe(nil), String) + # Checks for uses of `and` and `or`, and suggests using `&&` and # `||` instead. It can be configured to check only in conditions or in # all contexts. @@ -32242,6 +32448,60 @@ class RuboCop::Cop::Style::BisectedAttrAccessor::Macro end end +# Prefer bitwise predicate methods over direct comparison operations. +# +# @example +# +# # bad - checks any set bits +# (variable & flags).positive? +# +# # good +# variable.anybits?(flags) +# +# # bad - checks all set bits +# (variable & flags) == flags +# +# # good +# variable.allbits?(flags) +# +# # bad - checks no set bits +# (variable & flags).zero? +# +# # good +# variable.nobits?(flags) +# +# source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#32 +class RuboCop::Cop::Style::BitwisePredicate < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#52 + def allbits?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#42 + def anybits?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#68 + def bit_operation?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#60 + def nobits?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#73 + def on_send(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#88 + def preferred_method(node); end +end + +# source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#36 +RuboCop::Cop::Style::BitwisePredicate::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#37 +RuboCop::Cop::Style::BitwisePredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Looks for uses of block comments (=begin...=end). # # @example @@ -32456,7 +32716,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#472 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#487 def array_or_range?(node); end # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#212 @@ -32464,7 +32724,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#476 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#491 def begin_required?(block_node); end # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#240 @@ -32472,7 +32732,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#413 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#428 def braces_for_chaining_style?(node); end # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#252 @@ -32480,46 +32740,46 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#390 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#405 def braces_required_method?(method_name); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#394 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#409 def braces_required_methods; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#423 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#438 def braces_style?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#468 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#483 def conditional?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#427 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#442 def correction_would_break_code?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#313 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#328 def end_of_chain(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#437 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#452 def functional_block?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#433 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#448 def functional_method?(method_name); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#330 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#345 def get_blocks(node, &block); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#398 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#413 def line_count_based_block_style?(node); end # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#222 @@ -32533,20 +32793,20 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#445 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#460 def procedural_method?(method_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#441 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#456 def procedural_oneliners_may_have_braces?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#349 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#364 def proper_block_style?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#320 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#335 def remove_trailing_whitespace(corrector, range, comment); end # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#267 @@ -32557,40 +32817,43 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#362 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#377 def require_braces?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#370 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#385 def require_do_end?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#461 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#476 def return_value_of_scope?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#449 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#464 def return_value_used?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#402 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#417 def semantic_block_style?(node); end # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#230 def semantic_message(node); end + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#318 + def source_range_before_comment(range, comment); end + # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#377 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#392 def special_method?(method_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#383 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#398 def special_method_proper_block_style?(node); end # @return [Boolean] @@ -32605,7 +32868,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#326 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#341 def with_block?(node); end class << self @@ -33517,6 +33780,66 @@ end # source://rubocop/lib/rubocop/cop/style/colon_method_definition.rb#25 RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String) +# Checks for multiple `defined?` calls joined by `&&` that can be combined +# into a single `defined?`. +# +# When checking that a nested constant or chained method is defined, it is +# not necessary to check each ancestor or component of the chain. +# +# @example +# # bad +# defined?(Foo) && defined?(Foo::Bar) && defined?(Foo::Bar::Baz) +# +# # good +# defined?(Foo::Bar::Baz) +# +# # bad +# defined?(foo) && defined?(foo.bar) && defined?(foo.bar.baz) +# +# # good +# defined?(foo.bar.baz) +# +# source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#24 +class RuboCop::Cop::Style::CombinableDefined < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#31 + def on_and(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#55 + def defined_calls(nodes); end + + # If the redundant `defined?` node is the LHS of an `and` node, + # the term as well as the subsequent `&&`/`and` operator will be removed. + # + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#85 + def lhs_range_to_remove(term); end + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#62 + def namespaces(nodes); end + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#72 + def remove_term(corrector, term); end + + # If the redundant `defined?` node is the RHS of an `and` node, + # the term as well as the preceding `&&`/`and` operator will be removed. + # + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#100 + def rhs_range_to_remove(term); end + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#49 + def terms(node); end +end + +# source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#28 +RuboCop::Cop::Style::CombinableDefined::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#29 +RuboCop::Cop::Style::CombinableDefined::OPERATORS = T.let(T.unsafe(nil), Array) + # Checks for places where multiple consecutive loops over the same data # can be combined into a single loop. It is very likely that combining them # will make the code more efficient and more concise. @@ -36123,34 +36446,29 @@ RuboCop::Cop::Style::EndBlock::MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/endless_method.rb#49 class RuboCop::Cop::Style::EndlessMethod < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::EndlessMethodRewriter extend ::RuboCop::Cop::TargetRubyVersion extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#60 + # source://rubocop/lib/rubocop/cop/style/endless_method.rb#61 def on_def(node); end private - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#95 - def arguments(node, missing = T.unsafe(nil)); end - - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#85 - def correct_to_multiline(corrector, node); end - - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#70 + # source://rubocop/lib/rubocop/cop/style/endless_method.rb#71 def handle_allow_style(node); end - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#79 + # source://rubocop/lib/rubocop/cop/style/endless_method.rb#80 def handle_disallow_style(node); end end -# source://rubocop/lib/rubocop/cop/style/endless_method.rb#56 +# source://rubocop/lib/rubocop/cop/style/endless_method.rb#57 RuboCop::Cop::Style::EndlessMethod::CORRECTION_STYLES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/endless_method.rb#57 +# source://rubocop/lib/rubocop/cop/style/endless_method.rb#58 RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/endless_method.rb#58 +# source://rubocop/lib/rubocop/cop/style/endless_method.rb#59 RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String) # Checks for consistent usage of `ENV['HOME']`. If `nil` is used as @@ -37755,7 +38073,7 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#299 + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#312 def allowed_consecutive_conditionals?; end # @return [Boolean] @@ -37763,6 +38081,11 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#265 def and_or_guard_clause?(guard_clause); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#296 + def assigned_lvar_used_in_if_branch?(node); end + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#210 def autocorrect(corrector, node, condition, replacement, guard); end @@ -37794,7 +38117,7 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#188 def register_offense(node, scope_exiting_keyword, conditional_keyword, guard = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#295 + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#308 def remove_whole_lines(corrector, range); end # @return [Boolean] @@ -39606,6 +39929,40 @@ RuboCop::Cop::Style::IpAddresses::IPV6_MAX_SIZE = T.let(T.unsafe(nil), Integer) # source://rubocop/lib/rubocop/cop/style/ip_addresses.rb#25 RuboCop::Cop::Style::IpAddresses::MSG = T.let(T.unsafe(nil), String) +# When passing an existing hash as keyword arguments, provide additional arguments +# directly rather than using `merge`. +# +# Providing arguments directly is more performant, than using `merge`, and +# also leads to a shorter and simpler code. +# +# @example +# # bad +# some_method(**opts.merge(foo: true)) +# some_method(**opts.merge(other_opts)) +# +# # good +# some_method(**opts, foo: true) +# some_method(**opts, **other_opts) +# +# source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#21 +class RuboCop::Cop::Style::KeywordArgumentsMerging < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#27 + def merge_kwargs?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#36 + def on_kwsplat(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#48 + def autocorrect(corrector, kwsplat_node, hash_node, other_hash_node); end +end + +# source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#24 +RuboCop::Cop::Style::KeywordArgumentsMerging::MSG = T.let(T.unsafe(nil), String) + # Enforces that optional keyword parameters are placed at the # end of the parameters list. # @@ -40063,10 +40420,10 @@ class RuboCop::Cop::Style::MagicCommentFormat::CommentRange # source://rubocop/lib/rubocop/cop/style/magic_comment_format.rb#125 def directives; end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def loc(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.32.3lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.33.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 def text(*_arg0, **_arg1, &_arg2); end # A magic comment can contain one value (normal style) or @@ -40239,70 +40596,73 @@ class RuboCop::Cop::Style::MapIntoArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#104 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#109 def after_leaving_scope(scope, _variable_table); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#67 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#72 def each_block_with_push?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#76 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#81 def empty_array_asgn?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#88 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#93 def empty_array_tap(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#98 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#103 def lvar_ref?(param0 = T.unsafe(nil), param1); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#108 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#113 def on_block(node); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#108 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#113 def on_numblock(node); end + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#67 + def suitable_argument_node?(param0 = T.unsafe(nil)); end + private - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#208 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#213 def correct_push_node(corrector, push_node); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#216 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#221 def correct_return_value_handling(corrector, block, dest_var); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#151 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#156 def dest_used_only_for_mapping?(block, dest_var, asgn); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#145 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#150 def find_closest_assignment(block, dest_var); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#128 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#133 def find_dest_var(block); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#176 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#181 def new_method_name; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#136 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#141 def offending_empty_array_tap?(node, dest_var); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#159 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#164 def register_offense(block, dest_var, asgn); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#195 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#200 def remove_assignment(corrector, asgn); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#202 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#207 def remove_tap(corrector, node, block_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#182 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#187 def return_value_used?(node); end class << self - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#100 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#105 def joining_forces; end end end @@ -42098,59 +42458,50 @@ class RuboCop::Cop::Style::MultipleComparison < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#58 - def on_new_investigation; end - - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#62 def on_or(node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#86 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#80 def simple_comparison_lhs?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#91 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#85 def simple_comparison_rhs?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#83 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#77 def simple_double_comparison?(param0 = T.unsafe(nil)); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#153 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#142 def allow_method_comparison?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#134 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#121 def comparison?(node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#157 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#146 def comparisons_threshold; end - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#126 - def nested_comparison?(node); end + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#90 + def find_offending_var(node, variables = T.unsafe(nil), values = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#95 - def nested_variable_comparison?(node); end - - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#148 - def reset_comparison; end + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#113 + def nested_comparison?(node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#138 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#132 def root_of_or_node(or_node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#122 - def variable_name(node); end - - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#101 - def variables_in_node(node); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#125 + def simple_comparison?(node); end # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#109 - def variables_in_simple_node(node); end + def variable_name(node); end end # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#55 @@ -42232,7 +42583,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-sorbet/0.8.6lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 + # source://rubocop-sorbet/0.8.7lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 def on_assignment(value); end # source://rubocop/lib/rubocop/cop/style/mutable_constant.rb#127 @@ -42250,7 +42601,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/mutable_constant.rb#217 def splat_value(param0 = T.unsafe(nil)); end - # source://rubocop-sorbet/0.8.6lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 + # source://rubocop-sorbet/0.8.7lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 def t_let(param0 = T.unsafe(nil)); end private @@ -46354,47 +46705,50 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base include ::RuboCop::Cop::MatchRange extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#79 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#81 def on_new_investigation; end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#183 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#201 def argument_is_method?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#147 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#165 def argument_newline?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#102 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#106 def ends_with_backslash_without_comment?(source_line); end - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#163 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#181 def find_node_for_line(last_line); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#132 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#150 def inside_string_literal?(range, token); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#110 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#114 def inside_string_literal_or_method_with_argument?(range); end + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#139 + def inspect_eof_line_continuation; end + # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#118 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#122 def leading_dot_method_chain_with_blank_line?(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#190 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#208 def method_call_with_arguments?(node); end # A method call without parentheses such as the following cannot remove `\`: @@ -46404,44 +46758,50 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#140 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#158 def method_with_argument?(current_token, next_token); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#124 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#128 def redundant_line_continuation?(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#94 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#98 def require_line_continuation?(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#169 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#187 def same_line?(node, line); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#194 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#212 def start_with_arithmetic_operator?(source_line); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#106 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#110 def string_concatenation?(source_line); end end -# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#72 +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#74 RuboCop::Cop::Style::RedundantLineContinuation::ALLOWED_STRING_TOKENS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#77 +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#79 RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TAKING_FLOW_TOKEN_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#73 +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#75 RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TYPES = T.let(T.unsafe(nil), Array) +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#72 +RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#73 +RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION_PATTERN = T.let(T.unsafe(nil), Regexp) + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#71 RuboCop::Cop::Style::RedundantLineContinuation::MSG = T.let(T.unsafe(nil), String) @@ -46463,25 +46823,22 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#32 def allowed_pin_operator?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#35 - def arg_in_call_with_block?(param0 = T.unsafe(nil)); end - - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#269 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#261 def first_send_argument?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#274 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#266 def first_super_argument?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#279 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#271 def first_yield_argument?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#175 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#166 def interpolation?(param0 = T.unsafe(nil)); end # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#26 def method_node_and_args(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#37 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#34 def on_begin(node); end # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#29 @@ -46494,130 +46851,130 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#177 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#168 def allow_in_multiline_conditions?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#68 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#64 def allowed_ancestor?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#60 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#57 def allowed_expression?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#73 - def allowed_method_call?(node); end - - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#78 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#69 def allowed_multiple_expression?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#87 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#78 def allowed_ternary?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#283 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#275 def call_chain_starts_with_int?(begin_node, send_node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#136 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#127 def check(begin_node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#184 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#175 def check_send(begin_node, node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#193 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#185 def check_unary(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#217 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#209 def disallowed_literal?(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#114 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#281 + def do_end_block_in_method_chain?(begin_node, node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#105 def empty_parentheses?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#147 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#138 def find_offense_message(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#119 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#110 def first_arg_begins_with_hash_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#258 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#250 def first_argument?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#53 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#50 def ignore_syntax?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#213 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#205 def keyword_ancestor?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#232 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#224 def keyword_with_redundant_parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#100 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#91 def like_method_argument_parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#245 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#237 def method_call_with_redundant_parentheses?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#128 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#119 def method_chain_begins_with_hash_literal(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#107 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#98 def multiline_control_flow_statements?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#203 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#195 def offense(node, msg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#254 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#246 def only_begin_arg?(args); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#45 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#42 def parens_allowed?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#221 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#213 def raised_to_power_negative_numeric?(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#209 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#201 def suspect_unary?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#93 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#84 def ternary_parentheses_required?; end end @@ -48291,6 +48648,11 @@ RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe( # We have limited the cop to not register an offense for method chains # that exceed this option's value. # +# NOTE: This cop will recognize offenses but not autocorrect code when the +# right hand side (RHS) of the `&&` statement is an `||` statement +# (eg. `foo && (foo.bar? || foo.baz?)`). It can be corrected +# manually by removing the `foo &&` and adding `&.` to each `foo` on the RHS. +# # @example # # bad # foo.bar if foo @@ -48341,7 +48703,7 @@ RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe( # foo.baz + bar if foo # foo.bar > 2 if foo # -# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#84 +# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#89 class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods @@ -48349,125 +48711,165 @@ class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#128 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#136 def and_inside_begin?(param0 = T.unsafe(nil)); end + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#130 + def and_with_rhs_or?(param0 = T.unsafe(nil)); end + # if format: (if checked_variable body nil) # unless format: (if checked_variable nil body) # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#99 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#104 def modifier_if_safe_navigation_candidate(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#125 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#133 def not_nil_check?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#149 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#157 def on_and(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#133 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#141 def on_if(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#173 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#181 def report_offense(node, rhs, rhs_receiver, *removal_ranges, offense_range: T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#131 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#139 def strip_begin(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#114 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#119 def ternary_safe_navigation_candidate(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#348 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#360 def add_safe_nav_to_all_methods_in_chain(corrector, start_method, method_chain); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#265 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#277 def allowed_if_condition?(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#210 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#222 def and_parts(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#340 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#352 def begin_range(node, method_call); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#302 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#314 def chain_length(method_chain, method); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#192 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#204 def collect_and_clauses(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#246 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#258 def comments(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#204 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#216 def concat_nodes(nodes, and_node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#344 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#356 def end_range(node, method_call); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#284 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#296 def extract_common_parts(method_chain, checked_variable); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#231 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#243 def extract_if_body(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#269 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#281 def extract_parts_from_if(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#292 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#304 def find_matching_receiver_invocation(method_chain, checked_variable); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#186 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#198 def find_method_chain(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#239 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#251 def handle_comments(corrector, node, method_call); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#362 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#374 def max_chain_length; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#336 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#348 def method_called?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#328 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#340 def negated?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#217 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#229 def offending_node?(node, lhs_receiver, rhs, rhs_receiver); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#252 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#264 def relevant_comment_ranges(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#322 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#334 def unsafe_method?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#310 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#322 def unsafe_method_used?(method_chain, method); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#227 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#239 def use_var_only_in_unless_modifier?(node, variable); end end -# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#92 +# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#97 RuboCop::Cop::Style::SafeNavigation::LOGIC_JUMP_KEYWORDS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#90 +# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#95 RuboCop::Cop::Style::SafeNavigation::MSG = T.let(T.unsafe(nil), String) +# Enforces safe navigation chains length to not exceed the configured maximum. +# The longer the chain is, the harder it becomes to track what on it could be +# returning `nil`. +# +# There is a potential interplay with `Style/SafeNavigation` - if both are enabled +# and their settings are "incompatible", one of the cops will complain about what +# the other proposes. +# +# E.g. if `Style/SafeNavigation` is configured with `MaxChainLength: 2` (default) +# and this cop is configured with `Max: 1`, then for `foo.bar.baz if foo` the former +# will suggest `foo&.bar&.baz`, which is an offense for the latter. +# +# @example Max: 2 (default) +# # bad +# user&.address&.zip&.upcase +# +# # good +# user&.address&.zip +# user.address.zip if user +# +# source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#26 +class RuboCop::Cop::Style::SafeNavigationChainLength < ::RuboCop::Cop::Base + # source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#29 + def on_csend(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#46 + def max; end + + # source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#38 + def safe_navigation_chains(node); end +end + +# source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#27 +RuboCop::Cop::Style::SafeNavigationChainLength::MSG = T.let(T.unsafe(nil), String) + # Identifies usages of `shuffle.first`, # `shuffle.last`, and `shuffle[]` and change them to use # `sample` instead. @@ -50845,7 +51247,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#193 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#191 def method_name(param0 = T.unsafe(nil)); end # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#69 @@ -50858,7 +51260,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#183 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#181 def below_ternary_precedence?(child); end # If the condition is parenthesized we recurse and check for any @@ -50874,15 +51276,25 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#89 def condition_as_parenthesized_one_line_pattern_matching?(condition); end - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#198 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#196 def correct_parenthesized(corrector, condition); end - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#208 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#210 def correct_unparenthesized(corrector, condition); end # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#151 def message(node); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#227 + def node_args_need_parens?(send_node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#234 + def node_with_args?(node); end + # Anything that is not a variable, constant, or method/.method call # will be counted as a complex expression. # @@ -50906,6 +51318,9 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#85 def only_closing_parenthesis_is_last_line?(condition); end + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#214 + def parenthesize_condition_arguments(corrector, send_node); end + # @return [Boolean] # # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#169 @@ -50923,7 +51338,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#179 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#177 def unparenthesized_method_call?(child); end # @return [Boolean] @@ -50933,7 +51348,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#212 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#222 def whitespace_after?(node); end end @@ -53622,28 +54037,28 @@ class RuboCop::Cop::VariableForce::Assignment # @return [Assignment] a new instance of Assignment # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#16 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#17 def initialize(node, variable); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#50 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#58 def exception_assignment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#72 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#80 def for_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#83 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#91 def meta_assignment_node; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#60 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#68 def multiple_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#29 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#31 def name; end # Returns the value of attribute node. @@ -53651,15 +54066,28 @@ class RuboCop::Cop::VariableForce::Assignment # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#12 def node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#78 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#86 def operator; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#54 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#62 def operator_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#37 + # Returns the value of attribute reassigned. + # + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#12 + def reassigned; end + + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#44 + def reassigned!; end + + # Returns the value of attribute reassigned. + # + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#12 + def reassigned?; end + + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#39 def reference!(node); end # Returns the value of attribute referenced. @@ -53679,20 +54107,20 @@ class RuboCop::Cop::VariableForce::Assignment # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#46 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#54 def regexp_named_capture?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#66 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#74 def rest_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#33 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#35 def scope; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#42 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#50 def used?; end # Returns the value of attribute variable. @@ -53702,19 +54130,19 @@ class RuboCop::Cop::VariableForce::Assignment private - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#125 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#140 def find_multiple_assignment_node(grandparent_node); end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#121 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#130 def for_assignment_node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#104 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#112 def multiple_assignment_node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#96 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#104 def operator_assignment_node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#114 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#123 def rest_assignment_node; end end @@ -54377,7 +54805,7 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#94 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#98 def argument?; end # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#31 @@ -54390,10 +54818,10 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#102 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#106 def block_argument?; end - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#74 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#78 def capture_with_block!; end # Returns the value of attribute captured_by_block. @@ -54413,22 +54841,22 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#110 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#114 def explicit_block_local_variable?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#66 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#70 def in_modifier_conditional?(assignment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#106 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#110 def keyword_argument?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#98 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#102 def method_argument?; end # Returns the value of attribute name. @@ -54436,12 +54864,12 @@ class RuboCop::Cop::VariableForce::Variable # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#11 def name; end - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#40 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#44 def reference!(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#35 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#39 def referenced?; end # Returns the value of attribute references. @@ -54456,7 +54884,7 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#90 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#94 def should_be_unused?; end # This is a convenient way to check whether the variable is used @@ -54470,7 +54898,7 @@ class RuboCop::Cop::VariableForce::Variable # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#86 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#90 def used?; end end @@ -57578,10 +58006,10 @@ class RuboCop::Runner # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#430 + # source://rubocop/lib/rubocop/runner.rb#434 def considered_failure?(offense); end - # source://rubocop/lib/rubocop/runner.rb#463 + # source://rubocop/lib/rubocop/runner.rb#471 def default_config(cop_name); end # source://rubocop/lib/rubocop/runner.rb#276 @@ -57610,16 +58038,16 @@ class RuboCop::Runner # source://rubocop/lib/rubocop/runner.rb#244 def file_started(file); end - # source://rubocop/lib/rubocop/runner.rb#410 + # source://rubocop/lib/rubocop/runner.rb#414 def filter_cop_classes(cop_classes, config); end # source://rubocop/lib/rubocop/runner.rb#108 def find_target_files(paths); end - # source://rubocop/lib/rubocop/runner.rb#421 + # source://rubocop/lib/rubocop/runner.rb#425 def formatter_set; end - # source://rubocop/lib/rubocop/runner.rb#478 + # source://rubocop/lib/rubocop/runner.rb#486 def get_processed_source(file); end # source://rubocop/lib/rubocop/runner.rb#346 @@ -57636,25 +58064,30 @@ class RuboCop::Runner # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#459 + # source://rubocop/lib/rubocop/runner.rb#467 def mark_as_safe_by_config?(config); end - # source://rubocop/lib/rubocop/runner.rb#467 + # source://rubocop/lib/rubocop/runner.rb#475 def minimum_severity_to_fail; end - # source://rubocop/lib/rubocop/runner.rb#371 + # source://rubocop/lib/rubocop/runner.rb#375 def mobilize_team(processed_source); end - # source://rubocop/lib/rubocop/runner.rb#376 + # source://rubocop/lib/rubocop/runner.rb#380 def mobilized_cop_classes(config); end - # source://rubocop/lib/rubocop/runner.rb#439 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/runner.rb#443 + def offense_displayed?(offense); end + + # source://rubocop/lib/rubocop/runner.rb#455 def offenses_to_report(offenses); end # source://rubocop/lib/rubocop/runner.rb#156 def process_file(file); end - # source://rubocop/lib/rubocop/runner.rb#400 + # source://rubocop/lib/rubocop/runner.rb#404 def qualify_option_cop_names; end # @yield [cop] @@ -57670,17 +58103,17 @@ class RuboCop::Runner # otherwise dormant team that can be used for config- and option- # level caching in ResultCache. # - # source://rubocop/lib/rubocop/runner.rb#506 + # source://rubocop/lib/rubocop/runner.rb#514 def standby_team(config); end # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#417 + # source://rubocop/lib/rubocop/runner.rb#421 def style_guide_cops_only?(config); end # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#451 + # source://rubocop/lib/rubocop/runner.rb#459 def supports_safe_autocorrect?(offense); end # @yield [team] @@ -58248,12 +58681,17 @@ module RuboCop::Version class << self # @api private # - # source://rubocop/lib/rubocop/version.rb#110 + # source://rubocop/lib/rubocop/version.rb#99 + def config_for_pwd(env); end + + # @api private + # + # source://rubocop/lib/rubocop/version.rb#129 def document_version; end # @api private # - # source://rubocop/lib/rubocop/version.rb#60 + # source://rubocop/lib/rubocop/version.rb#66 def extension_versions(env); end # Returns feature version in one of two ways: @@ -58263,22 +58701,34 @@ module RuboCop::Version # # @api private # - # source://rubocop/lib/rubocop/version.rb#94 + # source://rubocop/lib/rubocop/version.rb#113 def feature_version(feature); end # @api private # - # source://rubocop/lib/rubocop/version.rb#45 + # source://rubocop/lib/rubocop/version.rb#51 def parser_version; end # @api private # - # source://rubocop/lib/rubocop/version.rb#115 + # source://rubocop/lib/rubocop/version.rb#134 def server_mode; end # @api private # - # source://rubocop/lib/rubocop/version.rb#22 + # source://rubocop/lib/rubocop/version.rb#90 + def target_ruby_version(env); end + + # @api private + # + # source://rubocop/lib/rubocop/version.rb#46 + def verbose(env: T.unsafe(nil)); end + + # NOTE: Marked as private but used by gems like standard. + # + # @api private + # + # source://rubocop/lib/rubocop/version.rb#23 def version(debug: T.unsafe(nil), env: T.unsafe(nil)); end end end diff --git a/sorbet/rbi/gems/ruby-lsp@0.20.1.rbi b/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi similarity index 91% rename from sorbet/rbi/gems/ruby-lsp@0.20.1.rbi rename to sorbet/rbi/gems/ruby-lsp@0.21.2.rbi index 9b6cee4..deddd53 100644 --- a/sorbet/rbi/gems/ruby-lsp@0.20.1.rbi +++ b/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi @@ -78,7 +78,7 @@ class RubyIndexer::DeclarationListener sig { returns(T::Array[::String]) } def indexing_errors; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#439 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#451 sig { params(node: ::Prism::AliasMethodNode).void } def on_alias_method_node_enter(node); end @@ -86,7 +86,7 @@ class RubyIndexer::DeclarationListener sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#325 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#329 sig { params(node: ::Prism::CallNode).void } def on_call_node_leave(node); end @@ -130,51 +130,51 @@ class RubyIndexer::DeclarationListener sig { params(node: ::Prism::ConstantWriteNode).void } def on_constant_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#338 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#350 sig { params(node: ::Prism::DefNode).void } def on_def_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#379 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#391 sig { params(node: ::Prism::DefNode).void } def on_def_node_leave(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#389 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#401 sig { params(node: ::Prism::GlobalVariableAndWriteNode).void } def on_global_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#394 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#406 sig { params(node: ::Prism::GlobalVariableOperatorWriteNode).void } def on_global_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#399 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#411 sig { params(node: ::Prism::GlobalVariableOrWriteNode).void } def on_global_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#404 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#416 sig { params(node: ::Prism::GlobalVariableTargetNode).void } def on_global_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#409 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#421 sig { params(node: ::Prism::GlobalVariableWriteNode).void } def on_global_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#419 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#431 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#424 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#436 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#429 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#441 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#434 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#446 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#414 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#426 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end @@ -200,11 +200,11 @@ class RubyIndexer::DeclarationListener private - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#847 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#901 sig { params(name: ::String).returns(T::Array[::String]) } def actual_nesting(name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#595 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#607 sig do params( node: T.any(::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathTargetNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantTargetNode, ::Prism::ConstantWriteNode), @@ -214,27 +214,27 @@ class RubyIndexer::DeclarationListener end def add_constant(node, name, value = T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#646 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#658 sig { params(node: ::Prism::Node).returns(T.nilable(::String)) } def collect_comments(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#755 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#809 sig { returns(::RubyIndexer::Entry::Visibility) } def current_visibility; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#675 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#687 sig { params(name: ::String).returns(::String) } def fully_qualify_name(name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#539 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#551 sig { params(node: ::Prism::CallNode).void } def handle_alias_method(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#684 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#696 sig { params(node: ::Prism::CallNode, reader: T::Boolean, writer: T::Boolean).void } def handle_attribute(node, reader:, writer:); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#468 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#480 sig do params( node: T.any(::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableTargetNode, ::Prism::GlobalVariableWriteNode), @@ -243,7 +243,7 @@ class RubyIndexer::DeclarationListener end def handle_global_variable(node, loc); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#492 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#504 sig do params( node: T.any(::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableTargetNode, ::Prism::InstanceVariableWriteNode), @@ -252,15 +252,19 @@ class RubyIndexer::DeclarationListener end def handle_instance_variable(node, loc); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#727 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#767 + sig { params(node: ::Prism::CallNode).void } + def handle_module_function(node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#739 sig { params(node: ::Prism::CallNode, operation: ::Symbol).void } def handle_module_operation(node, operation); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#514 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#526 sig { params(node: ::Prism::CallNode).void } def handle_private_constant(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#760 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#814 sig do params( parameters_node: T.nilable(::Prism::ParametersNode) @@ -268,7 +272,7 @@ class RubyIndexer::DeclarationListener end def list_params(parameters_node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#822 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#876 sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::Symbol)) } def parameter_name(node); end end @@ -279,32 +283,43 @@ RubyIndexer::DeclarationListener::BASIC_OBJECT_NESTING = T.let(T.unsafe(nil), Ar # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#8 RubyIndexer::DeclarationListener::OBJECT_NESTING = T.let(T.unsafe(nil), Array) -# @abstract Subclasses must implement the `abstract` methods below. +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#5 -module RubyIndexer::Enhancement - requires_ancestor { Object } +class RubyIndexer::Enhancement + abstract! - interface! + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#12 + sig { params(index: ::RubyIndexer::Index).void } + def initialize(index); end # The `on_extend` indexing enhancement is invoked whenever an extend is encountered in the code. It can be used to # register for an included callback, similar to what `ActiveSupport::Concern` does in order to auto-extend the # `ClassMethods` modules # - # @abstract - # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#28 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#30 sig do - abstract + overridable .params( - index: ::RubyIndexer::Index, owner: T.nilable(::RubyIndexer::Entry::Namespace), node: ::Prism::CallNode, file_path: ::String, code_units_cache: T.any(::Prism::CodeUnitsCache, T.proc.params(arg0: ::Integer).returns(::Integer)) ).void end - def on_call_node(index, owner, node, file_path, code_units_cache); end + def on_call_node_enter(owner, node, file_path, code_units_cache); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#43 + sig do + overridable + .params( + owner: T.nilable(::RubyIndexer::Entry::Namespace), + node: ::Prism::CallNode, + file_path: ::String, + code_units_cache: T.any(::Prism::CodeUnitsCache, T.proc.params(arg0: ::Integer).returns(::Integer)) + ).void + end + def on_call_node_leave(owner, node, file_path, code_units_cache); end end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#5 @@ -342,7 +357,7 @@ class RubyIndexer::Entry # @return [RubyIndexer::Location] # - # source://sorbet-runtime/0.5.11604lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11633lib/types/private/methods/_methods.rb#257 def name_location(*args, **_arg1, &blk); end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#57 @@ -690,7 +705,7 @@ class RubyIndexer::Entry::Parameter # # @return [Symbol] # - # source://sorbet-runtime/0.5.11604lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11633lib/types/private/methods/_methods.rb#257 def decorated_name(*args, **_arg1, &blk); end # Name includes just the name of the parameter, excluding symbols like splats @@ -1112,10 +1127,10 @@ class RubyIndexer::Index private - # Removes redudancy from a constant reference's full name. For example, if we find a reference to `A::B::Foo` inside - # of the ["A", "B"] nesting, then we should not concatenate the nesting with the name or else we'll end up with - # `A::B::A::B::Foo`. This method will remove any redundant parts from the final name based on the reference and the - # nesting + # Removes redundancy from a constant reference's full name. For example, if we find a reference to `A::B::Foo` + # inside of the ["A", "B"] nesting, then we should not concatenate the nesting with the name or else we'll end up + # with `A::B::A::B::Foo`. This method will remove any redundant parts from the final name based on the reference and + # the nesting # # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#982 sig { params(name: ::String, nesting: T::Array[::String]).returns(::String) } @@ -1748,7 +1763,7 @@ class RubyLsp::Addon # Creates a new CodeLens listener. This method is invoked on every CodeLens request # - # source://ruby-lsp/lib/ruby_lsp/addon.rb#205 + # source://ruby-lsp/lib/ruby_lsp/addon.rb#212 sig do overridable .params( @@ -1761,7 +1776,7 @@ class RubyLsp::Addon # Creates a new Completion listener. This method is invoked on every Completion request # - # source://ruby-lsp/lib/ruby_lsp/addon.rb#257 + # source://ruby-lsp/lib/ruby_lsp/addon.rb#264 sig do overridable .params( @@ -1775,7 +1790,7 @@ class RubyLsp::Addon # Creates a new Definition listener. This method is invoked on every Definition request # - # source://ruby-lsp/lib/ruby_lsp/addon.rb#246 + # source://ruby-lsp/lib/ruby_lsp/addon.rb#253 sig do overridable .params( @@ -1789,7 +1804,7 @@ class RubyLsp::Addon # Creates a new DocumentSymbol listener. This method is invoked on every DocumentSymbol request # - # source://ruby-lsp/lib/ruby_lsp/addon.rb#224 + # source://ruby-lsp/lib/ruby_lsp/addon.rb#231 sig do overridable .params( @@ -1801,7 +1816,7 @@ class RubyLsp::Addon # Creates a new Hover listener. This method is invoked on every Hover request # - # source://ruby-lsp/lib/ruby_lsp/addon.rb#215 + # source://ruby-lsp/lib/ruby_lsp/addon.rb#222 sig do overridable .params( @@ -1812,7 +1827,7 @@ class RubyLsp::Addon end def create_hover_listener(response_builder, node_context, dispatcher); end - # source://ruby-lsp/lib/ruby_lsp/addon.rb#232 + # source://ruby-lsp/lib/ruby_lsp/addon.rb#239 sig do overridable .params( @@ -1843,6 +1858,15 @@ class RubyLsp::Addon sig { returns(::String) } def formatted_errors; end + # Handle a response from a window/showMessageRequest request. Add-ons must include the addon_name as part of the + # original request so that the response is delegated to the correct add-on and must override this method to handle + # the response + # https://microsoft.github.io/language-server-protocol/specification#window_showMessageRequest + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#202 + sig { overridable.params(title: ::String).void } + def handle_window_show_message_response(title); end + # Add-ons should override the `name` method to return the add-on name # # @abstract @@ -1914,7 +1938,7 @@ class RubyLsp::Addon sig { params(addon_name: ::String, version_constraints: ::String).returns(::RubyLsp::Addon) } def get(addon_name, *version_constraints); end - # Automatically track and instantiate addon classes + # Automatically track and instantiate add-on classes # # source://ruby-lsp/lib/ruby_lsp/addon.rb#51 sig { params(child_class: T.class_of(RubyLsp::Addon)).void } @@ -1952,56 +1976,93 @@ class RubyLsp::BaseServer abstract! # source://ruby-lsp/lib/ruby_lsp/base_server.rb#12 - sig { params(test_mode: T::Boolean).void } - def initialize(test_mode: T.unsafe(nil)); end + sig { params(options: T.untyped).void } + def initialize(**options); end - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#134 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#143 sig { params(id: ::Integer, message: ::String, type: ::Integer).void } def fail_request_and_notify(id, message, type: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#140 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#149 sig { returns(::Thread) } def new_worker; end # This method is only intended to be used in tests! Pops the latest response that would be sent to the client # - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#123 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#132 sig { returns(T.untyped) } def pop_response; end # @abstract # - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#128 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#137 sig { abstract.params(message: T::Hash[::Symbol, T.untyped]).void } def process_message(message); end - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#109 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#118 sig { void } def run_shutdown; end - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#171 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#180 sig { params(id: ::Integer).void } def send_empty_response(id); end - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#176 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#185 sig { params(message: ::String, type: ::Integer).void } def send_log_message(message, type: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#160 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#169 sig { params(message: T.any(::RubyLsp::Error, ::RubyLsp::Notification, ::RubyLsp::Request, ::RubyLsp::Result)).void } def send_message(message); end # @abstract # - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#131 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#140 sig { abstract.void } def shutdown; end - # source://ruby-lsp/lib/ruby_lsp/base_server.rb#39 + # source://ruby-lsp/lib/ruby_lsp/base_server.rb#46 sig { void } def start; end end +# This class stores all client capabilities that the Ruby LSP and its add-ons depend on to ensure that we're +# not enabling functionality unsupported by the editor connecting to the server +# +# source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#7 +class RubyLsp::ClientCapabilities + # source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#17 + sig { void } + def initialize; end + + # source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#38 + sig { params(capabilities: T::Hash[::Symbol, T.untyped]).void } + def apply_client_capabilities(capabilities); end + + # @return [Boolean] + # + # source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#11 + def supports_progress; end + + # source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#63 + sig { returns(T::Boolean) } + def supports_rename?; end + + # @return [Boolean] + # + # source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#11 + def supports_request_delegation; end + + # source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#11 + sig { returns(T::Boolean) } + def supports_watching_files; end + + # @return [Boolean] + # + # source://ruby-lsp/lib/ruby_lsp/client_capabilities.rb#11 + def window_show_message_supports_extra_properties; end +end + # source://ruby-lsp/lib/ruby_lsp/utils.rb#7 RubyLsp::Constant = LanguageServer::Protocol::Constant @@ -2037,7 +2098,7 @@ class RubyLsp::Document sig { params(other: RubyLsp::Document[T.untyped]).returns(T::Boolean) } def ==(other); end - # TODO: remove this method once all nonpositional requests have been migrated to the listener pattern + # TODO: remove this method once all non-positional requests have been migrated to the listener pattern # # source://ruby-lsp/lib/ruby_lsp/document.rb#74 sig do @@ -2243,17 +2304,17 @@ class RubyLsp::ERBDocument::ERBScanner def scan_char; end end -# source://ruby-lsp/lib/ruby_lsp/utils.rb#107 +# source://ruby-lsp/lib/ruby_lsp/utils.rb#170 class RubyLsp::Error - # source://ruby-lsp/lib/ruby_lsp/utils.rb#114 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#177 sig { params(id: ::Integer, code: ::Integer, message: ::String, data: T.nilable(T::Hash[::Symbol, T.untyped])).void } def initialize(id:, code:, message:, data: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#111 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#174 sig { returns(::String) } def message; end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#122 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#185 sig { returns(T::Hash[::Symbol, T.untyped]) } def to_hash; end end @@ -2270,31 +2331,34 @@ class RubyLsp::GlobalState sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#62 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#69 sig { returns(T.nilable(::RubyLsp::Requests::Support::Formatter)) } def active_formatter; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#67 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#74 sig { returns(T::Array[::RubyLsp::Requests::Support::Formatter]) } def active_linters; end # Applies the options provided by the editor and returns an array of notifications to send back to the client # - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#73 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#80 sig { params(options: T::Hash[::Symbol, T.untyped]).returns(T::Array[::RubyLsp::Notification]) } def apply_options(options); end + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#30 + sig { returns(::RubyLsp::ClientCapabilities) } + def client_capabilities; end + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#21 sig { returns(::Encoding) } def encoding; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#152 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#151 sig { returns(::String) } def encoding_name; end - # @return [Boolean] - # # source://ruby-lsp/lib/ruby_lsp/global_state.rb#24 + sig { returns(T::Boolean) } def experimental_features; end # source://ruby-lsp/lib/ruby_lsp/global_state.rb#12 @@ -2314,24 +2378,15 @@ class RubyLsp::GlobalState sig { returns(::RubyIndexer::Index) } def index; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#57 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#64 sig { params(identifier: ::String, instance: ::RubyLsp::Requests::Support::Formatter).void } def register_formatter(identifier, instance); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#52 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#59 sig { params(addon_name: ::String).returns(T.nilable(T::Hash[::Symbol, T.untyped])) } def settings_for_addon(addon_name); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#27 - sig { returns(T::Array[::String]) } - def supported_resource_operations; end - - # @return [Boolean] - # - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#24 - def supports_request_delegation; end - - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#24 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#163 sig { returns(T::Boolean) } def supports_watching_files; end @@ -2339,52 +2394,57 @@ class RubyLsp::GlobalState sig { returns(::String) } def test_library; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#30 + # @return [Boolean] + # + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#24 + def top_level_bundle; end + + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#27 sig { returns(::RubyLsp::TypeInferrer) } def type_inferrer; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#147 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#146 sig { returns(::String) } def workspace_path; end private - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#222 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#226 sig { returns(T::Boolean) } def bin_rails_present; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#166 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#170 sig { params(direct_dependencies: T::Array[::String], all_dependencies: T::Array[::String]).returns(::String) } def detect_formatter(direct_dependencies, all_dependencies); end # Try to detect if there are linters in the project's dependencies. For auto-detection, we always only consider a # single linter. To have multiple linters running, the user must configure them manually # - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#182 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#186 sig { params(dependencies: T::Array[::String], all_dependencies: T::Array[::String]).returns(T::Array[::String]) } def detect_linters(dependencies, all_dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#193 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#197 sig { params(dependencies: T::Array[::String]).returns(::String) } def detect_test_library(dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#213 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#217 sig { params(dependencies: T::Array[::String]).returns(T::Boolean) } def detect_typechecker(dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#227 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#231 sig { returns(T::Boolean) } def dot_rubocop_yml_present; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#247 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#253 sig { returns(T::Array[::String]) } def gather_direct_and_indirect_dependencies; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#232 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#236 sig { returns(T::Array[::String]) } def gather_direct_dependencies; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#240 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#246 sig { returns(T::Array[::String]) } def gemspec_dependencies; end end @@ -2508,57 +2568,81 @@ class RubyLsp::Listeners::Completion end def initialize(response_builder, global_state, node_context, sorbet_level, dispatcher, uri, trigger_character); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#140 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#146 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end # Handle completion on namespaced constant references (e.g. `Foo::Bar`) # - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#122 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#128 sig { params(node: ::Prism::ConstantPathNode).void } def on_constant_path_node_enter(node); end # Handle completion on regular constant references (e.g. `Bar`) # - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#99 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#105 sig { params(node: ::Prism::ConstantReadNode).void } def on_constant_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#194 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#190 + sig { params(node: ::Prism::GlobalVariableAndWriteNode).void } + def on_global_variable_and_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#195 + sig { params(node: ::Prism::GlobalVariableOperatorWriteNode).void } + def on_global_variable_operator_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#200 + sig { params(node: ::Prism::GlobalVariableOrWriteNode).void } + def on_global_variable_or_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#205 + sig { params(node: ::Prism::GlobalVariableReadNode).void } + def on_global_variable_read_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#210 + sig { params(node: ::Prism::GlobalVariableTargetNode).void } + def on_global_variable_target_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#215 + sig { params(node: ::Prism::GlobalVariableWriteNode).void } + def on_global_variable_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#230 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#199 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#235 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#204 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#240 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#184 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#220 sig { params(node: ::Prism::InstanceVariableReadNode).void } def on_instance_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#209 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#245 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#189 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#225 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end private - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#430 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#492 sig { params(node: ::Prism::CallNode, name: ::String).void } def add_keyword_completions(node, name); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#410 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#472 sig { params(node: ::Prism::CallNode, name: ::String).void } def add_local_completions(node, name); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#448 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#510 sig do params( label: ::String, @@ -2567,7 +2651,7 @@ class RubyLsp::Listeners::Completion end def build_completion(label, node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#471 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#533 sig do params( real_name: ::String, @@ -2579,23 +2663,27 @@ class RubyLsp::Listeners::Completion end def build_entry_completion(real_name, incomplete_name, range, entries, top_level); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#349 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#408 sig { params(node: ::Prism::CallNode, name: ::String).void } def complete_methods(node, name); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#304 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#363 sig { params(node: ::Prism::CallNode).void } def complete_require(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#320 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#379 sig { params(node: ::Prism::CallNode).void } def complete_require_relative(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#216 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#252 sig { params(name: ::String, range: ::LanguageServer::Protocol::Interface::Range).void } def constant_path_completion(name, range); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#271 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#307 + sig { params(name: ::String, location: ::Prism::Location).void } + def handle_global_variable_completion(name, location); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#330 sig { params(name: ::String, location: ::Prism::Location).void } def handle_instance_variable_completion(name, location); end @@ -2614,7 +2702,7 @@ class RubyLsp::Listeners::Completion # end # ``` # - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#560 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#622 sig { params(entry_name: ::String).returns(T::Boolean) } def top_level?(entry_name); end end @@ -2640,81 +2728,105 @@ class RubyLsp::Listeners::Definition end def initialize(response_builder, global_state, language_id, uri, node_context, dispatcher, sorbet_level); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#98 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#103 sig { params(node: ::Prism::BlockArgumentNode).void } def on_block_argument_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#57 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#62 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#109 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#114 sig { params(node: ::Prism::ConstantPathNode).void } def on_constant_path_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#117 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#122 sig { params(node: ::Prism::ConstantReadNode).void } def on_constant_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#179 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#195 sig { params(node: ::Prism::ForwardingSuperNode).void } def on_forwarding_super_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#125 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#130 + sig { params(node: ::Prism::GlobalVariableAndWriteNode).void } + def on_global_variable_and_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#135 + sig { params(node: ::Prism::GlobalVariableOperatorWriteNode).void } + def on_global_variable_operator_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#140 + sig { params(node: ::Prism::GlobalVariableOrWriteNode).void } + def on_global_variable_or_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#145 sig { params(node: ::Prism::GlobalVariableReadNode).void } def on_global_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#154 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#150 + sig { params(node: ::Prism::GlobalVariableTargetNode).void } + def on_global_variable_target_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#155 + sig { params(node: ::Prism::GlobalVariableWriteNode).void } + def on_global_variable_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#170 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#159 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#175 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#164 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#180 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#144 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#160 sig { params(node: ::Prism::InstanceVariableReadNode).void } def on_instance_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#169 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#185 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#149 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#165 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#76 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#81 sig { params(node: ::Prism::StringNode).void } def on_string_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#174 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#190 sig { params(node: ::Prism::SuperNode).void } def on_super_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#87 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#92 sig { params(node: ::Prism::SymbolNode).void } def on_symbol_node_enter(node); end private - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#301 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#336 sig { params(value: ::String).void } def find_in_index(value); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#290 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#325 sig { params(node: ::Prism::CallNode).void } def handle_autoload_definition(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#201 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#217 + sig { params(name: ::String).void } + def handle_global_variable_definition(name); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#236 sig { params(name: ::String).void } def handle_instance_variable_definition(name); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#228 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#263 sig do params( message: ::String, @@ -2724,11 +2836,11 @@ class RubyLsp::Listeners::Definition end def handle_method_definition(message, receiver_type, inherited_only: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#255 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#290 sig { params(node: ::Prism::StringNode, message: ::Symbol).void } def handle_require_definition(node, message); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#186 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#202 sig { void } def handle_super_node_definition; end end @@ -3316,7 +3428,7 @@ end class RubyLsp::Listeners::Hover include ::RubyLsp::Requests::Support::Common - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#50 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#56 sig do params( response_builder: RubyLsp::ResponseBuilders::Hover, @@ -3329,98 +3441,126 @@ class RubyLsp::Listeners::Hover end def initialize(response_builder, global_state, uri, node_context, dispatcher, sorbet_level); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#117 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#129 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#107 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#119 sig { params(node: ::Prism::ConstantPathNode).void } def on_constant_path_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#90 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#102 sig { params(node: ::Prism::ConstantReadNode).void } def on_constant_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#100 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#112 sig { params(node: ::Prism::ConstantWriteNode).void } def on_constant_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#167 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#209 sig { params(node: ::Prism::ForwardingSuperNode).void } def on_forwarding_super_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#142 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#144 + sig { params(node: ::Prism::GlobalVariableAndWriteNode).void } + def on_global_variable_and_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#149 + sig { params(node: ::Prism::GlobalVariableOperatorWriteNode).void } + def on_global_variable_operator_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#154 + sig { params(node: ::Prism::GlobalVariableOrWriteNode).void } + def on_global_variable_or_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#159 + sig { params(node: ::Prism::GlobalVariableReadNode).void } + def on_global_variable_read_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#164 + sig { params(node: ::Prism::GlobalVariableTargetNode).void } + def on_global_variable_target_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#169 + sig { params(node: ::Prism::GlobalVariableWriteNode).void } + def on_global_variable_write_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#184 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#147 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#189 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#152 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#194 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#132 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#174 sig { params(node: ::Prism::InstanceVariableReadNode).void } def on_instance_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#157 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#199 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#137 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#179 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#85 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#97 sig { params(node: ::Prism::InterpolatedStringNode).void } def on_interpolated_string_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#80 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#92 sig { params(node: ::Prism::StringNode).void } def on_string_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#162 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#204 sig { params(node: ::Prism::SuperNode).void } def on_super_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#172 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#214 sig { params(node: ::Prism::YieldNode).void } def on_yield_node_enter(node); end private - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#284 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#336 sig { params(node: ::Prism::CallNode).void } def generate_gem_hover(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#179 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#221 sig { params(node: T.any(::Prism::InterpolatedStringNode, ::Prism::StringNode)).void } def generate_heredoc_hover(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#269 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#321 sig { params(name: ::String, location: ::Prism::Location).void } def generate_hover(name, location); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#250 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#311 + sig { params(name: ::String).void } + def handle_global_variable_hover(name); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#292 sig { params(name: ::String).void } def handle_instance_variable_hover(name); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#204 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#246 sig { params(keyword: ::String).void } def handle_keyword_documentation(keyword); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#227 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#269 sig { params(message: ::String, inherited_only: T::Boolean).void } def handle_method_hover(message, inherited_only: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#216 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#258 sig { void } def handle_super_node_hover; end end -# source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#32 +# source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#38 RubyLsp::Listeners::Hover::ALLOWED_REMOTE_PROVIDERS = T.let(T.unsafe(nil), Array) # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#10 @@ -3715,11 +3855,40 @@ end # source://ruby-lsp/lib/ruby_lsp/utils.rb#63 class RubyLsp::Notification < ::RubyLsp::Message - # source://ruby-lsp/lib/ruby_lsp/utils.rb#87 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#150 sig { override.returns(T::Hash[::Symbol, T.untyped]) } def to_hash; end class << self + # source://ruby-lsp/lib/ruby_lsp/utils.rb#99 + sig do + params( + id: ::String, + title: ::String, + percentage: T.nilable(::Integer), + message: T.nilable(::String) + ).returns(::RubyLsp::Notification) + end + def progress_begin(id, title, percentage: T.unsafe(nil), message: T.unsafe(nil)); end + + # source://ruby-lsp/lib/ruby_lsp/utils.rb#136 + sig { params(id: ::String).returns(::RubyLsp::Notification) } + def progress_end(id); end + + # source://ruby-lsp/lib/ruby_lsp/utils.rb#121 + sig do + params( + id: ::String, + percentage: T.nilable(::Integer), + message: T.nilable(::String) + ).returns(::RubyLsp::Notification) + end + def progress_report(id, percentage: T.unsafe(nil), message: T.unsafe(nil)); end + + # source://ruby-lsp/lib/ruby_lsp/utils.rb#84 + sig { params(data: T::Hash[::Symbol, T.untyped]).returns(::RubyLsp::Notification) } + def telemetry(data); end + # source://ruby-lsp/lib/ruby_lsp/utils.rb#76 sig { params(message: ::String, type: ::Integer).returns(::RubyLsp::Notification) } def window_log_message(message, type: T.unsafe(nil)); end @@ -3753,35 +3922,35 @@ class RubyLsp::RBSDocument < ::RubyLsp::Document def syntax_error?; end end -# source://ruby-lsp/lib/ruby_lsp/utils.rb#92 +# source://ruby-lsp/lib/ruby_lsp/utils.rb#155 class RubyLsp::Request < ::RubyLsp::Message - # source://ruby-lsp/lib/ruby_lsp/utils.rb#96 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#159 sig { params(id: T.any(::Integer, ::String), method: ::String, params: ::Object).void } def initialize(id:, method:, params:); end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#102 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#165 sig { override.returns(T::Hash[::Symbol, T.untyped]) } def to_hash; end end # A request configuration, to turn on/off features # -# source://ruby-lsp/lib/ruby_lsp/utils.rb#157 +# source://ruby-lsp/lib/ruby_lsp/utils.rb#220 class RubyLsp::RequestConfig - # source://ruby-lsp/lib/ruby_lsp/utils.rb#164 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#227 sig { params(configuration: T::Hash[::Symbol, T::Boolean]).void } def initialize(configuration); end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#161 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#224 sig { returns(T::Hash[::Symbol, T::Boolean]) } def configuration; end # @return [Hash{Symbol => Boolean}] # - # source://ruby-lsp/lib/ruby_lsp/utils.rb#161 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#224 def configuration=(_arg0); end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#169 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#232 sig { params(feature: ::Symbol).returns(T.nilable(T::Boolean)) } def enabled?(feature); end end @@ -3944,7 +4113,7 @@ class RubyLsp::Requests::Completion < ::RubyLsp::Requests::Request end def initialize(document, global_state, params, sorbet_level, dispatcher); end - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#93 + # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#99 sig { override.returns(T::Array[::LanguageServer::Protocol::Interface::CompletionItem]) } def perform; end @@ -3997,7 +4166,7 @@ RubyLsp::Requests::CompletionResolve::MAX_DOCUMENTATION_ENTRIES = T.let(T.unsafe # # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#11 class RubyLsp::Requests::Definition < ::RubyLsp::Requests::Request - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#30 + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#24 sig do params( document: T.any(RubyLsp::ERBDocument, RubyLsp::RubyDocument), @@ -4009,16 +4178,19 @@ class RubyLsp::Requests::Definition < ::RubyLsp::Requests::Request end def initialize(document, global_state, position, dispatcher, sorbet_level); end - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#106 + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#101 sig do override .returns(T::Array[T.any(::LanguageServer::Protocol::Interface::Location, ::LanguageServer::Protocol::Interface::LocationLink)]) end def perform; end -end -# source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#15 -RubyLsp::Requests::Definition::SPECIAL_METHOD_CALLS = T.let(T.unsafe(nil), Array) + private + + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#109 + sig { params(position: T::Hash[::Symbol, T.untyped], target: T.nilable(::Prism::Node)).returns(T::Boolean) } + def position_outside_target?(position, target); end +end # The # [diagnostics](https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics) @@ -4103,20 +4275,21 @@ end # informs the editor of all the important symbols, such as classes, variables, and methods, defined in a file. With # this information, the editor can populate breadcrumbs, file outline and allow for fuzzy symbol searches. # -# In VS Code, fuzzy symbol search can be accessed by opening the command palette and inserting an `@` symbol. +# In VS Code, symbol search known as 'Go To Symbol in Editor' and can be accessed with Ctrl/Cmd-Shift-O, +# or by opening the command palette and inserting an `@` symbol. # -# source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#14 +# source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#15 class RubyLsp::Requests::DocumentSymbol < ::RubyLsp::Requests::Request - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#27 + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#28 sig { params(uri: ::URI::Generic, dispatcher: ::Prism::Dispatcher).void } def initialize(uri, dispatcher); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#38 + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#39 sig { override.returns(T::Array[::LanguageServer::Protocol::Interface::DocumentSymbol]) } def perform; end class << self - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#21 + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#22 sig { returns(::LanguageServer::Protocol::Interface::DocumentSymbolOptions) } def provider; end end @@ -4187,10 +4360,20 @@ class RubyLsp::Requests::Hover < ::RubyLsp::Requests::Request end def initialize(document, global_state, position, dispatcher, sorbet_level); end - # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#78 + # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#74 sig { override.returns(ResponseType) } def perform; end + private + + # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#99 + sig { params(position: T::Hash[::Symbol, T.untyped], target: T.nilable(::Prism::Node)).returns(T::Boolean) } + def position_outside_target?(position, target); end + + # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#92 + sig { params(parent: T.nilable(::Prism::Node), target: T.nilable(::Prism::Node)).returns(T::Boolean) } + def should_refine_target?(parent, target); end + class << self # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#18 sig { returns(::LanguageServer::Protocol::Interface::HoverOptions) } @@ -4816,14 +4999,14 @@ module RubyLsp::Requests::Support::Formatter def run_range_formatting(uri, source, base_indentation); end end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#23 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#33 class RubyLsp::Requests::Support::InternalRuboCopError < ::StandardError - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#33 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#43 sig { params(rubocop_error: T.any(::RuboCop::ErrorWithAnalyzedFileLocation, ::StandardError)).void } def initialize(rubocop_error); end end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#26 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#36 RubyLsp::Requests::Support::InternalRuboCopError::MESSAGE = T.let(T.unsafe(nil), String) # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb#7 @@ -4928,51 +5111,51 @@ class RubyLsp::Requests::Support::RuboCopFormatter def run_range_formatting(uri, source, base_indentation); end end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#45 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#55 class RubyLsp::Requests::Support::RuboCopRunner < ::RuboCop::Runner - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#75 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#85 sig { params(args: ::String).void } def initialize(*args); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#64 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#74 sig { returns(::RuboCop::Config) } def config_for_working_directory; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#114 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#124 sig { returns(::String) } def formatted_source; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#61 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#71 sig { returns(T::Array[::RuboCop::Cop::Offense]) } def offenses; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#92 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#102 sig { params(path: ::String, contents: ::String).void } def run(path, contents); end private - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#140 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#150 sig { params(_file: ::String, offenses: T::Array[::RuboCop::Cop::Offense]).void } def file_finished(_file, offenses); end class << self - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#122 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#132 sig { params(cop_name: ::String).returns(T.nilable(T.class_of(RuboCop::Cop::Base))) } def find_cop_by_name(cop_name); end private - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#129 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#139 sig { returns(T::Hash[::String, [T.class_of(RuboCop::Cop::Base)]]) } def cop_registry; end end end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#48 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#58 class RubyLsp::Requests::Support::RuboCopRunner::ConfigurationError < ::StandardError; end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#50 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#60 RubyLsp::Requests::Support::RuboCopRunner::DEFAULT_ARGS = T.let(T.unsafe(nil), Array) # source://ruby-lsp/lib/ruby_lsp/requests/support/selection_range.rb#7 @@ -5066,7 +5249,7 @@ class RubyLsp::ResponseBuilders::DocumentSymbol < ::RubyLsp::ResponseBuilders::R # @param symbol [Interface::DocumentSymbol] # @return [void] # - # source://sorbet-runtime/0.5.11604lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11633lib/types/private/methods/_methods.rb#257 def <<(*args, **_arg1, &blk); end # source://ruby-lsp/lib/ruby_lsp/response_builders/document_symbol.rb#47 @@ -5272,21 +5455,21 @@ end # The final result of running a request before its IO is finalized # -# source://ruby-lsp/lib/ruby_lsp/utils.rb#135 +# source://ruby-lsp/lib/ruby_lsp/utils.rb#198 class RubyLsp::Result - # source://ruby-lsp/lib/ruby_lsp/utils.rb#145 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#208 sig { params(id: ::Integer, response: T.untyped).void } def initialize(id:, response:); end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#142 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#205 sig { returns(::Integer) } def id; end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#139 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#202 sig { returns(T.untyped) } def response; end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#151 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#214 sig { returns(T::Hash[::Symbol, T.untyped]) } def to_hash; end end @@ -5409,7 +5592,7 @@ class RubyLsp::Server < ::RubyLsp::BaseServer sig { returns(::RubyLsp::GlobalState) } def global_state; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#142 + # source://ruby-lsp/lib/ruby_lsp/server.rb#153 sig { params(include_project_addons: T::Boolean).void } def load_addons(include_project_addons: T.unsafe(nil)); end @@ -5417,200 +5600,210 @@ class RubyLsp::Server < ::RubyLsp::BaseServer sig { override.params(message: T::Hash[::Symbol, T.untyped]).void } def process_message(message); end + # Process responses to requests that were sent to the client + # + # source://ruby-lsp/lib/ruby_lsp/server.rb#145 + sig { params(message: T::Hash[::Symbol, T.untyped]).void } + def process_response(message); end + private - # source://ruby-lsp/lib/ruby_lsp/server.rb#1079 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1114 sig { params(id: ::String, title: ::String, percentage: ::Integer).void } def begin_progress(id, title, percentage: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1140 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1144 sig { void } def check_formatter_is_available; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#765 + # source://ruby-lsp/lib/ruby_lsp/server.rb#800 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def code_action_resolve(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1122 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1134 sig { params(id: ::String).void } def end_progress(id); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1047 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1082 sig { void } def perform_initial_indexing; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1158 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1163 sig { params(indexing_options: T.nilable(T::Hash[::Symbol, T.untyped])).void } def process_indexing_configuration(indexing_options); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1103 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1127 sig { params(id: ::String, percentage: ::Integer).void } def progress(id, percentage); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#413 + # source://ruby-lsp/lib/ruby_lsp/server.rb#448 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def run_combined_requests(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#177 + # source://ruby-lsp/lib/ruby_lsp/server.rb#193 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def run_initialize(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#296 + # source://ruby-lsp/lib/ruby_lsp/server.rb#329 sig { void } def run_initialized; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1042 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1077 sig { override.void } def shutdown; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#701 + # source://ruby-lsp/lib/ruby_lsp/server.rb#736 sig { params(document: RubyLsp::Document[T.untyped]).returns(::RubyLsp::RubyDocument::SorbetLevel) } def sorbet_level(document); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#743 + # source://ruby-lsp/lib/ruby_lsp/server.rb#778 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_code_action(message); end # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11604lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11633lib/types/private/methods/_methods.rb#257 def text_document_code_lens(*args, **_arg1, &blk); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#830 + # source://ruby-lsp/lib/ruby_lsp/server.rb#865 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_completion(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#855 + # source://ruby-lsp/lib/ruby_lsp/server.rb#890 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_completion_item_resolve(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#900 + # source://ruby-lsp/lib/ruby_lsp/server.rb#935 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_definition(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#790 + # source://ruby-lsp/lib/ruby_lsp/server.rb#825 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_diagnostic(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#377 + # source://ruby-lsp/lib/ruby_lsp/server.rb#412 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_change(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#361 + # source://ruby-lsp/lib/ruby_lsp/server.rb#396 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_close(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#321 + # source://ruby-lsp/lib/ruby_lsp/server.rb#356 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_open(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#599 + # source://ruby-lsp/lib/ruby_lsp/server.rb#634 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_document_highlight(message); end # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11604lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11633lib/types/private/methods/_methods.rb#257 def text_document_document_link(*args, **_arg1, &blk); end # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11604lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11633lib/types/private/methods/_methods.rb#257 def text_document_document_symbol(*args, **_arg1, &blk); end # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11604lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11633lib/types/private/methods/_methods.rb#257 def text_document_folding_range(*args, **_arg1, &blk); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#560 + # source://ruby-lsp/lib/ruby_lsp/server.rb#595 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_formatting(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#638 + # source://ruby-lsp/lib/ruby_lsp/server.rb#673 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_hover(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#709 + # source://ruby-lsp/lib/ruby_lsp/server.rb#744 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_inlay_hint(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#615 + # source://ruby-lsp/lib/ruby_lsp/server.rb#650 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_on_type_formatting(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#984 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1019 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_prepare_type_hierarchy(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#532 + # source://ruby-lsp/lib/ruby_lsp/server.rb#567 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_range_formatting(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#683 + # source://ruby-lsp/lib/ruby_lsp/server.rb#718 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_references(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#663 + # source://ruby-lsp/lib/ruby_lsp/server.rb#698 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_rename(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#387 + # source://ruby-lsp/lib/ruby_lsp/server.rb#422 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_selection_range(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#478 + # source://ruby-lsp/lib/ruby_lsp/server.rb#513 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_semantic_tokens_delta(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#457 + # source://ruby-lsp/lib/ruby_lsp/server.rb#492 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_semantic_tokens_full(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#503 + # source://ruby-lsp/lib/ruby_lsp/server.rb#538 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_semantic_tokens_range(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#965 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1000 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_show_syntax_tree(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#874 + # source://ruby-lsp/lib/ruby_lsp/server.rb#909 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_signature_help(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1012 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1047 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def type_hierarchy_subtypes(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1003 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1038 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def type_hierarchy_supertypes(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1019 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1204 + sig { params(message: T::Hash[::Symbol, T.untyped]).void } + def window_show_message_request(message); end + + # source://ruby-lsp/lib/ruby_lsp/server.rb#1054 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_dependencies(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#925 + # source://ruby-lsp/lib/ruby_lsp/server.rb#960 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_did_change_watched_files(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#952 + # source://ruby-lsp/lib/ruby_lsp/server.rb#987 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_symbol(message); end end # source://ruby-lsp/lib/ruby_lsp/store.rb#5 class RubyLsp::Store - # source://ruby-lsp/lib/ruby_lsp/store.rb#20 + # source://ruby-lsp/lib/ruby_lsp/store.rb#17 sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_lsp/store.rb#122 + # source://ruby-lsp/lib/ruby_lsp/store.rb#118 sig do type_parameters(:T) .params( @@ -5621,53 +5814,53 @@ class RubyLsp::Store end def cache_fetch(uri, request_name, &block); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#88 + # source://ruby-lsp/lib/ruby_lsp/store.rb#84 sig { void } def clear; end - # source://ruby-lsp/lib/ruby_lsp/store.rb#17 + # source://ruby-lsp/lib/ruby_lsp/store.rb#14 sig { returns(::String) } def client_name; end # @return [String] # - # source://ruby-lsp/lib/ruby_lsp/store.rb#17 + # source://ruby-lsp/lib/ruby_lsp/store.rb#14 def client_name=(_arg0); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#98 + # source://ruby-lsp/lib/ruby_lsp/store.rb#94 sig { params(uri: ::URI::Generic).void } def delete(uri); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#108 + # source://ruby-lsp/lib/ruby_lsp/store.rb#104 sig { params(block: T.proc.params(uri: ::String, document: RubyLsp::Document[T.untyped]).void).void } def each(&block); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#93 + # source://ruby-lsp/lib/ruby_lsp/store.rb#89 sig { returns(T::Boolean) } def empty?; end - # source://ruby-lsp/lib/ruby_lsp/store.rb#14 + # source://ruby-lsp/lib/ruby_lsp/store.rb#11 sig { returns(T::Hash[::Symbol, ::RubyLsp::RequestConfig]) } def features_configuration; end # @return [Hash{Symbol => RequestConfig}] # - # source://ruby-lsp/lib/ruby_lsp/store.rb#14 + # source://ruby-lsp/lib/ruby_lsp/store.rb#11 def features_configuration=(_arg0); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#37 + # source://ruby-lsp/lib/ruby_lsp/store.rb#33 sig { params(uri: ::URI::Generic).returns(RubyLsp::Document[T.untyped]) } def get(uri); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#103 + # source://ruby-lsp/lib/ruby_lsp/store.rb#99 sig { params(uri: ::URI::Generic).returns(T::Boolean) } def key?(uri); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#83 + # source://ruby-lsp/lib/ruby_lsp/store.rb#79 sig { params(uri: ::URI::Generic, edits: T::Array[T::Hash[::Symbol, T.untyped]], version: ::Integer).void } def push_edits(uri:, edits:, version:); end - # source://ruby-lsp/lib/ruby_lsp/store.rb#71 + # source://ruby-lsp/lib/ruby_lsp/store.rb#67 sig do params( uri: ::URI::Generic, @@ -5678,15 +5871,6 @@ class RubyLsp::Store ).returns(RubyLsp::Document[T.untyped]) end def set(uri:, source:, version:, language_id:, encoding: T.unsafe(nil)); end - - # source://ruby-lsp/lib/ruby_lsp/store.rb#11 - sig { returns(T::Boolean) } - def supports_progress; end - - # @return [Boolean] - # - # source://ruby-lsp/lib/ruby_lsp/store.rb#11 - def supports_progress=(_arg0); end end # source://ruby-lsp/lib/ruby_lsp/store.rb#8 @@ -5785,14 +5969,14 @@ class URI::Source < ::URI::File sig { params(v: T.nilable(::String)).returns(T::Boolean) } def check_host(v); end - # source://uri/0.13.1uri/generic.rb#243 + # source://uri/0.13.0uri/generic.rb#243 def gem_name; end # source://ruby-lsp/lib/ruby_lsp/requests/support/source_uri.rb#33 sig { returns(T.nilable(::String)) } def gem_version; end - # source://uri/0.13.1uri/generic.rb#283 + # source://uri/0.13.0uri/generic.rb#283 def line_number; end # source://ruby-lsp/lib/ruby_lsp/requests/support/source_uri.rb#59 diff --git a/sorbet/rbi/shims/ruby_lsp.rbi b/sorbet/rbi/shims/ruby_lsp.rbi new file mode 100644 index 0000000..ca6957d --- /dev/null +++ b/sorbet/rbi/shims/ruby_lsp.rbi @@ -0,0 +1,11 @@ +# typed: strict +# frozen_string_literal: true + +module RubyIndexer + class Enhancement + # If we change ruby-lsp to use a `T.let` then this can be removed + def initialize(index) + @index = T.let(index, RubyIndexer::Index) + end + end +end