From cba97f807872bb441590bd9cd364574df3ad25f0 Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Thu, 21 Nov 2024 12:30:28 -0500 Subject: [PATCH] Update for changes to index enhancements API (#529) * Temporarily point to branch * Update for changes to enhancements API * Update shim --- Gemfile.lock | 4 +- lib/ruby_lsp/ruby_lsp_rails/addon.rb | 1 - .../ruby_lsp_rails/indexing_enhancement.rb | 71 +- ruby-lsp-rails.gemspec | 2 +- ...uby-lsp@0.21.2.rbi => ruby-lsp@0.22.0.rbi} | 539 ++-- sorbet/rbi/gems/webrick@1.8.2.rbi | 2622 ----------------- sorbet/rbi/shims/ruby_lsp.rbi | 4 +- test/dummy/app/models/concerns/verifiable.rb | 16 + test/dummy/app/models/user.rb | 2 + .../indexing_enhancement_test.rb | 2 - 10 files changed, 356 insertions(+), 2907 deletions(-) rename sorbet/rbi/gems/{ruby-lsp@0.21.2.rbi => ruby-lsp@0.22.0.rbi} (96%) delete mode 100644 sorbet/rbi/gems/webrick@1.8.2.rbi create mode 100644 test/dummy/app/models/concerns/verifiable.rb diff --git a/Gemfile.lock b/Gemfile.lock index 0f1bf98b..8cdc7c5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: ruby-lsp-rails (0.3.26) - ruby-lsp (>= 0.21.2, < 0.22.0) + ruby-lsp (>= 0.22.0, < 0.23.0) GEM remote: https://rubygems.org/ @@ -214,7 +214,7 @@ GEM rubocop (~> 1.51) rubocop-sorbet (0.8.7) rubocop (>= 1) - ruby-lsp (0.21.2) + ruby-lsp (0.22.0) language_server-protocol (~> 3.17.0) prism (>= 1.2, < 2.0) rbs (>= 3, < 4) diff --git a/lib/ruby_lsp/ruby_lsp_rails/addon.rb b/lib/ruby_lsp/ruby_lsp_rails/addon.rb index d7b6461e..3fce20b0 100644 --- a/lib/ruby_lsp/ruby_lsp_rails/addon.rb +++ b/lib/ruby_lsp/ruby_lsp_rails/addon.rb @@ -56,7 +56,6 @@ def activate(global_state, outgoing_queue) @outgoing_queue << Notification.window_log_message("Activating Ruby LSP Rails add-on v#{VERSION}") register_additional_file_watchers(global_state: global_state, outgoing_queue: outgoing_queue) - @global_state.index.register_enhancement(IndexingEnhancement.new(@global_state.index)) # Start booting the real client in a background thread. Until this completes, the client will be a NullClient @client_mutex.unlock diff --git a/lib/ruby_lsp/ruby_lsp_rails/indexing_enhancement.rb b/lib/ruby_lsp/ruby_lsp_rails/indexing_enhancement.rb index d0aca528..4925e28c 100644 --- a/lib/ruby_lsp/ruby_lsp_rails/indexing_enhancement.rb +++ b/lib/ruby_lsp/ruby_lsp_rails/indexing_enhancement.rb @@ -8,25 +8,18 @@ class IndexingEnhancement < RubyIndexer::Enhancement sig do override.params( - owner: T.nilable(RubyIndexer::Entry::Namespace), - node: Prism::CallNode, - file_path: String, - code_units_cache: T.any( - T.proc.params(arg0: Integer).returns(Integer), - Prism::CodeUnitsCache, - ), + call_node: Prism::CallNode, ).void end - def on_call_node_enter(owner, node, file_path, code_units_cache) + def on_call_node_enter(call_node) + owner = @listener.current_owner return unless owner - name = node.name - - case name + case call_node.name when :extend - handle_concern_extend(owner, node) + handle_concern_extend(owner, call_node) when :has_one, :has_many, :belongs_to, :has_and_belongs_to_many - handle_association(owner, node, file_path, code_units_cache) + handle_association(owner, call_node) end end @@ -35,16 +28,11 @@ def on_call_node_enter(owner, node, file_path, code_units_cache) sig do params( owner: RubyIndexer::Entry::Namespace, - node: Prism::CallNode, - file_path: String, - code_units_cache: T.any( - T.proc.params(arg0: Integer).returns(Integer), - Prism::CodeUnitsCache, - ), + call_node: Prism::CallNode, ).void end - def handle_association(owner, node, file_path, code_units_cache) - arguments = node.arguments&.arguments + def handle_association(owner, call_node) + arguments = call_node.arguments&.arguments return unless arguments name_arg = arguments.first @@ -58,41 +46,22 @@ def handle_association(owner, node, file_path, code_units_cache) return unless name - loc = RubyIndexer::Location.from_prism_location(name_arg.location, code_units_cache) + loc = name_arg.location # Reader - @index.add(RubyIndexer::Entry::Method.new( - name, - file_path, - loc, - loc, - nil, - [RubyIndexer::Entry::Signature.new([])], - RubyIndexer::Entry::Visibility::PUBLIC, - owner, - )) + reader_signatures = [RubyIndexer::Entry::Signature.new([])] + @listener.add_method(name, loc, reader_signatures) # Writer - @index.add(RubyIndexer::Entry::Method.new( - "#{name}=", - file_path, - loc, - loc, - nil, - [RubyIndexer::Entry::Signature.new([RubyIndexer::Entry::RequiredParameter.new(name: name.to_sym)])], - RubyIndexer::Entry::Visibility::PUBLIC, - owner, - )) + writer_signatures = [ + RubyIndexer::Entry::Signature.new([RubyIndexer::Entry::RequiredParameter.new(name: name.to_sym)]), + ] + @listener.add_method("#{name}=", loc, writer_signatures) end - sig do - params( - owner: RubyIndexer::Entry::Namespace, - node: Prism::CallNode, - ).void - end - def handle_concern_extend(owner, node) - arguments = node.arguments&.arguments + sig { params(owner: RubyIndexer::Entry::Namespace, call_node: Prism::CallNode).void } + def handle_concern_extend(owner, call_node) + arguments = call_node.arguments&.arguments return unless arguments arguments.each do |node| @@ -101,7 +70,7 @@ def handle_concern_extend(owner, node) module_name = node.full_name next unless module_name == "ActiveSupport::Concern" - @index.register_included_hook(owner.name) do |index, base| + @listener.register_included_hook do |index, base| class_methods_name = "#{owner.name}::ClassMethods" if index.indexed?(class_methods_name) diff --git a/ruby-lsp-rails.gemspec b/ruby-lsp-rails.gemspec index 827d0e90..98bcc8ae 100644 --- a/ruby-lsp-rails.gemspec +++ b/ruby-lsp-rails.gemspec @@ -24,5 +24,5 @@ Gem::Specification.new do |spec| Dir["lib/**/*", "LICENSE.txt", "Rakefile", "README.md"] end - spec.add_dependency("ruby-lsp", ">= 0.21.2", "< 0.22.0") + spec.add_dependency("ruby-lsp", ">= 0.22.0", "< 0.23.0") end diff --git a/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi b/sorbet/rbi/gems/ruby-lsp@0.22.0.rbi similarity index 96% rename from sorbet/rbi/gems/ruby-lsp@0.21.2.rbi rename to sorbet/rbi/gems/ruby-lsp@0.22.0.rbi index 8d862182..b6ab9075 100644 --- a/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi +++ b/sorbet/rbi/gems/ruby-lsp@0.22.0.rbi @@ -14,7 +14,7 @@ class RubyIndexer::Configuration sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#223 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#229 sig { params(config: T::Hash[::String, T.untyped]).void } def apply_config(config); end @@ -31,7 +31,7 @@ class RubyIndexer::Configuration sig { returns(T::Array[::RubyIndexer::IndexablePath]) } def indexables; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#218 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#224 sig { returns(::Regexp) } def magic_comment_regex; end @@ -45,13 +45,13 @@ class RubyIndexer::Configuration private - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#251 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#257 sig { returns(T::Array[::String]) } def initial_excluded_gems; end # @raise [ArgumentError] # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#236 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#242 sig { params(config: T::Hash[::String, T.untyped]).void } def validate_config!(config); end end @@ -61,32 +61,70 @@ RubyIndexer::Configuration::CONFIGURATION_SCHEMA = T.let(T.unsafe(nil), Hash) # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#5 class RubyIndexer::DeclarationListener - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#24 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#23 sig do params( index: ::RubyIndexer::Index, dispatcher: ::Prism::Dispatcher, parse_result: ::Prism::ParseResult, file_path: ::String, - collect_comments: T::Boolean, - enhancements: T::Array[::RubyIndexer::Enhancement] + collect_comments: T::Boolean + ).void + end + def initialize(index, dispatcher, parse_result, file_path, collect_comments: T.unsafe(nil)); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#490 + sig do + params( + name_or_nesting: T.any(::String, T::Array[::String]), + full_location: ::Prism::Location, + name_location: ::Prism::Location, + parent_class_name: T.nilable(::String), + comments: T.nilable(::String) + ).void + end + def add_class(name_or_nesting, full_location, name_location, parent_class_name: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#443 + sig do + params( + name: ::String, + node_location: ::Prism::Location, + signatures: T::Array[::RubyIndexer::Entry::Signature], + visibility: ::RubyIndexer::Entry::Visibility, + comments: T.nilable(::String) + ).void + end + def add_method(name, node_location, signatures, visibility: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#466 + sig do + params( + name: ::String, + full_location: ::Prism::Location, + name_location: ::Prism::Location, + comments: T.nilable(::String) ).void end - def initialize(index, dispatcher, parse_result, file_path, collect_comments: T.unsafe(nil), enhancements: T.unsafe(nil)); end + def add_module(name, full_location, name_location, comments: T.unsafe(nil)); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#522 + sig { returns(T.nilable(::RubyIndexer::Entry::Namespace)) } + def current_owner; end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#12 sig { returns(T::Array[::String]) } def indexing_errors; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#451 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#419 sig { params(node: ::Prism::AliasMethodNode).void } def on_alias_method_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#293 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#261 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#329 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#297 sig { params(node: ::Prism::CallNode).void } def on_call_node_leave(node); end @@ -94,117 +132,125 @@ class RubyIndexer::DeclarationListener sig { params(node: ::Prism::ClassNode).void } def on_class_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#130 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#119 sig { params(node: ::Prism::ClassNode).void } def on_class_node_leave(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#281 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#249 sig { params(node: ::Prism::ConstantAndWriteNode).void } def on_constant_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#287 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#255 sig { params(node: ::Prism::ConstantOperatorWriteNode).void } def on_constant_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#275 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#243 sig { params(node: ::Prism::ConstantOrWriteNode).void } def on_constant_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#259 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#227 sig { params(node: ::Prism::ConstantPathAndWriteNode).void } def on_constant_path_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#249 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#217 sig { params(node: ::Prism::ConstantPathOperatorWriteNode).void } def on_constant_path_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#239 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#207 sig { params(node: ::Prism::ConstantPathOrWriteNode).void } def on_constant_path_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#229 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#197 sig { params(node: ::Prism::ConstantPathWriteNode).void } def on_constant_path_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#269 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#237 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#350 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#318 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#391 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#359 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#401 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#369 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#406 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#374 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#411 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#379 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#416 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#384 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#421 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#389 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#431 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#399 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#436 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#404 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#441 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#409 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#446 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#414 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#426 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#394 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#137 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#124 sig { params(node: ::Prism::ModuleNode).void } def on_module_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#158 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#130 sig { params(node: ::Prism::ModuleNode).void } def on_module_node_leave(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#209 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#177 sig { params(node: ::Prism::MultiWriteNode).void } def on_multi_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#165 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#135 sig { params(node: ::Prism::SingletonClassNode).void } def on_singleton_class_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#202 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#172 sig { params(node: ::Prism::SingletonClassNode).void } def on_singleton_class_node_leave(node); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#515 + sig { void } + def pop_namespace_stack; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#505 + sig { params(block: T.proc.params(index: ::RubyIndexer::Index, base: ::RubyIndexer::Entry::Namespace).void).void } + def register_included_hook(&block); end + private - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#901 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#971 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#607 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#667 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 +260,35 @@ 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#658 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#985 + sig { params(short_name: ::String, entry: ::RubyIndexer::Entry::Namespace).void } + def advance_namespace_stack(short_name, entry); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#718 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#809 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#746 + sig { params(line: ::Integer).returns(T::Boolean) } + def comment_exists_at?(line); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#879 sig { returns(::RubyIndexer::Entry::Visibility) } def current_visibility; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#687 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#751 sig { params(name: ::String).returns(::String) } def fully_qualify_name(name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#551 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#611 sig { params(node: ::Prism::CallNode).void } def handle_alias_method(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#696 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#760 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#480 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#540 sig do params( node: T.any(::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableTargetNode, ::Prism::GlobalVariableWriteNode), @@ -243,7 +297,7 @@ class RubyIndexer::DeclarationListener end def handle_global_variable(node, loc); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#504 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#564 sig do params( node: T.any(::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableTargetNode, ::Prism::InstanceVariableWriteNode), @@ -252,19 +306,19 @@ class RubyIndexer::DeclarationListener end def handle_instance_variable(node, loc); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#767 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#837 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 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#803 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#526 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#586 sig { params(node: ::Prism::CallNode).void } def handle_private_constant(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#814 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#884 sig do params( parameters_node: T.nilable(::Prism::ParametersNode) @@ -272,7 +326,7 @@ class RubyIndexer::DeclarationListener end def list_params(parameters_node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#876 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#946 sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::Symbol)) } def parameter_name(node); end end @@ -289,37 +343,37 @@ RubyIndexer::DeclarationListener::OBJECT_NESTING = T.let(T.unsafe(nil), Array) class RubyIndexer::Enhancement abstract! - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#12 - sig { params(index: ::RubyIndexer::Index).void } - def initialize(index); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#35 + sig { params(listener: ::RubyIndexer::DeclarationListener).void } + def initialize(listener); 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 # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#30 - 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_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 + sig { overridable.params(node: ::Prism::CallNode).void } + def on_call_node_enter(node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#46 + sig { overridable.params(node: ::Prism::CallNode).void } + def on_call_node_leave(node); end + + class << self + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#23 + sig { params(listener: ::RubyIndexer::DeclarationListener).returns(T::Array[::RubyIndexer::Enhancement]) } + def all(listener); end + + # Only available for testing purposes + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#29 + sig { void } + def clear; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb#17 + sig { params(child: T::Class[::RubyIndexer::Enhancement]).void } + def inherited(child); end 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 @@ -884,23 +938,23 @@ end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#5 class RubyIndexer::Index - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#18 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#19 sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#104 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#96 sig { params(fully_qualified_name: ::String).returns(T.nilable(T::Array[::RubyIndexer::Entry])) } def [](fully_qualified_name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#95 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#87 sig { params(entry: ::RubyIndexer::Entry, skip_prefix_tree: T::Boolean).void } def add(entry, skip_prefix_tree: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#15 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#16 sig { returns(::RubyIndexer::Configuration) } def configuration; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#256 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#248 sig do params( name: ::String, @@ -909,7 +963,7 @@ class RubyIndexer::Index end def constant_completion_candidates(name, nesting); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#67 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#59 sig { params(indexable: ::RubyIndexer::IndexablePath).void } def delete(indexable); end @@ -934,7 +988,7 @@ class RubyIndexer::Index # Searches for a constant based on an unqualified name and returns the first possible match regardless of whether # there are more possible matching entries # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#125 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#117 sig do params( name: ::String @@ -959,7 +1013,7 @@ class RubyIndexer::Index # Fuzzy searches index entries based on Jaro-Winkler similarity. If no query is provided, all entries are returned # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#174 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#166 sig { params(query: T.nilable(::String)).returns(T::Array[::RubyIndexer::Entry]) } def fuzzy_search(query); end @@ -974,7 +1028,7 @@ class RubyIndexer::Index # and control indexing progress. That block is invoked with the current progress percentage and should return `true` # to continue indexing or `false` to stop indexing. # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#362 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#354 sig do params( indexable_paths: T::Array[::RubyIndexer::IndexablePath], @@ -983,7 +1037,7 @@ class RubyIndexer::Index end def index_all(indexable_paths: T.unsafe(nil), &block); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#378 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#379 sig do params( indexable_path: ::RubyIndexer::IndexablePath, @@ -1023,7 +1077,7 @@ class RubyIndexer::Index sig { params(fully_qualified_name: ::String).returns(T::Array[::String]) } def linearized_ancestors_of(fully_qualified_name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#203 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#195 sig do params( name: T.nilable(::String), @@ -1050,7 +1104,7 @@ class RubyIndexer::Index # ] # ``` # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#155 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#147 sig do params( query: ::String, @@ -1059,15 +1113,9 @@ class RubyIndexer::Index end def prefix_search(query, nesting = T.unsafe(nil)); end - # Register an enhancement to the index. Enhancements must conform to the `Enhancement` interface - # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#56 - sig { params(enhancement: ::RubyIndexer::Enhancement).void } - def register_enhancement(enhancement); end - # Register an included `hook` that will be executed when `module_name` is included into any namespace # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#62 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#54 sig do params( module_name: ::String, @@ -1084,7 +1132,7 @@ class RubyIndexer::Index # seen_names: this parameter should not be used by consumers of the api. It is used to avoid infinite recursion when # resolving circular references # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#321 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#313 sig do params( name: ::String, @@ -1121,7 +1169,7 @@ class RubyIndexer::Index end def resolve_method(method_name, receiver_name, seen_names = T.unsafe(nil), inherited_only: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#109 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#101 sig { params(query: ::String).returns(T::Array[::RubyIndexer::IndexablePath]) } def search_require_paths(query); end @@ -1237,9 +1285,12 @@ end # The minimum Jaro-Winkler similarity score for an entry to be considered a match for a given fuzzy search query # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#12 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#13 RubyIndexer::Index::ENTRY_SIMILARITY_THRESHOLD = T.let(T.unsafe(nil), Float) +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#10 +class RubyIndexer::Index::IndexNotEmptyError < ::StandardError; end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#9 class RubyIndexer::Index::NonExistingNamespaceError < ::StandardError; end @@ -2349,18 +2400,18 @@ class RubyLsp::GlobalState sig { returns(::RubyLsp::ClientCapabilities) } def client_capabilities; end + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#148 + sig { params(flag: ::Symbol).returns(T.nilable(T::Boolean)) } + def enabled_feature?(flag); 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#151 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#158 sig { returns(::String) } def encoding_name; end - # 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 sig { returns(::String) } def formatter; end @@ -2386,7 +2437,7 @@ class RubyLsp::GlobalState 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#163 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#170 sig { returns(T::Boolean) } def supports_watching_files; end @@ -2394,57 +2445,56 @@ class RubyLsp::GlobalState sig { returns(::String) } def test_library; end - # @return [Boolean] - # # source://ruby-lsp/lib/ruby_lsp/global_state.rb#24 + sig { returns(T::Boolean) } 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#146 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#153 sig { returns(::String) } def workspace_path; end private - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#226 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#233 sig { returns(T::Boolean) } def bin_rails_present; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#170 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#177 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#186 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#193 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#197 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#204 sig { params(dependencies: T::Array[::String]).returns(::String) } def detect_test_library(dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#217 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#224 sig { params(dependencies: T::Array[::String]).returns(T::Boolean) } def detect_typechecker(dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#231 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#238 sig { returns(T::Boolean) } def dot_rubocop_yml_present; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#253 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#260 sig { returns(T::Array[::String]) } def gather_direct_and_indirect_dependencies; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#236 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#243 sig { returns(T::Array[::String]) } def gather_direct_dependencies; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#246 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#253 sig { returns(T::Array[::String]) } def gemspec_dependencies; end end @@ -2852,216 +2902,253 @@ RubyLsp::Listeners::Definition::MAX_NUMBER_OF_DEFINITION_CANDIDATES_WITHOUT_RECE class RubyLsp::Listeners::DocumentHighlight include ::RubyLsp::Requests::Support::Common - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#97 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#98 sig do params( response_builder: RubyLsp::ResponseBuilders::CollectionResponseBuilder[::LanguageServer::Protocol::Interface::DocumentHighlight], target: T.nilable(::Prism::Node), parent: T.nilable(::Prism::Node), - dispatcher: ::Prism::Dispatcher + dispatcher: ::Prism::Dispatcher, + position: T::Hash[::Symbol, T.untyped] ).void end - def initialize(response_builder, target, parent, dispatcher); end + def initialize(response_builder, target, parent, dispatcher, position); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#240 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#254 sig { params(node: ::Prism::BlockParameterNode).void } def on_block_parameter_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#180 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#192 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#254 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#540 + sig { params(node: ::Prism::CaseNode).void } + def on_case_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#268 sig { params(node: ::Prism::ClassNode).void } def on_class_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#424 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#442 sig { params(node: ::Prism::ClassVariableAndWriteNode).void } def on_class_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#417 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#435 sig { params(node: ::Prism::ClassVariableOperatorWriteNode).void } def on_class_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#410 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#428 sig { params(node: ::Prism::ClassVariableOrWriteNode).void } def on_class_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#296 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#314 sig { params(node: ::Prism::ClassVariableReadNode).void } def on_class_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#226 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#240 sig { params(node: ::Prism::ClassVariableTargetNode).void } def on_class_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#403 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#421 sig { params(node: ::Prism::ClassVariableWriteNode).void } def on_class_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#480 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#498 sig { params(node: ::Prism::ConstantAndWriteNode).void } def on_constant_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#445 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#463 sig { params(node: ::Prism::ConstantOperatorWriteNode).void } def on_constant_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#438 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#456 sig { params(node: ::Prism::ConstantOrWriteNode).void } def on_constant_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#324 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#342 sig { params(node: ::Prism::ConstantPathAndWriteNode).void } def on_constant_path_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#275 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#293 sig { params(node: ::Prism::ConstantPathNode).void } def on_constant_path_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#331 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#349 sig { params(node: ::Prism::ConstantPathOperatorWriteNode).void } def on_constant_path_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#317 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#335 sig { params(node: ::Prism::ConstantPathOrWriteNode).void } def on_constant_path_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#212 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#226 sig { params(node: ::Prism::ConstantPathTargetNode).void } def on_constant_path_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#310 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#328 sig { params(node: ::Prism::ConstantPathWriteNode).void } def on_constant_path_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#282 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#300 sig { params(node: ::Prism::ConstantReadNode).void } def on_constant_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#219 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#233 sig { params(node: ::Prism::ConstantTargetNode).void } def on_constant_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#431 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#449 sig { params(node: ::Prism::ConstantWriteNode).void } def on_constant_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#191 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#203 sig { params(node: ::Prism::DefNode).void } def on_def_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#501 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#561 + sig { params(node: ::Prism::ForNode).void } + def on_for_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#519 sig { params(node: ::Prism::GlobalVariableAndWriteNode).void } def on_global_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#508 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#526 sig { params(node: ::Prism::GlobalVariableOperatorWriteNode).void } def on_global_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#494 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#512 sig { params(node: ::Prism::GlobalVariableOrWriteNode).void } def on_global_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#303 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#321 sig { params(node: ::Prism::GlobalVariableReadNode).void } def on_global_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#198 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#212 sig { params(node: ::Prism::GlobalVariableTargetNode).void } def on_global_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#487 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#505 sig { params(node: ::Prism::GlobalVariableWriteNode).void } def on_global_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#466 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#568 + sig { params(node: ::Prism::IfNode).void } + def on_if_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#484 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#473 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#491 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#459 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#477 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#289 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#307 sig { params(node: ::Prism::InstanceVariableReadNode).void } def on_instance_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#205 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#219 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#452 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#470 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#374 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#392 sig { params(node: ::Prism::KeywordRestParameterNode).void } def on_keyword_rest_parameter_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#382 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#400 sig { params(node: ::Prism::LocalVariableAndWriteNode).void } def on_local_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#389 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#407 sig { params(node: ::Prism::LocalVariableOperatorWriteNode).void } def on_local_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#396 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#414 sig { params(node: ::Prism::LocalVariableOrWriteNode).void } def on_local_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#268 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#286 sig { params(node: ::Prism::LocalVariableReadNode).void } def on_local_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#233 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#247 sig { params(node: ::Prism::LocalVariableTargetNode).void } def on_local_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#338 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#356 sig { params(node: ::Prism::LocalVariableWriteNode).void } def on_local_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#261 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#277 sig { params(node: ::Prism::ModuleNode).void } def on_module_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#352 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#370 sig { params(node: ::Prism::OptionalKeywordParameterNode).void } def on_optional_keyword_parameter_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#367 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#385 sig { params(node: ::Prism::OptionalParameterNode).void } def on_optional_parameter_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#345 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#363 sig { params(node: ::Prism::RequiredKeywordParameterNode).void } def on_required_keyword_parameter_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#247 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#261 sig { params(node: ::Prism::RequiredParameterNode).void } def on_required_parameter_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#359 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#377 sig { params(node: ::Prism::RestParameterNode).void } def on_rest_parameter_node_enter(node); end + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#533 + sig { params(node: ::Prism::SingletonClassNode).void } + def on_singleton_class_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#575 + sig { params(node: ::Prism::UnlessNode).void } + def on_unless_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#554 + sig { params(node: ::Prism::UntilNode).void } + def on_until_node_enter(node); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#547 + sig { params(node: ::Prism::WhileNode).void } + def on_while_node_enter(node); end + private - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#522 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#589 sig { params(kind: ::Integer, location: ::Prism::Location).void } def add_highlight(kind, location); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#517 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#622 + sig { params(keyword_loc: T.nilable(::Prism::Location), end_loc: T.nilable(::Prism::Location)).void } + def add_matching_end_highlights(keyword_loc, end_loc); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#631 + sig { params(location: ::Prism::Location).returns(T::Boolean) } + def covers_target_position?(location); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#584 sig { params(node: ::Prism::Node, classes: T::Array[T.class_of(Prism::Node)]).returns(T.nilable(T::Boolean)) } def matches?(node, classes); end - # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#527 + # source://ruby-lsp/lib/ruby_lsp/listeners/document_highlight.rb#594 sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::String)) } def node_value(node); end end @@ -4244,7 +4331,7 @@ class RubyLsp::Requests::DocumentHighlight < ::RubyLsp::Requests::Request end def initialize(global_state, document, position, dispatcher); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#45 + # source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#51 sig { override.returns(T::Array[::LanguageServer::Protocol::Interface::DocumentHighlight]) } def perform; end end @@ -4999,14 +5086,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#33 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#34 class RubyLsp::Requests::Support::InternalRuboCopError < ::StandardError - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#43 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#44 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#36 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#37 RubyLsp::Requests::Support::InternalRuboCopError::MESSAGE = T.let(T.unsafe(nil), String) # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb#7 @@ -5111,51 +5198,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#55 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#56 class RubyLsp::Requests::Support::RuboCopRunner < ::RuboCop::Runner - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#85 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#86 sig { params(args: ::String).void } def initialize(*args); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#74 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#75 sig { returns(::RuboCop::Config) } def config_for_working_directory; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#124 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#125 sig { returns(::String) } def formatted_source; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#71 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#72 sig { returns(T::Array[::RuboCop::Cop::Offense]) } def offenses; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#102 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#103 sig { params(path: ::String, contents: ::String).void } def run(path, contents); end private - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#150 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#151 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#132 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#133 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#139 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#140 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#58 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#59 class RubyLsp::Requests::Support::RuboCopRunner::ConfigurationError < ::StandardError; end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#60 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#61 RubyLsp::Requests::Support::RuboCopRunner::DEFAULT_ARGS = T.let(T.unsafe(nil), Array) # source://ruby-lsp/lib/ruby_lsp/requests/support/selection_range.rb#7 @@ -5608,35 +5695,35 @@ class RubyLsp::Server < ::RubyLsp::BaseServer private - # source://ruby-lsp/lib/ruby_lsp/server.rb#1114 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1127 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#1144 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1157 sig { void } def check_formatter_is_available; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#800 + # source://ruby-lsp/lib/ruby_lsp/server.rb#813 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def code_action_resolve(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1134 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1147 sig { params(id: ::String).void } def end_progress(id); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1082 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1095 sig { void } def perform_initial_indexing; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1163 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1176 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#1127 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1140 sig { params(id: ::String, percentage: ::Integer).void } def progress(id, percentage); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#448 + # source://ruby-lsp/lib/ruby_lsp/server.rb#456 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def run_combined_requests(message); end @@ -5644,19 +5731,19 @@ class RubyLsp::Server < ::RubyLsp::BaseServer sig { params(message: T::Hash[::Symbol, T.untyped]).void } def run_initialize(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#329 + # source://ruby-lsp/lib/ruby_lsp/server.rb#337 sig { void } def run_initialized; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1077 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1090 sig { override.void } def shutdown; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#736 + # source://ruby-lsp/lib/ruby_lsp/server.rb#749 sig { params(document: RubyLsp::Document[T.untyped]).returns(::RubyLsp::RubyDocument::SorbetLevel) } def sorbet_level(document); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#778 + # source://ruby-lsp/lib/ruby_lsp/server.rb#791 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_code_action(message); end @@ -5666,35 +5753,35 @@ class RubyLsp::Server < ::RubyLsp::BaseServer # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def text_document_code_lens(*args, **_arg1, &blk); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#865 + # source://ruby-lsp/lib/ruby_lsp/server.rb#878 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_completion(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#890 + # source://ruby-lsp/lib/ruby_lsp/server.rb#903 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#935 + # source://ruby-lsp/lib/ruby_lsp/server.rb#948 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_definition(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#825 + # source://ruby-lsp/lib/ruby_lsp/server.rb#838 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_diagnostic(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#412 + # source://ruby-lsp/lib/ruby_lsp/server.rb#420 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_change(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#396 + # source://ruby-lsp/lib/ruby_lsp/server.rb#404 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_close(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#356 + # source://ruby-lsp/lib/ruby_lsp/server.rb#364 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_open(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#634 + # source://ruby-lsp/lib/ruby_lsp/server.rb#647 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_document_highlight(message); end @@ -5716,83 +5803,83 @@ class RubyLsp::Server < ::RubyLsp::BaseServer # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def text_document_folding_range(*args, **_arg1, &blk); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#595 + # source://ruby-lsp/lib/ruby_lsp/server.rb#603 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_formatting(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#673 + # source://ruby-lsp/lib/ruby_lsp/server.rb#686 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_hover(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#744 + # source://ruby-lsp/lib/ruby_lsp/server.rb#757 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_inlay_hint(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#650 + # source://ruby-lsp/lib/ruby_lsp/server.rb#663 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#1019 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1032 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#567 + # source://ruby-lsp/lib/ruby_lsp/server.rb#575 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_range_formatting(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#718 + # source://ruby-lsp/lib/ruby_lsp/server.rb#731 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_references(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#698 + # source://ruby-lsp/lib/ruby_lsp/server.rb#711 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_rename(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#422 + # source://ruby-lsp/lib/ruby_lsp/server.rb#430 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_selection_range(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#513 + # source://ruby-lsp/lib/ruby_lsp/server.rb#521 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#492 + # source://ruby-lsp/lib/ruby_lsp/server.rb#500 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#538 + # source://ruby-lsp/lib/ruby_lsp/server.rb#546 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#1000 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1013 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#909 + # source://ruby-lsp/lib/ruby_lsp/server.rb#922 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_signature_help(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1047 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1060 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def type_hierarchy_subtypes(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1038 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1051 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def type_hierarchy_supertypes(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#1204 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1217 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 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1067 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_dependencies(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#960 + # source://ruby-lsp/lib/ruby_lsp/server.rb#973 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#987 + # source://ruby-lsp/lib/ruby_lsp/server.rb#1000 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_symbol(message); end end @@ -5951,7 +6038,7 @@ RubyLsp::VERSION = T.let(T.unsafe(nil), String) # source://ruby-lsp/lib/core_ext/uri.rb#5 class URI::Generic - include ::URI::RFC2396_REGEXP + include ::URI end # Avoid a deprecation warning with Ruby 3.4 where the default parser was changed to RFC3986. @@ -5969,14 +6056,14 @@ class URI::Source < ::URI::File sig { params(v: T.nilable(::String)).returns(T::Boolean) } def check_host(v); end - # source://uri/0.13.1lib/uri/generic.rb#243 + # source://uri/1.0.1lib/uri/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.1lib/uri/generic.rb#283 + # source://uri/1.0.1lib/uri/generic.rb#283 def line_number; end # source://ruby-lsp/lib/ruby_lsp/requests/support/source_uri.rb#59 diff --git a/sorbet/rbi/gems/webrick@1.8.2.rbi b/sorbet/rbi/gems/webrick@1.8.2.rbi deleted file mode 100644 index a7e51c79..00000000 --- a/sorbet/rbi/gems/webrick@1.8.2.rbi +++ /dev/null @@ -1,2622 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `webrick` gem. -# Please instead update this file by running `bin/tapioca gem webrick`. - - -# AccessLog provides logging to various files in various formats. -# -# Multiple logs may be written to at the same time: -# -# access_log = [ -# [$stderr, WEBrick::AccessLog::COMMON_LOG_FORMAT], -# [$stderr, WEBrick::AccessLog::REFERER_LOG_FORMAT], -# ] -# -# server = WEBrick::HTTPServer.new :AccessLog => access_log -# -# Custom log formats may be defined. WEBrick::AccessLog provides a subset -# of the formatting from Apache's mod_log_config -# http://httpd.apache.org/docs/mod/mod_log_config.html#formats. See -# AccessLog::setup_params for a list of supported options -# -# source://webrick/lib/webrick/accesslog.rb#30 -module WEBrick::AccessLog - private - - # Escapes control characters in +data+ - # - # source://webrick/lib/webrick/accesslog.rb#151 - def escape(data); end - - # Formats +params+ according to +format_string+ which is described in - # setup_params. - # - # source://webrick/lib/webrick/accesslog.rb#123 - def format(format_string, params); end - - # This format specification is a subset of mod_log_config of Apache: - # - # %a:: Remote IP address - # %b:: Total response size - # %e{variable}:: Given variable in ENV - # %f:: Response filename - # %h:: Remote host name - # %{header}i:: Given request header - # %l:: Remote logname, always "-" - # %m:: Request method - # %{attr}n:: Given request attribute from req.attributes - # %{header}o:: Given response header - # %p:: Server's request port - # %{format}p:: The canonical port of the server serving the request or the - # actual port or the client's actual port. Valid formats are - # canonical, local or remote. - # %q:: Request query string - # %r:: First line of the request - # %s:: Request status - # %t:: Time the request was received - # %T:: Time taken to process the request - # %u:: Remote user from auth - # %U:: Unparsed URI - # %%:: Literal % - # - # source://webrick/lib/webrick/accesslog.rb#95 - def setup_params(config, req, res); end - - class << self - # Escapes control characters in +data+ - # - # source://webrick/lib/webrick/accesslog.rb#151 - def escape(data); end - - # Formats +params+ according to +format_string+ which is described in - # setup_params. - # - # source://webrick/lib/webrick/accesslog.rb#123 - def format(format_string, params); end - - # This format specification is a subset of mod_log_config of Apache: - # - # %a:: Remote IP address - # %b:: Total response size - # %e{variable}:: Given variable in ENV - # %f:: Response filename - # %h:: Remote host name - # %{header}i:: Given request header - # %l:: Remote logname, always "-" - # %m:: Request method - # %{attr}n:: Given request attribute from req.attributes - # %{header}o:: Given response header - # %p:: Server's request port - # %{format}p:: The canonical port of the server serving the request or the - # actual port or the client's actual port. Valid formats are - # canonical, local or remote. - # %q:: Request query string - # %r:: First line of the request - # %s:: Request status - # %t:: Time the request was received - # %T:: Time taken to process the request - # %u:: Remote user from auth - # %U:: Unparsed URI - # %%:: Literal % - # - # source://webrick/lib/webrick/accesslog.rb#95 - def setup_params(config, req, res); end - end -end - -# A generic logging class -# -# source://webrick/lib/webrick/log.rb#17 -class WEBrick::BasicLog - # Initializes a new logger for +log_file+ that outputs messages at +level+ - # or higher. +log_file+ can be a filename, an IO-like object that - # responds to #<< or nil which outputs to $stderr. - # - # If no level is given INFO is chosen by default - # - # @return [BasicLog] a new instance of BasicLog - # - # source://webrick/lib/webrick/log.rb#50 - def initialize(log_file = T.unsafe(nil), level = T.unsafe(nil)); end - - # Synonym for log(INFO, obj.to_s) - # - # source://webrick/lib/webrick/log.rb#84 - def <<(obj); end - - # Closes the logger (also closes the log device associated to the logger) - # - # source://webrick/lib/webrick/log.rb#66 - def close; end - - # Shortcut for logging a DEBUG message - # - # source://webrick/lib/webrick/log.rb#97 - def debug(msg); end - - # Will the logger output DEBUG messages? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/log.rb#108 - def debug?; end - - # Shortcut for logging an ERROR message - # - # source://webrick/lib/webrick/log.rb#91 - def error(msg); end - - # Will the logger output ERROR messages? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/log.rb#102 - def error?; end - - # Shortcut for logging a FATAL message - # - # source://webrick/lib/webrick/log.rb#89 - def fatal(msg); end - - # Will the logger output FATAL messages? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/log.rb#100 - def fatal?; end - - # Shortcut for logging an INFO message - # - # source://webrick/lib/webrick/log.rb#95 - def info(msg); end - - # Will the logger output INFO messages? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/log.rb#106 - def info?; end - - # log-level, messages above this level will be logged - # - # source://webrick/lib/webrick/log.rb#41 - def level; end - - # log-level, messages above this level will be logged - # - # source://webrick/lib/webrick/log.rb#41 - def level=(_arg0); end - - # Logs +data+ at +level+ if the given level is above the current log - # level. - # - # source://webrick/lib/webrick/log.rb#75 - def log(level, data); end - - # Shortcut for logging a WARN message - # - # source://webrick/lib/webrick/log.rb#93 - def warn(msg); end - - # Will the logger output WARN messages? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/log.rb#104 - def warn?; end - - private - - # Formats +arg+ for the logger - # - # * If +arg+ is an Exception, it will format the error message and - # the back trace. - # * If +arg+ responds to #to_str, it will return it. - # * Otherwise it will return +arg+.inspect. - # - # source://webrick/lib/webrick/log.rb#119 - def format(arg); end -end - -# -- -# Updates WEBrick::GenericServer with SSL functionality -# -# source://webrick/lib/webrick/server.rb#56 -class WEBrick::GenericServer - # Creates a new generic server from +config+. The default configuration - # comes from +default+. - # - # @return [GenericServer] a new instance of GenericServer - # - # source://webrick/lib/webrick/server.rb#88 - def initialize(config = T.unsafe(nil), default = T.unsafe(nil)); end - - # Retrieves +key+ from the configuration - # - # source://webrick/lib/webrick/server.rb#121 - def [](key); end - - # The server configuration - # - # source://webrick/lib/webrick/server.rb#66 - def config; end - - # Updates +listen+ to enable SSL when the SSL configuration is active. - # - # source://webrick/lib/webrick/server.rb#129 - def listen(address, port); end - - # Sockets listening for connections. - # - # source://webrick/lib/webrick/server.rb#82 - def listeners; end - - # The server logger. This is independent from the HTTP access log. - # - # source://webrick/lib/webrick/server.rb#71 - def logger; end - - # You must subclass GenericServer and implement \#run which accepts a TCP - # client socket - # - # source://webrick/lib/webrick/server.rb#244 - def run(sock); end - - # Shuts down the server and all listening sockets. New listeners must be - # provided to restart the server. - # - # source://webrick/lib/webrick/server.rb#234 - def shutdown; end - - # Starts the server and runs the +block+ for each connection. This method - # does not return until the server is stopped from a signal handler or - # another thread using #stop or #shutdown. - # - # If the block raises a subclass of StandardError the exception is logged - # and ignored. If an IOError or Errno::EBADF exception is raised the - # exception is ignored. If an Exception subclass is raised the exception - # is logged and re-raised which stops the server. - # - # To completely shut down a server call #shutdown from ensure: - # - # server = WEBrick::GenericServer.new - # # or WEBrick::HTTPServer.new - # - # begin - # server.start - # ensure - # server.shutdown - # end - # - # @raise [ServerError] - # - # source://webrick/lib/webrick/server.rb#154 - def start(&block); end - - # The server status. One of :Stop, :Running or :Shutdown - # - # source://webrick/lib/webrick/server.rb#61 - def status; end - - # Stops the server from accepting new connections. - # - # source://webrick/lib/webrick/server.rb#222 - def stop; end - - # Tokens control the number of outstanding clients. The - # :MaxClients configuration sets this. - # - # source://webrick/lib/webrick/server.rb#77 - def tokens; end - - private - - # Accepts a TCP client socket from the TCP server socket +svr+ and returns - # the client socket. - # - # source://webrick/lib/webrick/server.rb#256 - def accept_client(svr); end - - # source://webrick/lib/webrick/server.rb#347 - def alarm_shutdown_pipe; end - - # Calls the callback +callback_name+ from the configuration with +args+ - # - # source://webrick/lib/webrick/server.rb#334 - def call_callback(callback_name, *args); end - - # source://webrick/lib/webrick/server.rb#359 - def cleanup_listener; end - - # source://webrick/lib/webrick/server.rb#342 - def cleanup_shutdown_pipe(shutdown_pipe); end - - # source://webrick/lib/webrick/server.rb#338 - def setup_shutdown_pipe; end - - # Starts a server thread for the client socket +sock+ that runs the given - # +block+. - # - # Sets the socket to the :WEBrickSocket thread local variable - # in the thread. - # - # If any errors occur in the block they are logged and handled. - # - # source://webrick/lib/webrick/server.rb#288 - def start_thread(sock, &block); end -end - -# source://webrick/lib/webrick/htmlutils.rb#13 -module WEBrick::HTMLUtils - private - - # Escapes &, ", > and < in +string+ - # - # source://webrick/lib/webrick/htmlutils.rb#18 - def escape(string); end - - class << self - # Escapes &, ", > and < in +string+ - # - # source://webrick/lib/webrick/htmlutils.rb#18 - def escape(string); end - end -end - -# HTTPAuth provides both basic and digest authentication. -# -# To enable authentication for requests in WEBrick you will need a user -# database and an authenticator. To start, here's an Htpasswd database for -# use with a DigestAuth authenticator: -# -# config = { :Realm => 'DigestAuth example realm' } -# -# htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file' -# htpasswd.auth_type = WEBrick::HTTPAuth::DigestAuth -# htpasswd.set_passwd config[:Realm], 'username', 'password' -# htpasswd.flush -# -# The +:Realm+ is used to provide different access to different groups -# across several resources on a server. Typically you'll need only one -# realm for a server. -# -# This database can be used to create an authenticator: -# -# config[:UserDB] = htpasswd -# -# digest_auth = WEBrick::HTTPAuth::DigestAuth.new config -# -# To authenticate a request call #authenticate with a request and response -# object in a servlet: -# -# def do_GET req, res -# @authenticator.authenticate req, res -# end -# -# For digest authentication the authenticator must not be created every -# request, it must be passed in as an option via WEBrick::HTTPServer#mount. -# -# source://webrick/lib/webrick/httpauth/authenticator.rb#12 -module WEBrick::HTTPAuth - private - - # source://webrick/lib/webrick/httpauth.rb#57 - def _basic_auth(req, res, realm, req_field, res_field, err_type, block); end - - # Simple wrapper for providing basic authentication for a request. When - # called with a request +req+, response +res+, authentication +realm+ and - # +block+ the block will be called with a +username+ and +password+. If - # the block returns true the request is allowed to continue, otherwise an - # HTTPStatus::Unauthorized error is raised. - # - # source://webrick/lib/webrick/httpauth.rb#79 - def basic_auth(req, res, realm, &block); end - - # Simple wrapper for providing basic authentication for a proxied request. - # When called with a request +req+, response +res+, authentication +realm+ - # and +block+ the block will be called with a +username+ and +password+. - # If the block returns true the request is allowed to continue, otherwise - # an HTTPStatus::ProxyAuthenticationRequired error is raised. - # - # source://webrick/lib/webrick/httpauth.rb#91 - def proxy_basic_auth(req, res, realm, &block); end - - class << self - # source://webrick/lib/webrick/httpauth.rb#57 - def _basic_auth(req, res, realm, req_field, res_field, err_type, block); end - - # Simple wrapper for providing basic authentication for a request. When - # called with a request +req+, response +res+, authentication +realm+ and - # +block+ the block will be called with a +username+ and +password+. If - # the block returns true the request is allowed to continue, otherwise an - # HTTPStatus::Unauthorized error is raised. - # - # source://webrick/lib/webrick/httpauth.rb#79 - def basic_auth(req, res, realm, &block); end - - # Simple wrapper for providing basic authentication for a proxied request. - # When called with a request +req+, response +res+, authentication +realm+ - # and +block+ the block will be called with a +username+ and +password+. - # If the block returns true the request is allowed to continue, otherwise - # an HTTPStatus::ProxyAuthenticationRequired error is raised. - # - # source://webrick/lib/webrick/httpauth.rb#91 - def proxy_basic_auth(req, res, realm, &block); end - end -end - -# Module providing generic support for both Digest and Basic -# authentication schemes. -# -# source://webrick/lib/webrick/httpauth/authenticator.rb#18 -module WEBrick::HTTPAuth::Authenticator - # The logger for this authenticator - # - # source://webrick/lib/webrick/httpauth/authenticator.rb#43 - def logger; end - - # The realm this authenticator covers - # - # source://webrick/lib/webrick/httpauth/authenticator.rb#33 - def realm; end - - # The user database for this authenticator - # - # source://webrick/lib/webrick/httpauth/authenticator.rb#38 - def userdb; end - - private - - # Initializes the authenticator from +config+ - # - # source://webrick/lib/webrick/httpauth/authenticator.rb#52 - def check_init(config); end - - # Ensures +req+ has credentials that can be authenticated. - # - # source://webrick/lib/webrick/httpauth/authenticator.rb#72 - def check_scheme(req); end - - # source://webrick/lib/webrick/httpauth/authenticator.rb#91 - def error(fmt, *args); end - - # source://webrick/lib/webrick/httpauth/authenticator.rb#97 - def info(fmt, *args); end - - # source://webrick/lib/webrick/httpauth/authenticator.rb#85 - def log(meth, fmt, *args); end -end - -# source://webrick/lib/webrick/httpauth/authenticator.rb#23 -WEBrick::HTTPAuth::Authenticator::AuthException = WEBrick::HTTPStatus::Unauthorized - -# Basic Authentication for WEBrick -# -# Use this class to add basic authentication to a WEBrick servlet. -# -# Here is an example of how to set up a BasicAuth: -# -# config = { :Realm => 'BasicAuth example realm' } -# -# htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file', password_hash: :bcrypt -# htpasswd.set_passwd config[:Realm], 'username', 'password' -# htpasswd.flush -# -# config[:UserDB] = htpasswd -# -# basic_auth = WEBrick::HTTPAuth::BasicAuth.new config -# -# source://webrick/lib/webrick/httpauth/basicauth.rb#35 -class WEBrick::HTTPAuth::BasicAuth - include ::WEBrick::HTTPAuth::Authenticator - - # Creates a new BasicAuth instance. - # - # See WEBrick::Config::BasicAuth for default configuration entries - # - # You must supply the following configuration entries: - # - # :Realm:: The name of the realm being protected. - # :UserDB:: A database of usernames and passwords. - # A WEBrick::HTTPAuth::Htpasswd instance should be used. - # - # @return [BasicAuth] a new instance of BasicAuth - # - # source://webrick/lib/webrick/httpauth/basicauth.rb#61 - def initialize(config, default = T.unsafe(nil)); end - - # Authenticates a +req+ and returns a 401 Unauthorized using +res+ if - # the authentication was not correct. - # - # source://webrick/lib/webrick/httpauth/basicauth.rb#70 - def authenticate(req, res); end - - # Returns a challenge response which asks for authentication information - # - # @raise [@auth_exception] - # - # source://webrick/lib/webrick/httpauth/basicauth.rb#103 - def challenge(req, res); end - - # Returns the value of attribute logger. - # - # source://webrick/lib/webrick/httpauth/basicauth.rb#48 - def logger; end - - # Returns the value of attribute realm. - # - # source://webrick/lib/webrick/httpauth/basicauth.rb#48 - def realm; end - - # Returns the value of attribute userdb. - # - # source://webrick/lib/webrick/httpauth/basicauth.rb#48 - def userdb; end - - class << self - # Used by UserDB to create a basic password entry - # - # source://webrick/lib/webrick/httpauth/basicauth.rb#43 - def make_passwd(realm, user, pass); end - end -end - -# RFC 2617 Digest Access Authentication for WEBrick -# -# Use this class to add digest authentication to a WEBrick servlet. -# -# Here is an example of how to set up DigestAuth: -# -# config = { :Realm => 'DigestAuth example realm' } -# -# htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file' -# htdigest.set_passwd config[:Realm], 'username', 'password' -# htdigest.flush -# -# config[:UserDB] = htdigest -# -# digest_auth = WEBrick::HTTPAuth::DigestAuth.new config -# -# When using this as with a servlet be sure not to create a new DigestAuth -# object in the servlet's #initialize. By default WEBrick creates a new -# servlet instance for every request and the DigestAuth object must be -# used across requests. -# -# source://webrick/lib/webrick/httpauth/digestauth.rb#46 -class WEBrick::HTTPAuth::DigestAuth - include ::WEBrick::HTTPAuth::Authenticator - - # Creates a new DigestAuth instance. Be sure to use the same DigestAuth - # instance for multiple requests as it saves state between requests in - # order to perform authentication. - # - # See WEBrick::Config::DigestAuth for default configuration entries - # - # You must supply the following configuration entries: - # - # :Realm:: The name of the realm being protected. - # :UserDB:: A database of usernames and passwords. - # A WEBrick::HTTPAuth::Htdigest instance should be used. - # - # @return [DigestAuth] a new instance of DigestAuth - # - # source://webrick/lib/webrick/httpauth/digestauth.rb#87 - def initialize(config, default = T.unsafe(nil)); end - - # Digest authentication algorithm - # - # source://webrick/lib/webrick/httpauth/digestauth.rb#59 - def algorithm; end - - # Authenticates a +req+ and returns a 401 Unauthorized using +res+ if - # the authentication was not correct. - # - # source://webrick/lib/webrick/httpauth/digestauth.rb#121 - def authenticate(req, res); end - - # Returns a challenge response which asks for authentication information - # - # @raise [@auth_exception] - # - # source://webrick/lib/webrick/httpauth/digestauth.rb#134 - def challenge(req, res, stale = T.unsafe(nil)); end - - # Quality of protection. RFC 2617 defines "auth" and "auth-int" - # - # source://webrick/lib/webrick/httpauth/digestauth.rb#64 - def qop; end - - private - - # source://webrick/lib/webrick/httpauth/digestauth.rb#163 - def _authenticate(req, res); end - - # source://webrick/lib/webrick/httpauth/digestauth.rb#306 - def check_nonce(req, auth_req); end - - # source://webrick/lib/webrick/httpauth/digestauth.rb#349 - def check_opaque(opaque_struct, req, auth_req); end - - # source://webrick/lib/webrick/httpauth/digestauth.rb#365 - def check_uri(req, auth_req); end - - # source://webrick/lib/webrick/httpauth/digestauth.rb#299 - def generate_next_nonce(req); end - - # source://webrick/lib/webrick/httpauth/digestauth.rb#332 - def generate_opaque(req); end - - # source://webrick/lib/webrick/httpauth/digestauth.rb#376 - def hexdigest(*args); end - - # source://webrick/lib/webrick/httpauth/digestauth.rb#291 - def split_param_value(string); end - - class << self - # Used by UserDB to create a digest password entry - # - # source://webrick/lib/webrick/httpauth/digestauth.rb#69 - def make_passwd(realm, user, pass); end - end -end - -# Htdigest accesses apache-compatible digest password files. Passwords are -# matched to a realm where they are valid. For security, the path for a -# digest password database should be stored outside of the paths available -# to the HTTP server. -# -# Htdigest is intended for use with WEBrick::HTTPAuth::DigestAuth and -# stores passwords using cryptographic hashes. -# -# htpasswd = WEBrick::HTTPAuth::Htdigest.new 'my_password_file' -# htpasswd.set_passwd 'my realm', 'username', 'password' -# htpasswd.flush -# -# source://webrick/lib/webrick/httpauth/htdigest.rb#31 -class WEBrick::HTTPAuth::Htdigest - include ::WEBrick::HTTPAuth::UserDB - - # Open a digest password database at +path+ - # - # @return [Htdigest] a new instance of Htdigest - # - # source://webrick/lib/webrick/httpauth/htdigest.rb#37 - def initialize(path); end - - # Removes a password from the database for +user+ in +realm+. - # - # source://webrick/lib/webrick/httpauth/htdigest.rb#113 - def delete_passwd(realm, user); end - - # Iterate passwords in the database. - # - # source://webrick/lib/webrick/httpauth/htdigest.rb#122 - def each; end - - # Flush the password database. If +output+ is given the database will - # be written there instead of to the original path. - # - # source://webrick/lib/webrick/httpauth/htdigest.rb#72 - def flush(output = T.unsafe(nil)); end - - # Retrieves a password from the database for +user+ in +realm+. If - # +reload_db+ is true the database will be reloaded first. - # - # source://webrick/lib/webrick/httpauth/htdigest.rb#91 - def get_passwd(realm, user, reload_db); end - - # Reloads passwords from the database - # - # source://webrick/lib/webrick/httpauth/htdigest.rb#50 - def reload; end - - # Sets a password in the database for +user+ in +realm+ to +pass+. - # - # source://webrick/lib/webrick/httpauth/htdigest.rb#101 - def set_passwd(realm, user, pass); end -end - -# Htgroup accesses apache-compatible group files. Htgroup can be used to -# provide group-based authentication for users. Currently Htgroup is not -# directly integrated with any authenticators in WEBrick. For security, -# the path for a digest password database should be stored outside of the -# paths available to the HTTP server. -# -# Example: -# -# htgroup = WEBrick::HTTPAuth::Htgroup.new 'my_group_file' -# htgroup.add 'superheroes', %w[spiderman batman] -# -# htgroup.members('superheroes').include? 'magneto' # => false -# -# source://webrick/lib/webrick/httpauth/htgroup.rb#30 -class WEBrick::HTTPAuth::Htgroup - # Open a group database at +path+ - # - # @return [Htgroup] a new instance of Htgroup - # - # source://webrick/lib/webrick/httpauth/htgroup.rb#35 - def initialize(path); end - - # Add an Array of +members+ to +group+ - # - # source://webrick/lib/webrick/httpauth/htgroup.rb#92 - def add(group, members); end - - # Flush the group database. If +output+ is given the database will be - # written there instead of to the original path. - # - # source://webrick/lib/webrick/httpauth/htgroup.rb#64 - def flush(output = T.unsafe(nil)); end - - # Retrieve the list of members from +group+ - # - # source://webrick/lib/webrick/httpauth/htgroup.rb#84 - def members(group); end - - # Reload groups from the database - # - # source://webrick/lib/webrick/httpauth/htgroup.rb#46 - def reload; end -end - -# Htpasswd accesses apache-compatible password files. Passwords are -# matched to a realm where they are valid. For security, the path for a -# password database should be stored outside of the paths available to the -# HTTP server. -# -# Htpasswd is intended for use with WEBrick::HTTPAuth::BasicAuth. -# -# To create an Htpasswd database with a single user: -# -# htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file' -# htpasswd.set_passwd 'my realm', 'username', 'password' -# htpasswd.flush -# -# source://webrick/lib/webrick/httpauth/htpasswd.rb#32 -class WEBrick::HTTPAuth::Htpasswd - include ::WEBrick::HTTPAuth::UserDB - - # Open a password database at +path+ - # - # @return [Htpasswd] a new instance of Htpasswd - # - # source://webrick/lib/webrick/httpauth/htpasswd.rb#38 - def initialize(path, password_hash: T.unsafe(nil)); end - - # Removes a password from the database for +user+ in +realm+. - # - # source://webrick/lib/webrick/httpauth/htpasswd.rb#144 - def delete_passwd(realm, user); end - - # Iterate passwords in the database. - # - # source://webrick/lib/webrick/httpauth/htpasswd.rb#151 - def each; end - - # Flush the password database. If +output+ is given the database will - # be written there instead of to the original path. - # - # source://webrick/lib/webrick/httpauth/htpasswd.rb#103 - def flush(output = T.unsafe(nil)); end - - # Retrieves a password from the database for +user+ in +realm+. If - # +reload_db+ is true the database will be reloaded first. - # - # source://webrick/lib/webrick/httpauth/htpasswd.rb#122 - def get_passwd(realm, user, reload_db); end - - # Reload passwords from the database - # - # source://webrick/lib/webrick/httpauth/htpasswd.rb#68 - def reload; end - - # Sets a password in the database for +user+ in +realm+ to +pass+. - # - # source://webrick/lib/webrick/httpauth/htpasswd.rb#130 - def set_passwd(realm, user, pass); end -end - -# source://webrick/lib/webrick/httpauth/authenticator.rb#114 -WEBrick::HTTPAuth::ProxyAuthenticator::AuthException = WEBrick::HTTPStatus::ProxyAuthenticationRequired - -# Basic authentication for proxy servers. See BasicAuth for details. -# -# source://webrick/lib/webrick/httpauth/basicauth.rb#112 -class WEBrick::HTTPAuth::ProxyBasicAuth < ::WEBrick::HTTPAuth::BasicAuth - include ::WEBrick::HTTPAuth::ProxyAuthenticator -end - -# Digest authentication for proxy servers. See DigestAuth for details. -# -# source://webrick/lib/webrick/httpauth/digestauth.rb#386 -class WEBrick::HTTPAuth::ProxyDigestAuth < ::WEBrick::HTTPAuth::DigestAuth - include ::WEBrick::HTTPAuth::ProxyAuthenticator - - private - - # source://webrick/lib/webrick/httpauth/digestauth.rb#390 - def check_uri(req, auth_req); end -end - -# User database mixin for HTTPAuth. This mixin dispatches user record -# access to the underlying auth_type for this database. -# -# source://webrick/lib/webrick/httpauth/userdb.rb#18 -module WEBrick::HTTPAuth::UserDB - # The authentication type. - # - # WEBrick::HTTPAuth::BasicAuth or WEBrick::HTTPAuth::DigestAuth are - # built-in. - # - # source://webrick/lib/webrick/httpauth/userdb.rb#26 - def auth_type; end - - # The authentication type. - # - # WEBrick::HTTPAuth::BasicAuth or WEBrick::HTTPAuth::DigestAuth are - # built-in. - # - # source://webrick/lib/webrick/httpauth/userdb.rb#26 - def auth_type=(_arg0); end - - # Retrieves a password in +realm+ for +user+ for the auth_type of this - # database. +reload_db+ is a dummy value. - # - # source://webrick/lib/webrick/httpauth/userdb.rb#48 - def get_passwd(realm, user, reload_db = T.unsafe(nil)); end - - # Creates an obscured password in +realm+ with +user+ and +password+ - # using the auth_type of this database. - # - # source://webrick/lib/webrick/httpauth/userdb.rb#32 - def make_passwd(realm, user, pass); end - - # Sets a password in +realm+ with +user+ and +password+ for the - # auth_type of this database. - # - # source://webrick/lib/webrick/httpauth/userdb.rb#40 - def set_passwd(realm, user, pass); end -end - -# -- -# Adds SSL functionality to WEBrick::HTTPRequest -# -# source://webrick/lib/webrick/httprequest.rb#25 -class WEBrick::HTTPRequest - # Creates a new HTTP request. WEBrick::Config::HTTP is the default - # configuration. - # - # @return [HTTPRequest] a new instance of HTTPRequest - # - # source://webrick/lib/webrick/httprequest.rb#153 - def initialize(config); end - - # Retrieves +header_name+ - # - # source://webrick/lib/webrick/httprequest.rb#318 - def [](header_name); end - - # The Accept header value - # - # source://webrick/lib/webrick/httprequest.rb#100 - def accept; end - - # The Accept-Charset header value - # - # source://webrick/lib/webrick/httprequest.rb#105 - def accept_charset; end - - # The Accept-Encoding header value - # - # source://webrick/lib/webrick/httprequest.rb#110 - def accept_encoding; end - - # The Accept-Language header value - # - # source://webrick/lib/webrick/httprequest.rb#115 - def accept_language; end - - # The socket address of the server - # - # source://webrick/lib/webrick/httprequest.rb#127 - def addr; end - - # Hash of request attributes - # - # source://webrick/lib/webrick/httprequest.rb#137 - def attributes; end - - # Returns the request body. - # - # source://webrick/lib/webrick/httprequest.rb#255 - def body(&block); end - - # Prepares the HTTPRequest object for use as the - # source for IO.copy_stream - # - # source://webrick/lib/webrick/httprequest.rb#265 - def body_reader; end - - # The content-length header - # - # source://webrick/lib/webrick/httprequest.rb#304 - def content_length; end - - # The content-type header - # - # source://webrick/lib/webrick/httprequest.rb#311 - def content_type; end - - # Generate HTTP/1.1 100 continue response if the client expects it, - # otherwise does nothing. - # - # source://webrick/lib/webrick/httprequest.rb#245 - def continue; end - - # The parsed request cookies - # - # source://webrick/lib/webrick/httprequest.rb#95 - def cookies; end - - # Iterates over the request headers - # - # source://webrick/lib/webrick/httprequest.rb#328 - def each; end - - # Consumes any remaining body and updates keep-alive status - # - # source://webrick/lib/webrick/httprequest.rb#390 - def fixup; end - - # The parsed header of the request - # - # source://webrick/lib/webrick/httprequest.rb#90 - def header; end - - # The host this request is for - # - # source://webrick/lib/webrick/httprequest.rb#340 - def host; end - - # The HTTP version of the request - # - # source://webrick/lib/webrick/httprequest.rb#51 - def http_version; end - - # Is this a keep-alive connection? - # - # source://webrick/lib/webrick/httprequest.rb#142 - def keep_alive; end - - # Should the connection this request was made on be kept alive? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httprequest.rb#375 - def keep_alive?; end - - # This method provides the metavariables defined by the revision 3 - # of "The WWW Common Gateway Interface Version 1.1" - # To browse the current document of CGI Version 1.1, see below: - # https://www.rfc-editor.org/rfc/rfc3875 - # - # source://webrick/lib/webrick/httprequest.rb#407 - def meta_vars; end - - # Parses a request from +socket+. This is called internally by - # WEBrick::HTTPServer. - # - # source://webrick/lib/webrick/httprequest.rb#193 - def parse(socket = T.unsafe(nil)); end - - # The request path - # - # source://webrick/lib/webrick/httprequest.rb#63 - def path; end - - # The path info (CGI variable) - # - # source://webrick/lib/webrick/httprequest.rb#73 - def path_info; end - - # The path info (CGI variable) - # - # source://webrick/lib/webrick/httprequest.rb#73 - def path_info=(_arg0); end - - # The socket address of the client - # - # source://webrick/lib/webrick/httprequest.rb#132 - def peeraddr; end - - # The port this request is for - # - # source://webrick/lib/webrick/httprequest.rb#347 - def port; end - - # Request query as a Hash - # - # source://webrick/lib/webrick/httprequest.rb#294 - def query; end - - # The query from the URI of the request - # - # source://webrick/lib/webrick/httprequest.rb#78 - def query_string; end - - # The query from the URI of the request - # - # source://webrick/lib/webrick/httprequest.rb#78 - def query_string=(_arg0); end - - # The raw header of the request - # - # source://webrick/lib/webrick/httprequest.rb#85 - def raw_header; end - - # for IO.copy_stream. - # - # source://webrick/lib/webrick/httprequest.rb#278 - def readpartial(size, buf = T.unsafe(nil)); end - - # The client's IP address - # - # source://webrick/lib/webrick/httprequest.rb#361 - def remote_ip; end - - # The complete request line such as: - # - # GET / HTTP/1.1 - # - # source://webrick/lib/webrick/httprequest.rb#36 - def request_line; end - - # The request method, GET, POST, PUT, etc. - # - # source://webrick/lib/webrick/httprequest.rb#41 - def request_method; end - - # The local time this request was received - # - # source://webrick/lib/webrick/httprequest.rb#147 - def request_time; end - - # The parsed URI of the request - # - # source://webrick/lib/webrick/httprequest.rb#58 - def request_uri; end - - # The script name (CGI variable) - # - # source://webrick/lib/webrick/httprequest.rb#68 - def script_name; end - - # The script name (CGI variable) - # - # source://webrick/lib/webrick/httprequest.rb#68 - def script_name=(_arg0); end - - # The server name this request is for - # - # source://webrick/lib/webrick/httprequest.rb#354 - def server_name; end - - # Is this an SSL request? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httprequest.rb#368 - def ssl?; end - - # source://webrick/lib/webrick/httprequest.rb#379 - def to_s; end - - # The unparsed URI of the request - # - # source://webrick/lib/webrick/httprequest.rb#46 - def unparsed_uri; end - - # The remote user (CGI variable) - # - # source://webrick/lib/webrick/httprequest.rb#122 - def user; end - - # The remote user (CGI variable) - # - # source://webrick/lib/webrick/httprequest.rb#122 - def user=(_arg0); end - - private - - # source://webrick/lib/webrick/httprequest.rb#594 - def _read_data(io, method, *arg); end - - # source://webrick/lib/webrick/httprequest.rb#527 - def parse_host_request_line(host); end - - # source://webrick/lib/webrick/httprequest.rb#614 - def parse_query; end - - # source://webrick/lib/webrick/httprequest.rb#503 - def parse_uri(str, scheme = T.unsafe(nil)); end - - # source://webrick/lib/webrick/httprequest.rb#531 - def read_body(socket, block); end - - # source://webrick/lib/webrick/httprequest.rb#559 - def read_chunk_size(socket); end - - # source://webrick/lib/webrick/httprequest.rb#570 - def read_chunked(socket, block); end - - # source://webrick/lib/webrick/httprequest.rb#610 - def read_data(io, size); end - - # source://webrick/lib/webrick/httprequest.rb#471 - def read_header(socket); end - - # source://webrick/lib/webrick/httprequest.rb#606 - def read_line(io, size = T.unsafe(nil)); end - - # @raise [HTTPStatus::EOFError] - # - # source://webrick/lib/webrick/httprequest.rb#451 - def read_request_line(socket); end - - # It's said that all X-Forwarded-* headers will contain more than one - # (comma-separated) value if the original request already contained one of - # these headers. Since we could use these values as Host header, we choose - # the initial(first) value. (apr_table_mergen() adds new value after the - # existing value with ", " prefix) - # - # source://webrick/lib/webrick/httprequest.rb#642 - def setup_forwarded_info; end -end - -# source://webrick/lib/webrick/httprequest.rb#526 -WEBrick::HTTPRequest::HOST_PATTERN = T.let(T.unsafe(nil), Regexp) - -# same as Mongrel, Thin and Puma -# -# source://webrick/lib/webrick/httprequest.rb#449 -WEBrick::HTTPRequest::MAX_HEADER_LENGTH = T.let(T.unsafe(nil), Integer) - -# An HTTP response. This is filled in by the service or do_* methods of a -# WEBrick HTTP Servlet. -# -# source://webrick/lib/webrick/httpresponse.rb#24 -class WEBrick::HTTPResponse - # Creates a new HTTP response object. WEBrick::Config::HTTP is the - # default configuration. - # - # @return [HTTPResponse] a new instance of HTTPResponse - # - # source://webrick/lib/webrick/httpresponse.rb#117 - def initialize(config); end - - # Retrieves the response header +field+ - # - # source://webrick/lib/webrick/httpresponse.rb#155 - def [](field); end - - # Sets the response header +field+ to +value+ - # - # source://webrick/lib/webrick/httpresponse.rb#162 - def []=(field, value); end - - # Body may be: - # * a String; - # * an IO-like object that responds to +#read+ and +#readpartial+; - # * a Proc-like object that responds to +#call+. - # - # In the latter case, either #chunked= should be set to +true+, - # or header['content-length'] explicitly provided. - # Example: - # - # server.mount_proc '/' do |req, res| - # res.chunked = true - # # or - # # res.header['content-length'] = 10 - # res.body = proc { |out| out.write(Time.now.to_s) } - # end - # - # source://webrick/lib/webrick/httpresponse.rb#70 - def body; end - - # Body may be: - # * a String; - # * an IO-like object that responds to +#read+ and +#readpartial+; - # * a Proc-like object that responds to +#call+. - # - # In the latter case, either #chunked= should be set to +true+, - # or header['content-length'] explicitly provided. - # Example: - # - # server.mount_proc '/' do |req, res| - # res.chunked = true - # # or - # # res.header['content-length'] = 10 - # res.body = proc { |out| out.write(Time.now.to_s) } - # end - # - # source://webrick/lib/webrick/httpresponse.rb#70 - def body=(_arg0); end - - # Enables chunked transfer encoding. - # - # source://webrick/lib/webrick/httpresponse.rb#214 - def chunked=(val); end - - # Will this response body be returned using chunked transfer-encoding? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpresponse.rb#207 - def chunked?; end - - # Configuration for this response - # - # source://webrick/lib/webrick/httpresponse.rb#101 - def config; end - - # The content-length header - # - # source://webrick/lib/webrick/httpresponse.rb#170 - def content_length; end - - # Sets the content-length header to +len+ - # - # source://webrick/lib/webrick/httpresponse.rb#179 - def content_length=(len); end - - # The content-type header - # - # source://webrick/lib/webrick/httpresponse.rb#186 - def content_type; end - - # Sets the content-type header to +type+ - # - # source://webrick/lib/webrick/httpresponse.rb#193 - def content_type=(type); end - - # Response cookies - # - # source://webrick/lib/webrick/httpresponse.rb#46 - def cookies; end - - # Iterates over each header in the response - # - # source://webrick/lib/webrick/httpresponse.rb#200 - def each; end - - # Filename of the static file in this response. Only used by the - # FileHandler servlet. - # - # source://webrick/lib/webrick/httpresponse.rb#91 - def filename; end - - # Filename of the static file in this response. Only used by the - # FileHandler servlet. - # - # source://webrick/lib/webrick/httpresponse.rb#91 - def filename=(_arg0); end - - # Response header - # - # source://webrick/lib/webrick/httpresponse.rb#41 - def header; end - - # HTTP Response version - # - # source://webrick/lib/webrick/httpresponse.rb#31 - def http_version; end - - # Is this a keep-alive response? - # - # source://webrick/lib/webrick/httpresponse.rb#96 - def keep_alive; end - - # Is this a keep-alive response? - # - # source://webrick/lib/webrick/httpresponse.rb#96 - def keep_alive=(_arg0); end - - # Will this response's connection be kept alive? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpresponse.rb#221 - def keep_alive?; end - - # source://webrick/lib/webrick/httpresponse.rb#325 - def make_body_tempfile; end - - # Response reason phrase ("OK") - # - # source://webrick/lib/webrick/httpresponse.rb#51 - def reason_phrase; end - - # Response reason phrase ("OK") - # - # source://webrick/lib/webrick/httpresponse.rb#51 - def reason_phrase=(_arg0); end - - # source://webrick/lib/webrick/httpresponse.rb#343 - def remove_body_tempfile; end - - # Request HTTP version for this response - # - # source://webrick/lib/webrick/httpresponse.rb#85 - def request_http_version; end - - # Request HTTP version for this response - # - # source://webrick/lib/webrick/httpresponse.rb#85 - def request_http_version=(_arg0); end - - # Request method for this response - # - # source://webrick/lib/webrick/httpresponse.rb#75 - def request_method; end - - # Request method for this response - # - # source://webrick/lib/webrick/httpresponse.rb#75 - def request_method=(_arg0); end - - # Request URI for this response - # - # source://webrick/lib/webrick/httpresponse.rb#80 - def request_uri; end - - # Request URI for this response - # - # source://webrick/lib/webrick/httpresponse.rb#80 - def request_uri=(_arg0); end - - # Sends the body on +socket+ - # - # source://webrick/lib/webrick/httpresponse.rb#378 - def send_body(socket); end - - # Sends the headers on +socket+ - # - # source://webrick/lib/webrick/httpresponse.rb#355 - def send_header(socket); end - - # Sends the response on +socket+ - # - # source://webrick/lib/webrick/httpresponse.rb#238 - def send_response(socket); end - - # Bytes sent in this response - # - # source://webrick/lib/webrick/httpresponse.rb#106 - def sent_size; end - - # Creates an error page for exception +ex+ with an optional +backtrace+ - # - # source://webrick/lib/webrick/httpresponse.rb#405 - def set_error(ex, backtrace = T.unsafe(nil)); end - - # Redirects to +url+ with a WEBrick::HTTPStatus::Redirect +status+. - # - # Example: - # - # res.set_redirect WEBrick::HTTPStatus::TemporaryRedirect - # - # source://webrick/lib/webrick/httpresponse.rb#395 - def set_redirect(status, url); end - - # Sets up the headers for sending - # - # source://webrick/lib/webrick/httpresponse.rb#255 - def setup_header; end - - # Response status code (200) - # - # source://webrick/lib/webrick/httpresponse.rb#36 - def status; end - - # Sets the response's status to the +status+ code - # - # source://webrick/lib/webrick/httpresponse.rb#147 - def status=(status); end - - # The response's HTTP status line - # - # source://webrick/lib/webrick/httpresponse.rb#140 - def status_line; end - - # Set the response body proc as an streaming/upgrade response. - # - # source://webrick/lib/webrick/httpresponse.rb#111 - def upgrade; end - - # Sets the response to be a streaming/upgrade response. - # This will disable keep-alive and chunked transfer encoding. - # - # source://webrick/lib/webrick/httpresponse.rb#229 - def upgrade!(protocol); end - - # Set the response body proc as an streaming/upgrade response. - # - # source://webrick/lib/webrick/httpresponse.rb#111 - def upgrade=(_arg0); end - - private - - # preserved for compatibility with some 3rd-party handlers - # - # source://webrick/lib/webrick/httpresponse.rb#581 - def _write_data(socket, data); end - - # source://webrick/lib/webrick/httpresponse.rb#432 - def check_header(header_value); end - - # :stopdoc: - # - # source://webrick/lib/webrick/httpresponse.rb#443 - def error_body(backtrace, ex, host, port); end - - # source://webrick/lib/webrick/httpresponse.rb#473 - def send_body_io(socket); end - - # source://webrick/lib/webrick/httpresponse.rb#535 - def send_body_proc(socket); end - - # source://webrick/lib/webrick/httpresponse.rb#513 - def send_body_string(socket); end -end - -# source://webrick/lib/webrick/httpresponse.rb#555 -class WEBrick::HTTPResponse::ChunkedWrapper - # @return [ChunkedWrapper] a new instance of ChunkedWrapper - # - # source://webrick/lib/webrick/httpresponse.rb#556 - def initialize(socket, resp); end - - # source://webrick/lib/webrick/httpresponse.rb#574 - def <<(*buf); end - - # source://webrick/lib/webrick/httpresponse.rb#561 - def write(buf); end -end - -# An HTTP Server -# -# source://webrick/lib/webrick/httpserver.rb#27 -class WEBrick::HTTPServer < ::WEBrick::GenericServer - # Creates a new HTTP server according to +config+ - # - # An HTTP server uses the following attributes: - # - # :AccessLog:: An array of access logs. See WEBrick::AccessLog - # :BindAddress:: Local address for the server to bind to - # :DocumentRoot:: Root path to serve files from - # :DocumentRootOptions:: Options for the default HTTPServlet::FileHandler - # :HTTPVersion:: The HTTP version of this server - # :Port:: Port to listen on - # :RequestCallback:: Called with a request and response before each - # request is serviced. - # :RequestTimeout:: Maximum time to wait between requests - # :ServerAlias:: Array of alternate names for this server for virtual - # hosting - # :ServerName:: Name for this server for virtual hosting - # - # @return [HTTPServer] a new instance of HTTPServer - # - # source://webrick/lib/webrick/httpserver.rb#46 - def initialize(config = T.unsafe(nil), default = T.unsafe(nil)); end - - # Logs +req+ and +res+ in the access logs. +config+ is used for the - # server name. - # - # source://webrick/lib/webrick/httpserver.rb#220 - def access_log(config, req, res); end - - # Creates the HTTPRequest used when handling the HTTP - # request. Can be overridden by subclasses. - # - # source://webrick/lib/webrick/httpserver.rb#230 - def create_request(with_webrick_config); end - - # Creates the HTTPResponse used when handling the HTTP - # request. Can be overridden by subclasses. - # - # source://webrick/lib/webrick/httpserver.rb#237 - def create_response(with_webrick_config); end - - # The default OPTIONS request handler says GET, HEAD, POST and OPTIONS - # requests are allowed. - # - # source://webrick/lib/webrick/httpserver.rb#147 - def do_OPTIONS(req, res); end - - # Finds the appropriate virtual host to handle +req+ - # - # source://webrick/lib/webrick/httpserver.rb#207 - def lookup_server(req); end - - # Mounts +servlet+ on +dir+ passing +options+ to the servlet at creation - # time - # - # source://webrick/lib/webrick/httpserver.rb#155 - def mount(dir, servlet, *options); end - - # Mounts +proc+ or +block+ on +dir+ and calls it with a - # WEBrick::HTTPRequest and WEBrick::HTTPResponse - # - # @raise [HTTPServerError] - # - # source://webrick/lib/webrick/httpserver.rb#164 - def mount_proc(dir, proc = T.unsafe(nil), &block); end - - # Processes requests on +sock+ - # - # source://webrick/lib/webrick/httpserver.rb#69 - def run(sock); end - - # Finds a servlet for +path+ - # - # source://webrick/lib/webrick/httpserver.rb#182 - def search_servlet(path); end - - # Services +req+ and fills in +res+ - # - # @raise [HTTPStatus::NotFound] - # - # source://webrick/lib/webrick/httpserver.rb#125 - def service(req, res); end - - # Unmounts +dir+ - # - # source://webrick/lib/webrick/httpserver.rb#173 - def umount(dir); end - - # Unmounts +dir+ - # - # source://webrick/lib/webrick/httpserver.rb#173 - def unmount(dir); end - - # Adds +server+ as a virtual host. - # - # source://webrick/lib/webrick/httpserver.rb#193 - def virtual_host(server); end -end - -# Mount table for the path a servlet is mounted on in the directory space -# of the server. Users of WEBrick can only access this indirectly via -# WEBrick::HTTPServer#mount, WEBrick::HTTPServer#unmount and -# WEBrick::HTTPServer#search_servlet -# -# source://webrick/lib/webrick/httpserver.rb#247 -class WEBrick::HTTPServer::MountTable - # @return [MountTable] a new instance of MountTable - # - # source://webrick/lib/webrick/httpserver.rb#248 - def initialize; end - - # source://webrick/lib/webrick/httpserver.rb#253 - def [](dir); end - - # source://webrick/lib/webrick/httpserver.rb#258 - def []=(dir, val); end - - # source://webrick/lib/webrick/httpserver.rb#265 - def delete(dir); end - - # source://webrick/lib/webrick/httpserver.rb#272 - def scan(path); end - - private - - # source://webrick/lib/webrick/httpserver.rb#279 - def compile; end - - # source://webrick/lib/webrick/httpserver.rb#287 - def normalize(dir); end -end - -# AbstractServlet allows HTTP server modules to be reused across multiple -# servers and allows encapsulation of functionality. -# -# By default a servlet will respond to GET, HEAD (through an alias to GET) -# and OPTIONS requests. -# -# By default a new servlet is initialized for every request. A servlet -# instance can be reused by overriding ::get_instance in the -# AbstractServlet subclass. -# -# == A Simple Servlet -# -# class Simple < WEBrick::HTTPServlet::AbstractServlet -# def do_GET request, response -# status, content_type, body = do_stuff_with request -# -# response.status = status -# response['Content-Type'] = content_type -# response.body = body -# end -# -# def do_stuff_with request -# return 200, 'text/plain', 'you got a page' -# end -# end -# -# This servlet can be mounted on a server at a given path: -# -# server.mount '/simple', Simple -# -# == Servlet Configuration -# -# Servlets can be configured via initialize. The first argument is the -# HTTP server the servlet is being initialized for. -# -# class Configurable < Simple -# def initialize server, color, size -# super server -# @color = color -# @size = size -# end -# -# def do_stuff_with request -# content = "

Hello, World!" -# -# return 200, "text/html", content -# end -# end -# -# This servlet must be provided two arguments at mount time: -# -# server.mount '/configurable', Configurable, 'red', '2em' -# -# source://webrick/lib/webrick/httpservlet/abstract.rb#76 -class WEBrick::HTTPServlet::AbstractServlet - # Initializes a new servlet for +server+ using +options+ which are - # stored as-is in +@options+. +@logger+ is also provided. - # - # @return [AbstractServlet] a new instance of AbstractServlet - # - # source://webrick/lib/webrick/httpservlet/abstract.rb#91 - def initialize(server, *options); end - - # Raises a NotFound exception - # - # @raise [HTTPStatus::NotFound] - # - # source://webrick/lib/webrick/httpservlet/abstract.rb#115 - def do_GET(req, res); end - - # Dispatches to do_GET - # - # source://webrick/lib/webrick/httpservlet/abstract.rb#122 - def do_HEAD(req, res); end - - # Returns the allowed HTTP request methods - # - # source://webrick/lib/webrick/httpservlet/abstract.rb#129 - def do_OPTIONS(req, res); end - - # Dispatches to a +do_+ method based on +req+ if such a method is - # available. (+do_GET+ for a GET request). Raises a MethodNotAllowed - # exception if the method is not implemented. - # - # source://webrick/lib/webrick/httpservlet/abstract.rb#102 - def service(req, res); end - - private - - # Redirects to a path ending in / - # - # source://webrick/lib/webrick/httpservlet/abstract.rb#140 - def redirect_to_directory_uri(req, res); end - - class << self - # Factory for servlet instances that will handle a request from +server+ - # using +options+ from the mount point. By default a new servlet - # instance is created for every call. - # - # source://webrick/lib/webrick/httpservlet/abstract.rb#83 - def get_instance(server, *options); end - end -end - -# Servlet for handling CGI scripts -# -# Example: -# -# server.mount('/cgi/my_script', WEBrick::HTTPServlet::CGIHandler, -# '/path/to/my_script') -# -# source://webrick/lib/webrick/httpservlet/cgihandler.rb#28 -class WEBrick::HTTPServlet::CGIHandler < ::WEBrick::HTTPServlet::AbstractServlet - # Creates a new CGI script servlet for the script at +name+ - # - # @return [CGIHandler] a new instance of CGIHandler - # - # source://webrick/lib/webrick/httpservlet/cgihandler.rb#36 - def initialize(server, name); end - - # :stopdoc: - # - # @raise [HTTPStatus::InternalServerError] - # - # source://webrick/lib/webrick/httpservlet/cgihandler.rb#50 - def do_GET(req, res); end - - # :stopdoc: - # - # @raise [HTTPStatus::InternalServerError] - # - # source://webrick/lib/webrick/httpservlet/cgihandler.rb#50 - def do_POST(req, res); end -end - -# source://webrick/lib/webrick/httpservlet/cgihandler.rb#31 -WEBrick::HTTPServlet::CGIHandler::CGIRunnerArray = T.let(T.unsafe(nil), Array) - -# Servlet for serving a single file. You probably want to use the -# FileHandler servlet instead as it handles directories and fancy indexes. -# -# Example: -# -# server.mount('/my_page.txt', WEBrick::HTTPServlet::DefaultFileHandler, -# '/path/to/my_page.txt') -# -# This servlet handles If-Modified-Since and Range requests. -# -# source://webrick/lib/webrick/httpservlet/filehandler.rb#32 -class WEBrick::HTTPServlet::DefaultFileHandler < ::WEBrick::HTTPServlet::AbstractServlet - # Creates a DefaultFileHandler instance for the file at +local_path+. - # - # @return [DefaultFileHandler] a new instance of DefaultFileHandler - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#37 - def initialize(server, local_path); end - - # :stopdoc: - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#44 - def do_GET(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#118 - def make_partial_content(req, res, filename, filesize); end - - # returns a lambda for webrick/httpresponse.rb send_body_proc - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#90 - def multipart_body(body, parts, boundary, mtype, filesize); end - - # @return [Boolean] - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#64 - def not_modified?(req, res, mtime, etag); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#155 - def prepare_range(range, filesize); end -end - -# ERBHandler evaluates an ERB file and returns the result. This handler -# is automatically used if there are .rhtml files in a directory served by -# the FileHandler. -# -# ERBHandler supports GET and POST methods. -# -# The ERB file is evaluated with the local variables +servlet_request+ and -# +servlet_response+ which are a WEBrick::HTTPRequest and -# WEBrick::HTTPResponse respectively. -# -# Example .rhtml file: -# -# Request to <%= servlet_request.request_uri %> -# -# Query params <%= servlet_request.query.inspect %> -# -# source://webrick/lib/webrick/httpservlet/erbhandler.rb#36 -class WEBrick::HTTPServlet::ERBHandler < ::WEBrick::HTTPServlet::AbstractServlet - # Creates a new ERBHandler on +server+ that will evaluate and serve the - # ERB file +name+ - # - # @return [ERBHandler] a new instance of ERBHandler - # - # source://webrick/lib/webrick/httpservlet/erbhandler.rb#42 - def initialize(server, name); end - - # Handles GET requests - # - # source://webrick/lib/webrick/httpservlet/erbhandler.rb#50 - def do_GET(req, res); end - - # Handles GET requests - # - # Handles POST requests - # - # source://webrick/lib/webrick/httpservlet/erbhandler.rb#50 - def do_POST(req, res); end - - private - - # Evaluates +erb+ providing +servlet_request+ and +servlet_response+ as - # local variables. - # - # source://webrick/lib/webrick/httpservlet/erbhandler.rb#79 - def evaluate(erb, servlet_request, servlet_response); end -end - -# Serves a directory including fancy indexing and a variety of other -# options. -# -# Example: -# -# server.mount('/assets', WEBrick::HTTPServlet::FileHandler, -# '/path/to/assets') -# -# source://webrick/lib/webrick/httpservlet/filehandler.rb#175 -class WEBrick::HTTPServlet::FileHandler < ::WEBrick::HTTPServlet::AbstractServlet - # Creates a FileHandler servlet on +server+ that serves files starting - # at directory +root+ - # - # +options+ may be a Hash containing keys from - # WEBrick::Config::FileHandler or +true+ or +false+. - # - # If +options+ is true or false then +:FancyIndexing+ is enabled or - # disabled respectively. - # - # @return [FileHandler] a new instance of FileHandler - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#203 - def initialize(server, root, options = T.unsafe(nil), default = T.unsafe(nil)); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#245 - def do_GET(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#257 - def do_OPTIONS(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#251 - def do_POST(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#224 - def service(req, res); end - - # :stopdoc: - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#215 - def set_filesystem_encoding(str); end - - private - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#416 - def call_callback(callback_name, req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#369 - def check_filename(req, res, name); end - - # @raise [HTTPStatus::NotFound] - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#309 - def exec_handler(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#322 - def get_handler(req, res); end - - # @return [Boolean] - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#428 - def nondisclosure_name?(name); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#286 - def prevent_directory_traversal(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#394 - def search_file(req, res, basename); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#385 - def search_index_file(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#437 - def set_dir_list(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#335 - def set_filename(req, res); end - - # source://webrick/lib/webrick/httpservlet/filehandler.rb#376 - def shift_path_info(req, res, path_info, base = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#277 - def trailing_pathsep?(path); end - - # @return [Boolean] - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#422 - def windows_ambiguous_name?(name); end - - class << self - # Allow custom handling of requests for files with +suffix+ by class - # +handler+ - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#182 - def add_handler(suffix, handler); end - - # Remove custom handling of requests for files with +suffix+ - # - # source://webrick/lib/webrick/httpservlet/filehandler.rb#189 - def remove_handler(suffix); end - end -end - -# Mounts a proc at a path that accepts a request and response. -# -# Instead of mounting this servlet with WEBrick::HTTPServer#mount use -# WEBrick::HTTPServer#mount_proc: -# -# server.mount_proc '/' do |req, res| -# res.body = 'it worked!' -# res.status = 200 -# end -# -# source://webrick/lib/webrick/httpservlet/prochandler.rb#28 -class WEBrick::HTTPServlet::ProcHandler < ::WEBrick::HTTPServlet::AbstractServlet - # @return [ProcHandler] a new instance of ProcHandler - # - # source://webrick/lib/webrick/httpservlet/prochandler.rb#34 - def initialize(proc); end - - # source://webrick/lib/webrick/httpservlet/prochandler.rb#38 - def do_GET(request, response); end - - # source://webrick/lib/webrick/httpservlet/prochandler.rb#38 - def do_POST(request, response); end - - # source://webrick/lib/webrick/httpservlet/prochandler.rb#38 - def do_PUT(request, response); end - - # :stopdoc: - # - # source://webrick/lib/webrick/httpservlet/prochandler.rb#30 - def get_instance(server, *options); end -end - -# This module is used to manager HTTP status codes. -# -# See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more -# information. -# -# source://webrick/lib/webrick/httpstatus.rb#21 -module WEBrick::HTTPStatus - private - - # Is +code+ a client error status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#170 - def client_error?(code); end - - # Is +code+ an error status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#164 - def error?(code); end - - # Is +code+ an informational status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#146 - def info?(code); end - - # Returns the description corresponding to the HTTP status +code+ - # - # WEBrick::HTTPStatus.reason_phrase 404 - # => "Not Found" - # - # source://webrick/lib/webrick/httpstatus.rb#140 - def reason_phrase(code); end - - # Is +code+ a redirection status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#158 - def redirect?(code); end - - # Is +code+ a server error status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#176 - def server_error?(code); end - - # Is +code+ a successful status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#152 - def success?(code); end - - class << self - # Returns the status class corresponding to +code+ - # - # WEBrick::HTTPStatus[302] - # => WEBrick::HTTPStatus::NotFound - # - # source://webrick/lib/webrick/httpstatus.rb#186 - def [](code); end - - # Is +code+ a client error status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#170 - def client_error?(code); end - - # Is +code+ an error status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#164 - def error?(code); end - - # Is +code+ an informational status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#146 - def info?(code); end - - # Returns the description corresponding to the HTTP status +code+ - # - # WEBrick::HTTPStatus.reason_phrase 404 - # => "Not Found" - # - # source://webrick/lib/webrick/httpstatus.rb#140 - def reason_phrase(code); end - - # Is +code+ a redirection status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#158 - def redirect?(code); end - - # Is +code+ a server error status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#176 - def server_error?(code); end - - # Is +code+ a successful status? - # - # @return [Boolean] - # - # source://webrick/lib/webrick/httpstatus.rb#152 - def success?(code); end - end -end - -# Root of the HTTP status class hierarchy -# -# source://webrick/lib/webrick/httpstatus.rb#25 -class WEBrick::HTTPStatus::Status < ::StandardError - # Returns the HTTP status code - # - # source://webrick/lib/webrick/httpstatus.rb#31 - def code; end - - # Returns the HTTP status description - # - # source://webrick/lib/webrick/httpstatus.rb#34 - def reason_phrase; end - - # Returns the HTTP status code - # - # source://webrick/lib/webrick/httpstatus.rb#31 - def to_i; end - - class << self - # source://webrick/lib/webrick/httpstatus.rb#27 - def code; end - - # source://webrick/lib/webrick/httpstatus.rb#27 - def reason_phrase; end - end -end - -# HTTPUtils provides utility methods for working with the HTTP protocol. -# -# This module is generally used internally by WEBrick -# -# source://webrick/lib/webrick/httputils.rb#25 -module WEBrick::HTTPUtils - private - - # source://webrick/lib/webrick/httputils.rb#474 - def _escape(str, regex); end - - # :stopdoc: - # - # source://webrick/lib/webrick/httputils.rb#472 - def _make_regex(str); end - - # source://webrick/lib/webrick/httputils.rb#473 - def _make_regex!(str); end - - # source://webrick/lib/webrick/httputils.rb#480 - def _unescape(str, regex); end - - # Removes quotes and escapes from +str+ - # - # source://webrick/lib/webrick/httputils.rb#254 - def dequote(str); end - - # Escapes HTTP reserved and unwise characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#498 - def escape(str); end - - # Escapes 8 bit characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#539 - def escape8bit(str); end - - # Escapes form reserved characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#512 - def escape_form(str); end - - # Escapes path +str+ - # - # source://webrick/lib/webrick/httputils.rb#528 - def escape_path(str); end - - # Loads Apache-compatible mime.types in +file+. - # - # source://webrick/lib/webrick/httputils.rb#122 - def load_mime_types(file); end - - # Returns the mime type of +filename+ from the list in +mime_tab+. If no - # mime type was found application/octet-stream is returned. - # - # source://webrick/lib/webrick/httputils.rb#144 - def mime_type(filename, mime_tab); end - - # Normalizes a request path. Raises an exception if the path cannot be - # normalized. - # - # source://webrick/lib/webrick/httputils.rb#31 - def normalize_path(path); end - - # Parses form data in +io+ with the given +boundary+ - # - # source://webrick/lib/webrick/httputils.rb#426 - def parse_form_data(io, boundary); end - - # source://webrick/lib/webrick/httputils.rb#171 - def parse_header(raw); end - - # Parses the query component of a URI in +str+ - # - # source://webrick/lib/webrick/httputils.rb#402 - def parse_query(str); end - - # Parses q values in +value+ as used in Accept headers. - # - # source://webrick/lib/webrick/httputils.rb#233 - def parse_qvalues(value); end - - # Parses a Range header value +ranges_specifier+ - # - # source://webrick/lib/webrick/httputils.rb#215 - def parse_range_header(ranges_specifier); end - - # Quotes and escapes quotes in +str+ - # - # source://webrick/lib/webrick/httputils.rb#264 - def quote(str); end - - # Splits a header value +str+ according to HTTP specification. - # - # source://webrick/lib/webrick/httputils.rb#206 - def split_header_value(str); end - - # Unescapes HTTP reserved and unwise characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#505 - def unescape(str); end - - # Unescapes form reserved characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#521 - def unescape_form(str); end - - class << self - # source://webrick/lib/webrick/httputils.rb#474 - def _escape(str, regex); end - - # :stopdoc: - # - # source://webrick/lib/webrick/httputils.rb#472 - def _make_regex(str); end - - # source://webrick/lib/webrick/httputils.rb#473 - def _make_regex!(str); end - - # source://webrick/lib/webrick/httputils.rb#480 - def _unescape(str, regex); end - - # Removes quotes and escapes from +str+ - # - # source://webrick/lib/webrick/httputils.rb#254 - def dequote(str); end - - # Escapes HTTP reserved and unwise characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#498 - def escape(str); end - - # Escapes 8 bit characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#539 - def escape8bit(str); end - - # Escapes form reserved characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#512 - def escape_form(str); end - - # Escapes path +str+ - # - # source://webrick/lib/webrick/httputils.rb#528 - def escape_path(str); end - - # Loads Apache-compatible mime.types in +file+. - # - # source://webrick/lib/webrick/httputils.rb#122 - def load_mime_types(file); end - - # Returns the mime type of +filename+ from the list in +mime_tab+. If no - # mime type was found application/octet-stream is returned. - # - # source://webrick/lib/webrick/httputils.rb#144 - def mime_type(filename, mime_tab); end - - # Normalizes a request path. Raises an exception if the path cannot be - # normalized. - # - # source://webrick/lib/webrick/httputils.rb#31 - def normalize_path(path); end - - # Parses form data in +io+ with the given +boundary+ - # - # source://webrick/lib/webrick/httputils.rb#426 - def parse_form_data(io, boundary); end - - # source://webrick/lib/webrick/httputils.rb#171 - def parse_header(raw); end - - # Parses the query component of a URI in +str+ - # - # source://webrick/lib/webrick/httputils.rb#402 - def parse_query(str); end - - # Parses q values in +value+ as used in Accept headers. - # - # source://webrick/lib/webrick/httputils.rb#233 - def parse_qvalues(value); end - - # Parses a Range header value +ranges_specifier+ - # - # source://webrick/lib/webrick/httputils.rb#215 - def parse_range_header(ranges_specifier); end - - # Quotes and escapes quotes in +str+ - # - # source://webrick/lib/webrick/httputils.rb#264 - def quote(str); end - - # Splits a header value +str+ according to HTTP specification. - # - # source://webrick/lib/webrick/httputils.rb#206 - def split_header_value(str); end - - # Unescapes HTTP reserved and unwise characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#505 - def unescape(str); end - - # Unescapes form reserved characters in +str+ - # - # source://webrick/lib/webrick/httputils.rb#521 - def unescape_form(str); end - end -end - -# source://webrick/lib/webrick/httputils.rb#161 -class WEBrick::HTTPUtils::CookieHeader < ::Array - # source://webrick/lib/webrick/httputils.rb#162 - def join(separator = T.unsafe(nil)); end -end - -# Stores multipart form data. FormData objects are created when -# WEBrick::HTTPUtils.parse_form_data is called. -# -# source://webrick/lib/webrick/httputils.rb#273 -class WEBrick::HTTPUtils::FormData < ::String - # Creates a new FormData object. - # - # +args+ is an Array of form data entries. One FormData will be created - # for each entry. - # - # This is called by WEBrick::HTTPUtils.parse_form_data for you - # - # @return [FormData] a new instance of FormData - # - # source://webrick/lib/webrick/httputils.rb#298 - def initialize(*args); end - - # Adds +str+ to this FormData which may be the body, a header or a - # header entry. - # - # This is called by WEBrick::HTTPUtils.parse_form_data for you - # - # source://webrick/lib/webrick/httputils.rb#331 - def <<(str); end - - # Retrieves the header at the first entry in +key+ - # - # source://webrick/lib/webrick/httputils.rb#317 - def [](*key); end - - # Adds +data+ at the end of the chain of entries - # - # This is called by WEBrick::HTTPUtils.parse_form_data for you. - # - # source://webrick/lib/webrick/httputils.rb#351 - def append_data(data); end - - # Yields each entry in this FormData - # - # source://webrick/lib/webrick/httputils.rb#366 - def each_data; end - - # The filename of the form data part - # - # source://webrick/lib/webrick/httputils.rb#285 - def filename; end - - # The filename of the form data part - # - # source://webrick/lib/webrick/httputils.rb#285 - def filename=(_arg0); end - - # Returns all the FormData as an Array - # - # source://webrick/lib/webrick/httputils.rb#378 - def list; end - - # The name of the form data part - # - # source://webrick/lib/webrick/httputils.rb#280 - def name; end - - # The name of the form data part - # - # source://webrick/lib/webrick/httputils.rb#280 - def name=(_arg0); end - - # source://webrick/lib/webrick/httputils.rb#287 - def next_data=(_arg0); end - - # Returns all the FormData as an Array - # - # A FormData will behave like an Array - # - # source://webrick/lib/webrick/httputils.rb#378 - def to_ary; end - - # This FormData's body - # - # source://webrick/lib/webrick/httputils.rb#394 - def to_s; end - - protected - - # source://webrick/lib/webrick/httputils.rb#287 - def next_data; end -end - -# source://webrick/lib/webrick/httputils.rb#167 -WEBrick::HTTPUtils::HEADER_CLASSES = T.let(T.unsafe(nil), Hash) - -# Parses an HTTP header +raw+ into a hash of header fields with an Array -# of values. -# -# source://webrick/lib/webrick/httputils.rb#155 -class WEBrick::HTTPUtils::SplitHeader < ::Array - # source://webrick/lib/webrick/httputils.rb#156 - def join(separator = T.unsafe(nil)); end -end - -# source://webrick/lib/webrick/utils.rb#17 -module WEBrick::Utils - private - - # Creates TCP server sockets bound to +address+:+port+ and returns them. - # - # It will create IPV4 and IPV6 sockets on all interfaces. - # - # source://webrick/lib/webrick/utils.rb#56 - def create_listeners(address, port); end - - # The server hostname - # - # source://webrick/lib/webrick/utils.rb#47 - def getservername; end - - # Generates a random string of length +len+ - # - # source://webrick/lib/webrick/utils.rb#79 - def random_string(len); end - - # Sets the close on exec flag for +io+ - # - # source://webrick/lib/webrick/utils.rb#27 - def set_close_on_exec(io); end - - # Sets IO operations on +io+ to be non-blocking - # - # source://webrick/lib/webrick/utils.rb#20 - def set_non_blocking(io); end - - # Changes the process's uid and gid to the ones of +user+ - # - # source://webrick/lib/webrick/utils.rb#34 - def su(user); end - - # Executes the passed block and raises +exception+ if execution takes more - # than +seconds+. - # - # If +seconds+ is zero or nil, simply executes the block - # - # source://webrick/lib/webrick/utils.rb#253 - def timeout(seconds, exception = T.unsafe(nil)); end - - class << self - # Creates TCP server sockets bound to +address+:+port+ and returns them. - # - # It will create IPV4 and IPV6 sockets on all interfaces. - # - # source://webrick/lib/webrick/utils.rb#56 - def create_listeners(address, port); end - - # The server hostname - # - # source://webrick/lib/webrick/utils.rb#47 - def getservername; end - - # Generates a random string of length +len+ - # - # source://webrick/lib/webrick/utils.rb#79 - def random_string(len); end - - # Sets the close on exec flag for +io+ - # - # source://webrick/lib/webrick/utils.rb#27 - def set_close_on_exec(io); end - - # Sets IO operations on +io+ to be non-blocking - # - # source://webrick/lib/webrick/utils.rb#20 - def set_non_blocking(io); end - - # Changes the process's uid and gid to the ones of +user+ - # - # source://webrick/lib/webrick/utils.rb#34 - def su(user); end - - # Executes the passed block and raises +exception+ if execution takes more - # than +seconds+. - # - # If +seconds+ is zero or nil, simply executes the block - # - # source://webrick/lib/webrick/utils.rb#253 - def timeout(seconds, exception = T.unsafe(nil)); end - end -end - -# Class used to manage timeout handlers across multiple threads. -# -# Timeout handlers should be managed by using the class methods which are -# synchronized. -# -# id = TimeoutHandler.register(10, Timeout::Error) -# begin -# sleep 20 -# puts 'foo' -# ensure -# TimeoutHandler.cancel(id) -# end -# -# will raise Timeout::Error -# -# id = TimeoutHandler.register(10, Timeout::Error) -# begin -# sleep 5 -# puts 'foo' -# ensure -# TimeoutHandler.cancel(id) -# end -# -# will print 'foo' -# -# source://webrick/lib/webrick/utils.rb#118 -class WEBrick::Utils::TimeoutHandler - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # Creates a new TimeoutHandler. You should use ::register and ::cancel - # instead of creating the timeout handler directly. - # - # @return [TimeoutHandler] a new instance of TimeoutHandler - # - # source://webrick/lib/webrick/utils.rb#148 - def initialize; end - - # Cancels the timeout handler +id+ - # - # source://webrick/lib/webrick/utils.rb#226 - def cancel(thread, id); end - - # Interrupts the timeout handler +id+ and raises +exception+ - # - # source://webrick/lib/webrick/utils.rb#203 - def interrupt(thread, id, exception); end - - # Registers a new timeout handler - # - # +time+:: Timeout in seconds - # +exception+:: Exception to raise when timeout elapsed - # - # source://webrick/lib/webrick/utils.rb#214 - def register(thread, time, exception); end - - # source://webrick/lib/webrick/utils.rb#240 - def terminate; end - - private - - # source://webrick/lib/webrick/utils.rb#158 - def watch; end - - # source://webrick/lib/webrick/utils.rb#193 - def watcher; end - - class << self - # Cancels the timeout handler +id+ - # - # source://webrick/lib/webrick/utils.rb#137 - def cancel(id); end - - # Registers a new timeout handler - # - # +time+:: Timeout in seconds - # +exception+:: Exception to raise when timeout elapsed - # - # source://webrick/lib/webrick/utils.rb#130 - def register(seconds, exception); end - - # source://webrick/lib/webrick/utils.rb#141 - def terminate; end - end -end diff --git a/sorbet/rbi/shims/ruby_lsp.rbi b/sorbet/rbi/shims/ruby_lsp.rbi index ca6957d2..7e5eacc9 100644 --- a/sorbet/rbi/shims/ruby_lsp.rbi +++ b/sorbet/rbi/shims/ruby_lsp.rbi @@ -4,8 +4,8 @@ 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) + def initialize(listener) + @listener = T.let(listener, RubyIndexer::DeclarationListener) end end end diff --git a/test/dummy/app/models/concerns/verifiable.rb b/test/dummy/app/models/concerns/verifiable.rb new file mode 100644 index 00000000..4f01a0e6 --- /dev/null +++ b/test/dummy/app/models/concerns/verifiable.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Verifiable + extend ActiveSupport::Concern + + # checks if a user is verified + def verified? + true + end + + module ClassMethods + def all_verified + all.select(&:verified?) + end + end +end diff --git a/test/dummy/app/models/user.rb b/test/dummy/app/models/user.rb index f3b57411..c696c86d 100644 --- a/test/dummy/app/models/user.rb +++ b/test/dummy/app/models/user.rb @@ -9,6 +9,8 @@ class User < ApplicationRecord attr_readonly :last_name + include Verifiable # an ActiveSupport::Concern + private def foo diff --git a/test/ruby_lsp_rails/indexing_enhancement_test.rb b/test/ruby_lsp_rails/indexing_enhancement_test.rb index b6c7b66b..ba61730a 100644 --- a/test/ruby_lsp_rails/indexing_enhancement_test.rb +++ b/test/ruby_lsp_rails/indexing_enhancement_test.rb @@ -12,8 +12,6 @@ class << self def populated_index @index ||= begin index = RubyIndexer::Index.new - indexing_enhancement = IndexingEnhancement.new(index) - index.register_enhancement(indexing_enhancement) index.index_all index end