From 8d01cf9d9d206c4678bcf9d2c9869c5d5ab0cb61 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 18 Sep 2023 22:54:43 +0100 Subject: [PATCH] Use yarp-powered ruby-lsp --- Gemfile.lock | 58 +- README.md | 2 +- lib/ruby-lsp-rspec.rb | 2 +- .../ruby_lsp_rspec/{extension.rb => addon.rb} | 4 +- lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb | 92 +- ruby-lsp-rspec.gemspec | 6 +- sorbet/rbi/gems/.gitattributes | 1 + sorbet/rbi/gems/rubocop-rake@0.6.0.rbi | 328 ++ sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi | 8 + sorbet/rbi/gems/rubocop-sorbet@0.7.3.rbi | 1226 +++++ ...uby-lsp@0.10.1.rbi => ruby-lsp@0.11.1.rbi} | 1840 ++++--- sorbet/rbi/gems/unparser@0.6.8.rbi | 4525 ----------------- spec/ruby_lsp_rspec_spec.rb | 41 +- 13 files changed, 2725 insertions(+), 5408 deletions(-) rename lib/ruby_lsp/ruby_lsp_rspec/{extension.rb => addon.rb} (91%) create mode 100644 sorbet/rbi/gems/.gitattributes create mode 100644 sorbet/rbi/gems/rubocop-rake@0.6.0.rbi create mode 100644 sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi create mode 100644 sorbet/rbi/gems/rubocop-sorbet@0.7.3.rbi rename sorbet/rbi/gems/{ruby-lsp@0.10.1.rbi => ruby-lsp@0.11.1.rbi} (69%) delete mode 100644 sorbet/rbi/gems/unparser@0.6.8.rbi diff --git a/Gemfile.lock b/Gemfile.lock index 18da1ce..9e40f49 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: ruby-lsp-rspec (0.1.2) - ruby-lsp (~> 0.10.1) + ruby-lsp (~> 0.11.0) GEM remote: https://rubygems.org/ @@ -22,7 +22,7 @@ GEM language_server-protocol (3.17.0.3) netrc (0.11.0) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc prettier_print (1.2.1) @@ -31,15 +31,13 @@ GEM racc (1.7.1) rainbow (3.1.1) rake (13.0.6) - rbi (0.0.17) - ast - parser (>= 3.0.0) + rbi (0.1.1) sorbet-runtime (>= 0.5.9204) - unparser (>= 0.5.6) + yarp (>= 0.11.0) rdoc (6.5.0) psych (>= 4.0.0) regexp_parser (2.8.1) - reline (0.3.8) + reline (0.3.9) io-console (~> 0.5) rexml (3.2.6) rspec (3.12.0) @@ -51,11 +49,11 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-support (3.12.0) - rubocop (1.56.2) + rspec-support (3.12.1) + rubocop (1.56.4) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -73,49 +71,45 @@ GEM rubocop (~> 1.0) rubocop-shopify (2.14.0) rubocop (~> 1.51) - rubocop-sorbet (0.7.3) + rubocop-sorbet (0.7.4) rubocop (>= 0.90.0) - ruby-lsp (0.10.1) + ruby-lsp (0.11.1) language_server-protocol (~> 3.17.0) - sorbet-runtime - syntax_tree (>= 6.1.1, < 7) - yarp (>= 0.11, < 0.12) + sorbet-runtime (>= 0.5.5685) + yarp (>= 0.12, < 0.13) ruby-progressbar (1.13.0) - sorbet (0.5.11010) - sorbet-static (= 0.5.11010) - sorbet-runtime (0.5.11010) - sorbet-static (0.5.11010-universal-darwin) - sorbet-static (0.5.11010-x86_64-linux) - sorbet-static-and-runtime (0.5.11010) - sorbet (= 0.5.11010) - sorbet-runtime (= 0.5.11010) - spoom (1.2.3) + sorbet (0.5.11062) + sorbet-static (= 0.5.11062) + sorbet-runtime (0.5.11062) + sorbet-static (0.5.11062-universal-darwin) + sorbet-static (0.5.11062-x86_64-linux) + sorbet-static-and-runtime (0.5.11062) + sorbet (= 0.5.11062) + sorbet-runtime (= 0.5.11062) + spoom (1.2.4) erubi (>= 1.10.0) sorbet-static-and-runtime (>= 0.5.10187) syntax_tree (>= 6.1.1) thor (>= 0.19.2) stringio (3.0.8) - syntax_tree (6.1.1) + syntax_tree (6.2.0) prettier_print (>= 1.2.0) - tapioca (0.11.8) + tapioca (0.11.9) bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) - rbi (~> 0.0.0, >= 0.0.16) + rbi (~> 0.1.0, >= 0.1.0) sorbet-static-and-runtime (>= 0.5.10187) spoom (~> 1.2.0, >= 1.2.0) thor (>= 1.2.0) yard-sorbet thor (1.2.2) - unicode-display_width (2.4.2) - unparser (0.6.8) - diff-lcs (~> 1.3) - parser (>= 3.2.0) + unicode-display_width (2.5.0) yard (0.9.34) yard-sorbet (0.8.1) sorbet-runtime (>= 0.5) yard (>= 0.9) - yarp (0.11.0) + yarp (0.12.0) PLATFORMS arm64-darwin-22 diff --git a/README.md b/README.md index 947aec2..e6e8180 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Gem Version](https://badge.fury.io/rb/ruby-lsp-rspec.svg)](https://badge.fury.io/rb/ruby-lsp-rspec) -Ruby LSP RSpec is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for displaying CodeLens for RSpec tests. +Ruby LSP RSpec is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) addon for displaying CodeLens for RSpec tests. ![Screenshot of the code lenses](/misc/example.gif) diff --git a/lib/ruby-lsp-rspec.rb b/lib/ruby-lsp-rspec.rb index fc37efa..18191c6 100644 --- a/lib/ruby-lsp-rspec.rb +++ b/lib/ruby-lsp-rspec.rb @@ -3,7 +3,7 @@ require "sorbet-runtime" require "ruby_lsp_rspec/version" -require "ruby_lsp/ruby_lsp_rspec/extension" +require "ruby_lsp/ruby_lsp_rspec/addon" module RubyLsp module RSpec diff --git a/lib/ruby_lsp/ruby_lsp_rspec/extension.rb b/lib/ruby_lsp/ruby_lsp_rspec/addon.rb similarity index 91% rename from lib/ruby_lsp/ruby_lsp_rspec/extension.rb rename to lib/ruby_lsp/ruby_lsp_rspec/addon.rb index e61f64c..0dc9dd9 100644 --- a/lib/ruby_lsp/ruby_lsp_rspec/extension.rb +++ b/lib/ruby_lsp/ruby_lsp_rspec/addon.rb @@ -1,14 +1,14 @@ # typed: strict # frozen_string_literal: true -require "ruby_lsp/extension" +require "ruby_lsp/addon" require "ruby_lsp/internal" require_relative "code_lens" module RubyLsp module RSpec - class Extension < ::RubyLsp::Extension + class Addon < ::RubyLsp::Addon extend T::Sig sig { override.void } diff --git a/lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb b/lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb index b5528e1..2b566ee 100644 --- a/lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb +++ b/lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb @@ -18,7 +18,7 @@ class CodeLens < ::RubyLsp::Listener def initialize(uri, emitter, message_queue) @_response = T.let([], ResponseType) @path = T.let(uri.to_standardized_path, T.nilable(String)) - emitter.register(self, :on_command, :on_command_call, :on_call) + emitter.register(self, :on_call) @base_command = T.let( begin @@ -40,81 +40,43 @@ def initialize(uri, emitter, message_queue) super(emitter, message_queue) end - sig { params(node: SyntaxTree::CallNode).void } + sig { params(node: YARP::CallNode).void } def on_call(node) - add_group_code_lens(node) - end - - sig { params(node: SyntaxTree::CommandCall).void } - def on_command_call(node) - add_group_code_lens(node) - end - - sig { params(node: SyntaxTree::Command).void } - def on_command(node) - message_value = node.message.value + message_value = node.message if message_value == "it" - argument = node.arguments.parts.first - - name = case argument - when SyntaxTree::StringLiteral - argument.parts.first.value - when SyntaxTree::VarRef - argument.value.value - end - + name = generate_name(node) add_test_code_lens(node, name: name, kind: :example) elsif message_value == "describe" || message_value == "context" - add_group_code_lens(node) - end - end - - private + return if node.receiver && node.receiver.name.to_s != "RSpec" - sig do - params(node: T.any( - SyntaxTree::StringLiteral, - SyntaxTree::ConstPathRef, - SyntaxTree::ConstRef, - SyntaxTree::TopConstRef, - SyntaxTree::VarRef, - )).returns(T.nilable(String)) - end - def get_group_name(node) - case node - when SyntaxTree::StringLiteral - node.parts.first.value - when SyntaxTree::ConstPathRef, SyntaxTree::ConstRef, SyntaxTree::TopConstRef - full_constant_name(node) - when SyntaxTree::VarRef - node.value.value + name = generate_name(node) + add_test_code_lens(node, name: name, kind: :group) end end - sig { params(node: T.any(SyntaxTree::CallNode, SyntaxTree::CommandCall, SyntaxTree::Command)).void } - def add_group_code_lens(node) - return unless node.message.value == "describe" || node.message.value == "context" - - case node - when SyntaxTree::CommandCall, SyntaxTree::CallNode - return if node.receiver && node.receiver.value.value != "RSpec" - end - - argument = case node - when SyntaxTree::CallNode - node.arguments.arguments.parts.first - when SyntaxTree::CommandCall, SyntaxTree::Command - node.arguments.parts.first + sig { params(node: YARP::CallNode).returns(String) } + def generate_name(node) + if node.arguments + argument = node.arguments.arguments.first + + case argument + when YARP::StringNode + argument.content + when YARP::CallNode + "<#{argument.name}>" + when nil + "" + else + argument.slice + end + else + "" end - - name = get_group_name(argument) - - return unless name - - add_test_code_lens(node, name: name, kind: :group) end - sig { params(node: SyntaxTree::Node, name: String, kind: Symbol).void } + private + + sig { params(node: YARP::Node, name: String, kind: Symbol).void } def add_test_code_lens(node, name:, kind:) return unless @path diff --git a/ruby-lsp-rspec.gemspec b/ruby-lsp-rspec.gemspec index bd6886e..0b90fde 100644 --- a/ruby-lsp-rspec.gemspec +++ b/ruby-lsp-rspec.gemspec @@ -8,8 +8,8 @@ Gem::Specification.new do |spec| spec.authors = ["Stan Lo"] spec.email = ["stan001212@gmail.com"] - spec.summary = "RSpec extension for ruby-lsp" - spec.description = "RSpec extension for ruby-lsp" + spec.summary = "RSpec addon for ruby-lsp" + spec.description = "RSpec addon for ruby-lsp" spec.homepage = "https://github.com/st0012/ruby-lsp-rspec" spec.license = "MIT" spec.required_ruby_version = ">= 3.0.0" @@ -41,5 +41,5 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "ruby-lsp", "~> 0.10.1" + spec.add_dependency "ruby-lsp", "~> 0.11.0" end diff --git a/sorbet/rbi/gems/.gitattributes b/sorbet/rbi/gems/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi b/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi new file mode 100644 index 0000000..af43d85 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi @@ -0,0 +1,328 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-rake` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-rake`. + +# source://rubocop-rake/lib/rubocop/rake/version.rb#3 +module RuboCop; end + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/class_definition.rb#4 +module RuboCop::Cop; end + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/class_definition.rb#5 +module RuboCop::Cop::Rake; end + +# This cop detects class or module definition in a task or namespace, +# because it is defined to the top level. +# It is confusing because the scope looks in the task or namespace, +# but actually it is defined to the top level. +# +# @example +# # bad +# task :foo do +# class C +# end +# end +# +# # bad +# namespace :foo do +# module M +# end +# end +# +# # good - It is also defined to the top level, +# # but it looks expected behavior. +# class C +# end +# task :foo do +# end +# +# source://rubocop-rake/lib/rubocop/cop/rake/class_definition_in_task.rb#31 +class RuboCop::Cop::Rake::ClassDefinitionInTask < ::RuboCop::Cop::Base + # source://rubocop-rake/lib/rubocop/cop/rake/class_definition_in_task.rb#34 + def on_class(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/class_definition_in_task.rb#34 + def on_module(node); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/class_definition_in_task.rb#32 +RuboCop::Cop::Rake::ClassDefinitionInTask::MSG = T.let(T.unsafe(nil), String) + +# Rake task definition should have a description with `desc` method. +# It is useful as a documentation of task. And Rake does not display +# task that does not have `desc` by `rake -T`. +# +# Note: This cop does not require description for the default task, +# because the default task is executed with `rake` without command. +# +# @example +# # bad +# task :do_something +# +# # bad +# task :do_something do +# end +# +# # good +# desc 'Do something' +# task :do_something +# +# # good +# desc 'Do something' +# task :do_something do +# end +# +# source://rubocop-rake/lib/rubocop/cop/rake/desc.rb#30 +class RuboCop::Cop::Rake::Desc < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Rake::Helper::OnTask + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop-rake/lib/rubocop/cop/rake/desc.rb#40 + def on_task(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/desc.rb#36 + def prerequisites(param0 = T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://rubocop-rake/lib/rubocop/cop/rake/desc.rb#76 + def can_insert_desc_to?(parent); end + + # source://rubocop-rake/lib/rubocop/cop/rake/desc.rb#62 + def parent_and_task(task_node); end + + # @return [Boolean] + # + # source://rubocop-rake/lib/rubocop/cop/rake/desc.rb#50 + def task_with_desc?(node); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/desc.rb#34 +RuboCop::Cop::Rake::Desc::MSG = T.let(T.unsafe(nil), String) + +# If namespaces are defined with the same name, Rake executes the both namespaces +# in definition order. +# It is redundant. You should squash them into one definition. +# This cop detects it. +# +# @example +# # bad +# namespace :foo do +# task :bar do +# end +# end +# namespace :foo do +# task :hoge do +# end +# end +# +# # good +# namespace :foo do +# task :bar do +# end +# task :hoge do +# end +# end +# +# source://rubocop-rake/lib/rubocop/cop/rake/duplicate_namespace.rb#30 +class RuboCop::Cop::Rake::DuplicateNamespace < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Rake::Helper::OnNamespace + + # @return [DuplicateNamespace] a new instance of DuplicateNamespace + # + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_namespace.rb#35 + def initialize(*_arg0); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_namespace.rb#67 + def message_for_dup(previous:, current:, namespace:); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_namespace.rb#53 + def namespaces(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_namespace.rb#40 + def on_namespace(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_namespace.rb#76 + def source_location(node); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/duplicate_namespace.rb#33 +RuboCop::Cop::Rake::DuplicateNamespace::MSG = T.let(T.unsafe(nil), String) + +# If tasks are defined with the same name, Rake executes the both tasks +# in definition order. +# It is misleading sometimes. You should squash them into one definition. +# This cop detects it. +# +# @example +# # bad +# task :foo do +# p 'foo 1' +# end +# task :foo do +# p 'foo 2' +# end +# +# # good +# task :foo do +# p 'foo 1' +# p 'foo 2' +# end +# +# source://rubocop-rake/lib/rubocop/cop/rake/duplicate_task.rb#26 +class RuboCop::Cop::Rake::DuplicateTask < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Rake::Helper::OnTask + + # @return [DuplicateTask] a new instance of DuplicateTask + # + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_task.rb#31 + def initialize(*_arg0); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_task.rb#66 + def message_for_dup(previous:, current:, task_name:); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_task.rb#52 + def namespaces(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_task.rb#36 + def on_task(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/duplicate_task.rb#75 + def source_location(node); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/duplicate_task.rb#29 +RuboCop::Cop::Rake::DuplicateTask::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/class_definition.rb#6 +module RuboCop::Cop::Rake::Helper; end + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/class_definition.rb#7 +module RuboCop::Cop::Rake::Helper::ClassDefinition + extend ::RuboCop::AST::NodePattern::Macros + extend ::RuboCop::Cop::Rake::Helper::ClassDefinition + + # source://rubocop-rake/lib/rubocop/cop/rake/helper/class_definition.rb#11 + def class_definition?(param0 = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rubocop-rake/lib/rubocop/cop/rake/helper/class_definition.rb#22 + def in_class_definition?(node); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/on_namespace.rb#7 +module RuboCop::Cop::Rake::Helper::OnNamespace + extend ::RuboCop::AST::NodePattern::Macros + + # source://rubocop-rake/lib/rubocop/cop/rake/helper/on_namespace.rb#10 + def namespace?(param0 = T.unsafe(nil)); end + + # source://rubocop-rake/lib/rubocop/cop/rake/helper/on_namespace.rb#14 + def on_send(node); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/on_task.rb#7 +module RuboCop::Cop::Rake::Helper::OnTask + extend ::RuboCop::AST::NodePattern::Macros + + # source://rubocop-rake/lib/rubocop/cop/rake/helper/on_task.rb#14 + def on_send(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/helper/on_task.rb#10 + def task?(param0 = T.unsafe(nil)); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/task_definition.rb#7 +module RuboCop::Cop::Rake::Helper::TaskDefinition + extend ::RuboCop::AST::NodePattern::Macros + extend ::RuboCop::Cop::Rake::Helper::TaskDefinition + + # @return [Boolean] + # + # source://rubocop-rake/lib/rubocop/cop/rake/helper/task_definition.rb#19 + def in_task_or_namespace?(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/helper/task_definition.rb#11 + def task_or_namespace?(param0 = T.unsafe(nil)); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/helper/task_name.rb#7 +module RuboCop::Cop::Rake::Helper::TaskName + extend ::RuboCop::Cop::Rake::Helper::TaskName + + # source://rubocop-rake/lib/rubocop/cop/rake/helper/task_name.rb#10 + def task_name(node); end +end + +# This cop detects method definition in a task or namespace, +# because it is defined to the top level. +# It is confusing because the scope looks in the task or namespace, +# but actually it is defined to the top level. +# +# @example +# # bad +# task :foo do +# def helper_method +# do_something +# end +# end +# +# # bad +# namespace :foo do +# def helper_method +# do_something +# end +# end +# +# # good - It is also defined to the top level, +# # but it looks expected behavior. +# def helper_method +# end +# task :foo do +# end +# +# source://rubocop-rake/lib/rubocop/cop/rake/method_definition_in_task.rb#33 +class RuboCop::Cop::Rake::MethodDefinitionInTask < ::RuboCop::Cop::Base + # source://rubocop-rake/lib/rubocop/cop/rake/method_definition_in_task.rb#36 + def on_def(node); end + + # source://rubocop-rake/lib/rubocop/cop/rake/method_definition_in_task.rb#36 + def on_defs(node); end +end + +# source://rubocop-rake/lib/rubocop/cop/rake/method_definition_in_task.rb#34 +RuboCop::Cop::Rake::MethodDefinitionInTask::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-rake/lib/rubocop/rake/version.rb#4 +module RuboCop::Rake; end + +# source://rubocop-rake/lib/rubocop/rake.rb#12 +RuboCop::Rake::CONFIG = T.let(T.unsafe(nil), Hash) + +# source://rubocop-rake/lib/rubocop/rake.rb#11 +RuboCop::Rake::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname) + +# source://rubocop-rake/lib/rubocop/rake.rb#8 +class RuboCop::Rake::Error < ::StandardError; end + +# Because RuboCop doesn't yet support plugins, we have to monkey patch in a +# bit of our configuration. +# +# source://rubocop-rake/lib/rubocop/rake/inject.rb#9 +module RuboCop::Rake::Inject + class << self + # source://rubocop-rake/lib/rubocop/rake/inject.rb#10 + def defaults!; end + end +end + +# source://rubocop-rake/lib/rubocop/rake.rb#10 +RuboCop::Rake::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname) + +# source://rubocop-rake/lib/rubocop/rake/version.rb#5 +RuboCop::Rake::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi b/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi new file mode 100644 index 0000000..89397ad --- /dev/null +++ b/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi @@ -0,0 +1,8 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-shopify` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-shopify`. + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.7.3.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.7.3.rbi new file mode 100644 index 0000000..aff96c6 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-sorbet@0.7.3.rbi @@ -0,0 +1,1226 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-sorbet` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-sorbet`. + +# source://rubocop-sorbet/lib/rubocop/sorbet/version.rb#3 +module RuboCop; end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#4 +module RuboCop::Cop; end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#5 +module RuboCop::Cop::Sorbet; end + +# Disallows using `.override(allow_incompatible: true)`. +# Using `allow_incompatible` suggests a violation of the Liskov +# Substitution Principle, meaning that a subclass is not a valid +# subtype of its superclass. This Cop prevents these design smells +# from occurring. +# +# @example +# +# # bad +# sig.override(allow_incompatible: true) +# +# # good +# sig.override +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#21 +class RuboCop::Cop::Sorbet::AllowIncompatibleOverride < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#55 + def on_block(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#55 + def on_numblock(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#49 + def on_send(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#41 + def override?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#36 + def sig?(param0); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#27 + def sig_dot_override?(param0 = T.unsafe(nil)); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#22 +RuboCop::Cop::Sorbet::AllowIncompatibleOverride::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#24 +RuboCop::Cop::Sorbet::AllowIncompatibleOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows binding the return value of `T.any`, `T.all`, `T.enum` +# to a constant directly. To bind the value, one must use `T.type_alias`. +# +# @example +# +# # bad +# FooOrBar = T.any(Foo, Bar) +# +# # good +# FooOrBar = T.type_alias { T.any(Foo, Bar) } +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#18 +class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#65 + def on_casgn(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#48 + def requires_type_alias?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#38 + def type_alias_with_block?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#29 + def type_alias_without_block(param0 = T.unsafe(nil)); end + + private + + # Given nested send nodes, returns the leaf with explicit receiver. + # + # i.e. in Ruby + # + # a.b.c.d.e.f + # ^^^ + # + # i.e. in AST + # + # (send (send (send (send (send (send nil :a) :b) :c) :d) :e) :f) + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#98 + def send_leaf(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#21 +RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#23 +RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::WITHOUT_BLOCK_MSG = T.let(T.unsafe(nil), String) + +# Ensures that callback conditionals are bound to the right type +# so that they are type checked properly. +# +# Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need +# binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction +# introduces new typing errors. +# +# @example +# +# # bad +# class Post < ApplicationRecord +# before_create :do_it, if: -> { should_do_it? } +# +# def should_do_it? +# true +# end +# end +# +# # good +# class Post < ApplicationRecord +# before_create :do_it, if: -> { +# T.bind(self, Post) +# should_do_it? +# } +# +# def should_do_it? +# true +# end +# end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#35 +class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Cop + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#75 + def autocorrect(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#127 + def on_send(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#36 +RuboCop::Cop::Sorbet::CallbackConditionalsBinding::CALLBACKS = T.let(T.unsafe(nil), Array) + +# Disallows the usage of `checked(true)`. This usage could cause +# confusion; it could lead some people to believe that a method would be checked +# even if runtime checks have not been enabled on the class or globally. +# Additionally, in the event where checks are enabled, `checked(true)` would +# be redundant; only `checked(false)` or `soft` would change the behaviour. +# +# @example +# +# # bad +# sig { void.checked(true) } +# +# # good +# sig { void } +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#22 +class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Sorbet::SignatureCop + include ::RuboCop::Cop::RangeHelp + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#26 + def offending_node(param0); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#37 + def on_signature(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#30 +RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String) + +# Disallows the calls that are used to get constants fom Strings +# such as +constantize+, +const_get+, and +constants+. +# +# The goal of this cop is to make the code easier to statically analyze, +# more IDE-friendly, and more predictable. It leads to code that clearly +# expresses which values the constant can have. +# +# @example +# +# # bad +# class_name.constantize +# +# # bad +# constants.detect { |c| c.name == "User" } +# +# # bad +# const_get(class_name) +# +# # good +# case class_name +# when "User" +# User +# else +# raise ArgumentError +# end +# +# # good +# { "User" => User }.fetch(class_name) +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#37 +class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#38 + def constant_from_string?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#42 + def on_send(node); end +end + +# Checks for blank lines after signatures. +# +# It also suggests an autocorrect +# +# @example +# +# # bad +# sig { void } +# +# def foo; end +# +# # good +# sig { void } +# def foo; end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#23 +class RuboCop::Cop::Sorbet::EmptyLineAfterSig < ::RuboCop::Cop::Sorbet::SignatureCop + include ::RuboCop::Cop::RangeHelp + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#33 + def autocorrect(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#26 + def on_signature(node); end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#48 + def next_method(node); end +end + +# Checks that the Sorbet sigil comes as the first magic comment in the file. +# +# The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal. +# +# For example, the following bad ordering: +# +# ```ruby +# class Foo; end +# ``` +# +# Will be corrected as: +# +# ```ruby +# class Foo; end +# ``` +# +# Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered, +# other comments or magic comments are left in the same place. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#30 +class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil + include ::RuboCop::Cop::RangeHelp + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#42 + def autocorrect(_node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#33 + def investigate(processed_source); end + + protected + + # checks + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#92 + def check_magic_comments_order(tokens); end + + # Get all the tokens in `processed_source` that match `MAGIC_REGEX` + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#84 + def extract_magic_comments(processed_source); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#68 +RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70 +RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#69 +RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#79 +RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#72 +RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash) + +# Checks that every method definition and attribute accessor has a Sorbet signature. +# +# It also suggest an autocorrect with placeholders so the following code: +# +# ``` +# def foo(a, b, c); end +# ``` +# +# Will be corrected as: +# +# ``` +# sig { params(a: T.untyped, b: T.untyped, c: T.untyped).returns(T.untyped) +# def foo(a, b, c); end +# ``` +# +# You can configure the placeholders used by changing the following options: +# +# * `ParameterTypePlaceholder`: placeholders used for parameter types (default: 'T.untyped') +# * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped') +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#29 +class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Sorbet::SignatureCop + # @return [EnforceSignatures] a new instance of EnforceSignatures + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#30 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#36 + def accessor?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#56 + def autocorrect(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#40 + def on_def(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#44 + def on_defs(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#48 + def on_send(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#52 + def on_signature(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#75 + def scope(node); end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#84 + def check_node(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#95 + def param_type_placeholder; end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#99 + def return_type_placeholder; end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#103 +class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion + # @return [SigSuggestion] a new instance of SigSuggestion + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#106 + def initialize(indent, param_placeholder, return_placeholder); end + + # Returns the value of attribute params. + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + def params; end + + # Sets the attribute params + # + # @param value the value to set the attribute params to. + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + def params=(_arg0); end + + # Returns the value of attribute returns. + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + def returns; end + + # Sets the attribute returns + # + # @param value the value to set the attribute returns to. + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + def returns=(_arg0); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#114 + def to_autocorrect; end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#126 + def generate_params; end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#138 + def generate_return; end +end + +# Checks that there is only one Sorbet sigil in a given file +# +# For example, the following class with two sigils +# +# ```ruby +# class Foo; end +# ``` +# +# Will be corrected as: +# +# ```ruby +# class Foo; end +# ``` +# +# Other comments or magic comments are left in place. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#26 +class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil + include ::RuboCop::Cop::RangeHelp + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#40 + def autocorrect(_node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29 + def investigate(processed_source); end + + protected + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#56 + def extract_all_sigils(processed_source); end +end + +# Makes the Sorbet `false` sigil mandatory in all files. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/false_sigil.rb#10 +class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/false_sigil.rb#11 + def minimum_strictness; end +end + +# Ensures RBI shims do not include a call to extend T::Sig +# or to extend T::Helpers +# +# @example +# +# # bad +# module SomeModule +# extend T::Sig +# extend T::Helpers +# +# sig { returns(String) } +# def foo; end +# end +# +# # good +# module SomeModule +# sig { returns(String) } +# def foo; end +# end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#25 +class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#33 + def extend_t_sig_or_helpers?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#37 + def on_send(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#29 +RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#30 +RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Correct `send` expressions in include statements by constant literals. +# +# Sorbet, the static checker, is not (yet) able to support constructs on the +# following form: +# +# ```ruby +# class MyClass +# include send_expr +# end +# ``` +# +# Multiple occurences of this can be found in Shopify's code base like: +# +# ```ruby +# include Rails.application.routes.url_helpers +# ``` +# or +# ```ruby +# include Polaris::Engine.helpers +# ``` +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#29 +class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Cop + # @return [ForbidIncludeConstLiteral] a new instance of ForbidIncludeConstLiteral + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#41 + def initialize(*_arg0); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#60 + def autocorrect(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#35 + def not_lit_const_include?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#46 + def on_send(node); end + + # Returns the value of attribute used_names. + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32 + def used_names; end + + # Sets the attribute used_names + # + # @param value the value to set the attribute used_names to. + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32 + def used_names=(_arg0); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#30 +RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String) + +# Makes sure that RBI files are always located under the defined allowed paths. +# +# Options: +# +# * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["rbi/**", "sorbet/rbi/**"]) +# +# @example +# # bad +# # lib/some_file.rbi +# # other_file.rbi +# +# # good +# # rbi/external_interface.rbi +# # sorbet/rbi/some_file.rbi +# # sorbet/rbi/any/path/for/file.rbi +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23 +class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Cop + include ::RuboCop::Cop::RangeHelp + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26 + def investigate(processed_source); end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#58 + def allowed_paths; end +end + +# Correct superclass `send` expressions by constant literals. +# +# Sorbet, the static checker, is not (yet) able to support constructs on the +# following form: +# +# ```ruby +# class Foo < send_expr; end +# ``` +# +# Multiple occurences of this can be found in Shopify's code base like: +# +# ```ruby +# class ShopScope < Component::TrustedIdScope[ShopIdentity::ShopId] +# ``` +# or +# ```ruby +# class ApiClientEligibility < Struct.new(:api_client, :match_results, :shop) +# ``` +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#28 +class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#32 + def dynamic_superclass?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#36 + def on_class(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#29 +RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String) + +# Disallows using `T.unsafe` anywhere. +# +# @example +# +# # bad +# T.unsafe(foo) +# +# # good +# foo +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17 +class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24 + def on_send(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#22 + def t_unsafe?(param0 = T.unsafe(nil)); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18 +RuboCop::Cop::Sorbet::ForbidTUnsafe::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#19 +RuboCop::Cop::Sorbet::ForbidTUnsafe::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows using `T.untyped` anywhere. +# +# @example +# +# # bad +# sig { params(my_argument: T.untyped).void } +# def foo(my_argument); end +# +# # good +# sig { params(my_argument: String).void } +# def foo(my_argument); end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20 +class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#27 + def on_send(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#25 + def t_untyped?(param0 = T.unsafe(nil)); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21 +RuboCop::Cop::Sorbet::ForbidTUntyped::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#22 +RuboCop::Cop::Sorbet::ForbidTUntyped::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows use of `T.untyped` or `T.nilable(T.untyped)` +# as a prop type for `T::Struct` or `T::ImmutableStruct`. +# +# @example +# +# # bad +# class SomeClass < T::Struct +# const :foo, T.untyped +# prop :bar, T.nilable(T.untyped) +# end +# +# # good +# class SomeClass < T::Struct +# const :foo, Integer +# prop :bar, T.nilable(String) +# end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25 +class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#54 + def on_class(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44 + def subclass_of_t_struct?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#39 + def t_nilable_untyped(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#29 + def t_struct(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#34 + def t_untyped(param0 = T.unsafe(nil)); end + + # Search for untyped prop/const declarations and capture their types + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#50 + def untyped_props(param0); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26 +RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String) + +# Makes the Sorbet typed sigil mandatory in all files. +# +# Options: +# +# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false') +# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one +# +# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/has_sigil.rb#17 +class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/has_sigil.rb#20 + def require_sigil_on_all_files?; end +end + +# Makes the Sorbet `ignore` sigil mandatory in all files. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10 +class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11 + def minimum_strictness; end +end + +# Disallows declaring implicit conversion methods. +# Since Sorbet is a nominal (not structural) type system, +# implicit conversion is currently unsupported. +# +# @example +# +# # bad +# def to_str; end +# +# # good +# def to_str(x); end +# +# # bad +# def self.to_str; end +# +# # good +# def self.to_str(x); end +# +# # bad +# alias to_str to_s +# @note Since the arity of aliased methods is not checked, false positives may result. +# @see https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#31 +class RuboCop::Cop::Sorbet::ImplicitConversionMethod < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#37 + def on_alias(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42 + def on_def(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42 + def on_defs(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#50 + def on_send(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#32 +RuboCop::Cop::Sorbet::ImplicitConversionMethod::IMPLICIT_CONVERSION_METHODS = T.let(T.unsafe(nil), Array) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#33 +RuboCop::Cop::Sorbet::ImplicitConversionMethod::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#35 +RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the ordering of keyword arguments required by +# sorbet-runtime. The ordering requires that all keyword arguments +# are at the end of the parameters list, and all keyword arguments +# with a default value must be after those without default values. +# +# @example +# +# # bad +# sig { params(a: Integer, b: String).void } +# def foo(a: 1, b:); end +# +# # good +# sig { params(b: String, a: Integer).void } +# def foo(b:, a: 1); end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23 +class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Sorbet::SignatureCop + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#24 + def on_signature(node); end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#35 + def check_order_for_kwoptargs(parameters); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8 +module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 + def on_assignment(value); end + + class << self + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#10 + def prepended(base); end + end +end + +# Checks for the obsolete pattern for initializing instance variables that was required for older Sorbet +# +# It's no longer required, as of Sorbet 0.5.10210 +# See https://sorbet.org/docs/type-assertions#put-type-assertions-behind-memoization +# +# @example +# +# # bad +# sig { returns(Foo) } +# def foo +# @foo = T.let(@foo, T.nilable(Foo)) +# @foo ||= Foo.new +# end +# +# # bad +# sig { returns(Foo) } +# def foo +# # This would have been a mistake, causing the memoized value to be discarded and recomputed on every call. +# @foo = T.let(nil, T.nilable(Foo)) +# @foo ||= Foo.new +# end +# +# # good +# sig { returns(Foo) } +# def foo +# @foo ||= T.let(Foo.new, T.nilable(Foo)) +# end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#37 +class RuboCop::Cop::Sorbet::ObsoleteStrictMemoization < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::MatchRange + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::LineLengthHelp + include ::RuboCop::Cop::Sorbet::TargetSorbetVersion + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#51 + def legacy_memoization_pattern?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#62 + def on_begin(node); end + + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#86 + def relevant_file?(file); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#47 +RuboCop::Cop::Sorbet::ObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String) + +# Ensures one ancestor per requires_ancestor line +# rather than chaining them as a comma-separated list. +# +# @example +# +# # bad +# module SomeModule +# requires_ancestor Kernel, Minitest::Assertions +# end +# +# # good +# module SomeModule +# requires_ancestor Kernel +# requires_ancestor Minitest::Assertions +# end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#24 +class RuboCop::Cop::Sorbet::OneAncestorPerLine < ::RuboCop::Cop::Cop + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#38 + def abstract?(param0); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#56 + def autocorrect(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#33 + def more_than_one_ancestor(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#49 + def on_class(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#42 + def on_module(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#28 + def requires_ancestors(param0); end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#72 + def new_ra_line(indent_count); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#66 + def process_node(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#25 +RuboCop::Cop::Sorbet::OneAncestorPerLine::MSG = T.let(T.unsafe(nil), String) + +# Forbids the use of redundant `extend T::Sig`. Only for use in +# applications that monkey patch `Module.include(T::Sig)` globally, +# which would make it redundant. +# +# @example +# # bad +# class Example +# extend T::Sig +# sig { void } +# def no_op; end +# end +# +# # good +# class Example +# sig { void } +# def no_op; end +# end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#28 +class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#35 + def extend_t_sig?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#39 + def on_send(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#31 +RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#32 +RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#15 +class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Sorbet::SignatureCop + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#59 + def autocorrect(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#35 + def on_signature(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#31 + def root_call(param0); end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#101 + def call_chain(sig_child_node); end + + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#97 + def can_autocorrect?; end + + # This method exists to reparse the current node with modern features enabled. + # Modern features include "index send" emitting, which is necessary to unparse + # "index sends" (i.e. `[]` calls) back to index accessors (i.e. as `foo[bar]``). + # Otherwise, we would get the unparsed node as `foo.[](bar)`. + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#88 + def node_reparsed_with_modern_features(node); end +end + +# Create a subclass of AST Builder that has modern features turned on +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#77 +class RuboCop::Cop::Sorbet::SignatureBuildOrder::ModernBuilder < ::RuboCop::AST::Builder; end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#16 +RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash) + +# Abstract cop specific to Sorbet signatures +# +# You can subclass it to use the `on_signature` trigger and the `signature?` node matcher. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_cop.rb#11 +class RuboCop::Cop::Sorbet::SignatureCop < ::RuboCop::Cop::Cop + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_cop.rb#33 + def on_block(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_cop.rb#33 + def on_numblock(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_cop.rb#39 + def on_signature(_); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_cop.rb#15 + def signature?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_cop.rb#24 + def with_runtime?(param0 = T.unsafe(nil)); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_cop.rb#29 + def without_runtime?(param0 = T.unsafe(nil)); end +end + +# Ensures empty class/module definitions in RBI files are +# done on a single line rather than being split across multiple lines. +# +# @example +# +# # bad +# module SomeModule +# end +# +# # good +# module SomeModule; end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17 +class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22 + def on_class(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22 + def on_module(node); end + + private + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34 + def convert_newlines_to_semicolons(source); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20 +RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String) + +# Makes the Sorbet `strict` sigil mandatory in all files. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#10 +class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#11 + def minimum_strictness; end +end + +# Makes the Sorbet `strong` sigil mandatory in all files. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10 +class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11 + def minimum_strictness; end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#6 +module RuboCop::Cop::Sorbet::TargetSorbetVersion + mixes_in_class_methods ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#24 + def enabled_for_sorbet_static_version?; end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#40 + def read_sorbet_static_version_from_bundler_lock_file; end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#31 + def target_sorbet_static_version_from_bundler_lock_file; end + + class << self + # @private + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#8 + def included(target); end + end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#13 +module RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + # The version of the Sorbet static type checker required by this cop + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#15 + def minimum_target_sorbet_static_version(version); end + + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#19 + def support_target_sorbet_static_version?(version); end +end + +# Makes the Sorbet `true` sigil mandatory in all files. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10 +class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11 + def minimum_strictness; end +end + +# Ensures all constants used as `T.type_alias` are using CamelCase. +# +# @example +# +# # bad +# FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) } +# +# # good +# FooOrBar = T.type_alias { T.any(Foo, Bar) } +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#17 +class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#32 + def on_casgn(node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#21 + def underscored_type_alias?(param0 = T.unsafe(nil)); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#18 +RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String) + +# Checks that every Ruby file contains a valid Sorbet sigil. +# Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52 +# +# Options: +# +# * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false) +# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false') +# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one +# * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one +# +# If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect. +# Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect. +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#20 +class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#35 + def autocorrect(_node); end + + # So we can properly subclass this cop + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#23 + def investigate(processed_source); end + + protected + + # checks + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#70 + def check_sigil_present(sigil); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#130 + def check_strictness_level(sigil, strictness); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#108 + def check_strictness_not_empty(sigil, strictness); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#119 + def check_strictness_valid(sigil, strictness); end + + # Default is `nil` + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#180 + def exact_strictness; end + + # extraction + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#58 + def extract_sigil(processed_source); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#64 + def extract_strictness(sigil); end + + # Default is `nil` + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#174 + def minimum_strictness; end + + # Default is `false` + # + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#163 + def require_sigil_on_all_files?; end + + # Default is `'false'` + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#168 + def suggested_strictness; end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#86 + def suggested_strictness_level; end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#54 +RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#53 +RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array) + +module RuboCop::Cop::Style; end + +class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour +end + +# source://rubocop-sorbet/lib/rubocop/sorbet/version.rb#4 +module RuboCop::Sorbet; end + +# source://rubocop-sorbet/lib/rubocop/sorbet.rb#12 +RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash) + +# source://rubocop-sorbet/lib/rubocop/sorbet.rb#11 +RuboCop::Sorbet::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname) + +# source://rubocop-sorbet/lib/rubocop/sorbet.rb#8 +class RuboCop::Sorbet::Error < ::StandardError; end + +# Because RuboCop doesn't yet support plugins, we have to monkey patch in a +# bit of our configuration. +# +# source://rubocop-sorbet/lib/rubocop/sorbet/inject.rb#9 +module RuboCop::Sorbet::Inject + class << self + # source://rubocop-sorbet/lib/rubocop/sorbet/inject.rb#11 + def defaults!; end + end +end + +# source://rubocop-sorbet/lib/rubocop/sorbet.rb#10 +RuboCop::Sorbet::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname) + +# source://rubocop-sorbet/lib/rubocop/sorbet/version.rb#5 +RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/ruby-lsp@0.10.1.rbi b/sorbet/rbi/gems/ruby-lsp@0.11.1.rbi similarity index 69% rename from sorbet/rbi/gems/ruby-lsp@0.10.1.rbi rename to sorbet/rbi/gems/ruby-lsp@0.11.1.rbi index 4ef5a5b..6ef6cc9 100644 --- a/sorbet/rbi/gems/ruby-lsp@0.10.1.rbi +++ b/sorbet/rbi/gems/ruby-lsp@0.11.1.rbi @@ -19,27 +19,31 @@ class RubyIndexer::Configuration sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#65 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#61 sig { returns(T::Array[::RubyIndexer::IndexablePath]) } def indexables; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#51 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#47 sig { void } def load_config; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#148 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#144 sig { returns(::Regexp) } def magic_comment_regex; end private - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#170 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#166 sig { params(config: T::Hash[::String, T.untyped]).void } def apply_config(config); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#175 + sig { returns(T::Array[::String]) } + def initial_excluded_gems; end + # @raise [ArgumentError] # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#155 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/configuration.rb#151 sig { params(config: T::Hash[::String, T.untyped]).void } def validate_config!(config); end end @@ -49,33 +53,48 @@ RubyIndexer::Configuration::CONFIGURATION_SCHEMA = T.let(T.unsafe(nil), Hash) # 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#12 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#14 sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#63 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#65 sig { params(entry: ::RubyIndexer::Index::Entry).void } def <<(entry); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#72 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#74 sig { params(fully_qualified_name: ::String).returns(T.nilable(T::Array[::RubyIndexer::Index::Entry])) } def [](fully_qualified_name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#35 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#37 sig { params(indexable: ::RubyIndexer::IndexablePath).void } def delete(indexable); end + # Follows aliases in a namespace. The algorithm keeps checking if the name is an alias and then recursively follows + # it. The idea is that we test the name in parts starting from the complete name to the first namespace. For + # `Foo::Bar::Baz`, we would test: + # 1. Is `Foo::Bar::Baz` an alias? Get the target and recursively follow its target + # 2. Is `Foo::Bar` an alias? Get the target and recursively follow its target + # 3. Is `Foo` an alias? Get the target and recursively follow its target + # + # If we find an alias, then we want to follow its target. In the same example, if `Foo::Bar` is an alias to + # `Something::Else`, then we first discover `Something::Else::Baz`. But `Something::Else::Baz` might contain other + # aliases, so we have to invoke `follow_aliased_namespace` again to check until we only return a real name + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#184 + sig { params(name: ::String).returns(::String) } + def follow_aliased_namespace(name); end + # 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#108 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#110 sig { params(query: T.nilable(::String)).returns(T::Array[::RubyIndexer::Index::Entry]) } def fuzzy_search(query); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#139 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#157 sig { params(indexable_paths: T::Array[::RubyIndexer::IndexablePath]).void } def index_all(indexable_paths: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#144 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#162 sig { params(indexable_path: ::RubyIndexer::IndexablePath, source: T.nilable(::String)).void } def index_single(indexable_path, source = T.unsafe(nil)); end @@ -93,7 +112,7 @@ class RubyIndexer::Index # ] # ``` # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#95 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#97 sig { params(query: ::String, nesting: T::Array[::String]).returns(T::Array[T::Array[::RubyIndexer::Index::Entry]]) } def prefix_search(query, nesting); end @@ -103,63 +122,136 @@ class RubyIndexer::Index # 2. Foo::Baz # 3. Baz # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#127 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#129 sig { params(name: ::String, nesting: T::Array[::String]).returns(T.nilable(T::Array[::RubyIndexer::Index::Entry])) } def resolve(name, nesting); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#77 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#79 sig { params(query: ::String).returns(T::Array[::RubyIndexer::IndexablePath]) } def search_require_paths(query); end + + private + + # Attempts to resolve an UnresolvedAlias into a resolved Alias. If the unresolved alias is pointing to a constant + # that doesn't exist, then we return the same UnresolvedAlias + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#218 + sig do + params( + entry: ::RubyIndexer::Index::Entry::UnresolvedAlias + ).returns(T.any(::RubyIndexer::Index::Entry::Alias, ::RubyIndexer::Index::Entry::UnresolvedAlias)) + end + def resolve_alias(entry); end 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#9 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#11 RubyIndexer::Index::ENTRY_SIMILARITY_THRESHOLD = T.let(T.unsafe(nil), Float) -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#155 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#235 class RubyIndexer::Index::Entry - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#171 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#254 sig { params(name: ::String, file_path: ::String, location: ::YARP::Location, comments: T::Array[::String]).void } def initialize(name, file_path, location, comments); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#168 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#248 sig { returns(T::Array[::String]) } def comments; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#179 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#263 sig { returns(::String) } def file_name; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#162 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#242 sig { returns(::String) } def file_path; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#165 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#245 sig { returns(::YARP::Location) } def location; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#159 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#239 sig { returns(::String) } def name; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#251 + sig { returns(::Symbol) } + def visibility; end + + # @return [Symbol] + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#251 + def visibility=(_arg0); end end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#193 +# Alias represents a resolved alias, which points to an existing constant target +# +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#321 +class RubyIndexer::Index::Entry::Alias < ::RubyIndexer::Index::Entry + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#328 + sig { params(target: ::String, unresolved_alias: ::RubyIndexer::Index::Entry::UnresolvedAlias).void } + def initialize(target, unresolved_alias); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#325 + sig { returns(::String) } + def target; end +end + +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#277 class RubyIndexer::Index::Entry::Class < ::RubyIndexer::Index::Entry::Namespace; end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#196 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#280 class RubyIndexer::Index::Entry::Constant < ::RubyIndexer::Index::Entry; end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#190 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#274 class RubyIndexer::Index::Entry::Module < ::RubyIndexer::Index::Entry::Namespace; end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#183 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#267 class RubyIndexer::Index::Entry::Namespace < ::RubyIndexer::Index::Entry - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#185 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#269 sig { returns(::String) } def short_name; end end +# An UnresolvedAlias points to a constant alias with a right hand side that has not yet been resolved. For +# example, if we find +# +# ```ruby +# CONST = Foo +# ``` +# Before we have discovered `Foo`, there's no way to eagerly resolve this alias to the correct target constant. +# All aliases are inserted as UnresolvedAlias in the index first and then we lazily resolve them to the correct +# target in [rdoc-ref:Index#resolve]. If the right hand side contains a constant that doesn't exist, then it's not +# possible to resolve the alias and it will remain an UnresolvedAlias until the right hand side constant exists +# +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#293 +class RubyIndexer::Index::Entry::UnresolvedAlias < ::RubyIndexer::Index::Entry + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#312 + sig do + params( + target: ::String, + nesting: T::Array[::String], + name: ::String, + file_path: ::String, + location: ::YARP::Location, + comments: T::Array[::String] + ).void + end + def initialize(target, nesting, name, file_path, location, comments); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#300 + sig { returns(T::Array[::String]) } + def nesting; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#297 + sig { returns(::String) } + def target; end +end + +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#8 +class RubyIndexer::Index::UnresolvableAliasError < ::StandardError; end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#5 class RubyIndexer::IndexVisitor < ::YARP::Visitor # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#9 @@ -176,31 +268,36 @@ class RubyIndexer::IndexVisitor < ::YARP::Visitor # Override to avoid using `map` instead of `each` # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#47 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#57 sig { params(nodes: T::Array[T.nilable(::YARP::Node)]).void } def visit_all(nodes); end private - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#58 - sig { params(node: T.any(::YARP::ConstantOrWriteNode, ::YARP::ConstantWriteNode)).void } - def add_constant(node); end - - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#68 - sig { params(node: T.any(::YARP::ConstantPathOrWriteNode, ::YARP::ConstantPathWriteNode)).void } - def add_constant_with_path(node); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#101 + sig do + params( + node: T.any(::YARP::ConstantOrWriteNode, ::YARP::ConstantPathAndWriteNode, ::YARP::ConstantPathOperatorWriteNode, ::YARP::ConstantPathOrWriteNode, ::YARP::ConstantPathWriteNode, ::YARP::ConstantWriteNode), + name: ::String + ).void + end + def add_constant(node, name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#78 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#126 sig { params(node: T.any(::YARP::ClassNode, ::YARP::ModuleNode), klass: T.class_of(RubyIndexer::Index::Entry)).void } def add_index_entry(node, klass); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#93 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#141 sig { params(node: ::YARP::Node).returns(T::Array[::String]) } def collect_comments(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#115 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#163 sig { params(name: ::String).returns(::String) } def fully_qualify_name(name); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/visitor.rb#64 + sig { params(node: ::YARP::CallNode).void } + def handle_private_constant(node); end end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/indexable_path.rb#5 @@ -342,49 +439,217 @@ class RubyIndexer::PrefixTree::Node def value=(_arg0); end end -# source://ruby-lsp/lib/ruby-lsp.rb#4 +# source://ruby-lsp/lib/ruby_lsp/addon.rb#4 module RubyLsp; end +# To register an addon, inherit from this class and implement both `name` and `activate` +# +# # Example +# +# ```ruby +# module MyGem +# class MyAddon < Addon +# def activate +# # Perform any relevant initialization +# end +# +# def name +# "My addon name" +# end +# end +# end +# ``` +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://ruby-lsp/lib/ruby_lsp/addon.rb#22 +class RubyLsp::Addon + abstract! + + # source://ruby-lsp/lib/ruby_lsp/addon.rb#67 + sig { void } + def initialize; end + + # Each addon should implement `MyAddon#activate` and use to perform any sort of initialization, such as + # reading information into memory or even spawning a separate process + # + # @abstract + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#98 + sig { abstract.void } + def activate; end + + # source://ruby-lsp/lib/ruby_lsp/addon.rb#72 + sig { params(error: ::StandardError).returns(T.self_type) } + def add_error(error); end + + # source://ruby-lsp/lib/ruby_lsp/addon.rb#91 + sig { returns(::String) } + def backtraces; end + + # Creates a new CodeLens listener. This method is invoked on every CodeLens request + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#117 + sig do + overridable + .params( + uri: ::URI::Generic, + emitter: ::RubyLsp::EventEmitter, + message_queue: ::Thread::Queue + ).returns(T.nilable(RubyLsp::Listener[T::Array[::LanguageServer::Protocol::Interface::CodeLens]])) + end + def create_code_lens_listener(uri, emitter, message_queue); end + + # Creates a new Definition listener. This method is invoked on every Definition request + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#149 + sig do + overridable + .params( + uri: ::URI::Generic, + nesting: T::Array[::String], + index: ::RubyIndexer::Index, + emitter: ::RubyLsp::EventEmitter, + message_queue: ::Thread::Queue + ).returns(T.nilable(RubyLsp::Listener[T.nilable(T.any(::LanguageServer::Protocol::Interface::Location, T::Array[::LanguageServer::Protocol::Interface::Location]))])) + end + def create_definition_listener(uri, nesting, index, emitter, message_queue); end + + # Creates a new DocumentSymbol listener. This method is invoked on every DocumentSymbol request + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#137 + sig do + overridable + .params( + emitter: ::RubyLsp::EventEmitter, + message_queue: ::Thread::Queue + ).returns(T.nilable(RubyLsp::Listener[T::Array[::LanguageServer::Protocol::Interface::DocumentSymbol]])) + end + def create_document_symbol_listener(emitter, message_queue); end + + # Creates a new Hover listener. This method is invoked on every Hover request + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#128 + sig do + overridable + .params( + nesting: T::Array[::String], + index: ::RubyIndexer::Index, + emitter: ::RubyLsp::EventEmitter, + message_queue: ::Thread::Queue + ).returns(T.nilable(RubyLsp::Listener[T.nilable(::LanguageServer::Protocol::Interface::Hover)])) + end + def create_hover_listener(nesting, index, emitter, message_queue); end + + # Each addon should implement `MyAddon#deactivate` and use to perform any clean up, like shutting down a + # child process + # + # @abstract + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#103 + sig { abstract.void } + def deactivate; end + + # source://ruby-lsp/lib/ruby_lsp/addon.rb#78 + sig { returns(T::Boolean) } + def error?; end + + # source://ruby-lsp/lib/ruby_lsp/addon.rb#83 + sig { returns(::String) } + def formatted_errors; end + + # Addons should override the `name` method to return the addon name + # + # @abstract + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#107 + sig { abstract.returns(::String) } + def name; end + + class << self + # source://ruby-lsp/lib/ruby_lsp/addon.rb#39 + sig { returns(T::Array[::RubyLsp::Addon]) } + def addons; end + + # Automatically track and instantiate addon classes + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#33 + sig { params(child_class: T.class_of(RubyLsp::Addon)).void } + def inherited(child_class); end + + # Discovers and loads all addons. Returns the list of activated addons + # + # source://ruby-lsp/lib/ruby_lsp/addon.rb#45 + sig { returns(T::Array[::RubyLsp::Addon]) } + def load_addons; end + end +end + # source://ruby-lsp/lib/ruby_lsp/server.rb#7 RubyLsp::Constant = LanguageServer::Protocol::Constant -# source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#5 -module RubyLsp::DependencyDetector - class << self - # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#10 - sig { returns(::String) } - def detected_formatter; end +# source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#7 +class RubyLsp::DependencyDetector + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#21 + sig { void } + def initialize; end + + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#68 + sig { returns(T::Array[::String]) } + def dependency_keys; end + + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#28 + sig { returns(::String) } + def detect_formatter; end + + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#40 + sig { returns(::String) } + def detect_test_library; end + + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#63 + sig { returns(T::Boolean) } + def detect_typechecker; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#22 - sig { returns(::String) } - def detected_test_library; end + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#12 + sig { returns(::String) } + def detected_formatter; end + + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#15 + sig { returns(::String) } + def detected_test_library; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#45 - sig { params(gem_pattern: ::Regexp).returns(T::Boolean) } - def direct_dependency?(gem_pattern); end + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#58 + sig { params(gem_pattern: ::Regexp).returns(T::Boolean) } + def direct_dependency?(gem_pattern); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#40 - sig { returns(T::Boolean) } - def typechecker?; end + # source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#18 + sig { returns(T::Boolean) } + def typechecker; end + + class << self + private + + def allocate; end + def new(*_arg0); end end end -# source://ruby-lsp/lib/ruby_lsp/requests/support/dependency_detector.rb#53 -RubyLsp::DependencyDetector::HAS_TYPECHECKER = T.let(T.unsafe(nil), TrueClass) - # source://ruby-lsp/lib/ruby_lsp/document.rb#5 class RubyLsp::Document # source://ruby-lsp/lib/ruby_lsp/document.rb#25 sig { params(source: ::String, version: ::Integer, uri: ::URI::Generic, encoding: ::String).void } def initialize(source:, version:, uri:, encoding: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/document.rb#39 + # source://ruby-lsp/lib/ruby_lsp/document.rb#46 sig { params(other: ::RubyLsp::Document).returns(T::Boolean) } def ==(other); end # TODO: remove this method once all nonpositional requests have been migrated to the listener pattern # - # source://ruby-lsp/lib/ruby_lsp/document.rb#51 + # source://ruby-lsp/lib/ruby_lsp/document.rb#58 sig do type_parameters(:T) .params( @@ -394,46 +659,50 @@ class RubyLsp::Document end def cache_fetch(request_name, &block); end - # source://ruby-lsp/lib/ruby_lsp/document.rb#66 + # source://ruby-lsp/lib/ruby_lsp/document.rb#73 sig { params(request_name: ::String).returns(T.untyped) } def cache_get(request_name); end - # source://ruby-lsp/lib/ruby_lsp/document.rb#61 + # source://ruby-lsp/lib/ruby_lsp/document.rb#68 sig { type_parameters(:T).params(request_name: ::String, value: T.type_parameter(:T)).returns(T.type_parameter(:T)) } def cache_set(request_name, value); end - # source://ruby-lsp/lib/ruby_lsp/document.rb#109 + # source://ruby-lsp/lib/ruby_lsp/document.rb#41 + sig { returns(T::Array[::YARP::Comment]) } + def comments; end + + # source://ruby-lsp/lib/ruby_lsp/document.rb#108 sig { returns(::RubyLsp::Document::Scanner) } def create_scanner; end - # source://ruby-lsp/lib/ruby_lsp/document.rb#132 + # source://ruby-lsp/lib/ruby_lsp/document.rb#129 sig do params( - node: ::SyntaxTree::Node, + node: ::YARP::Node, char_position: ::Integer, - node_types: T::Array[T.class_of(SyntaxTree::Node)] - ).returns([T.nilable(::SyntaxTree::Node), T.nilable(::SyntaxTree::Node), T::Array[::String]]) + node_types: T::Array[T.class_of(YARP::Node)] + ).returns([T.nilable(::YARP::Node), T.nilable(::YARP::Node), T::Array[::String]]) end def locate(node, char_position, node_types: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/document.rb#119 + # source://ruby-lsp/lib/ruby_lsp/document.rb#118 sig do params( position: {line: ::Integer, character: ::Integer}, - node_types: T::Array[T.class_of(SyntaxTree::Node)] - ).returns([T.nilable(::SyntaxTree::Node), T.nilable(::SyntaxTree::Node), T::Array[::String]]) + node_types: T::Array[T.class_of(YARP::Node)] + ).returns([T.nilable(::YARP::Node), T.nilable(::YARP::Node), T::Array[::String]]) end def locate_node(position, node_types: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/document.rb#88 + # source://ruby-lsp/lib/ruby_lsp/document.rb#95 sig { void } def parse; end - # source://ruby-lsp/lib/ruby_lsp/document.rb#104 - sig { returns(T::Boolean) } - def parsed?; end + # source://ruby-lsp/lib/ruby_lsp/document.rb#13 + sig { returns(::YARP::ParseResult) } + def parse_result; end - # source://ruby-lsp/lib/ruby_lsp/document.rb#71 + # source://ruby-lsp/lib/ruby_lsp/document.rb#78 sig do params( edits: T::Array[{range: {start: {line: ::Integer, character: ::Integer}, end: {line: ::Integer, character: ::Integer}}, text: ::String}], @@ -446,12 +715,12 @@ class RubyLsp::Document sig { returns(::String) } def source; end - # source://ruby-lsp/lib/ruby_lsp/document.rb#99 + # source://ruby-lsp/lib/ruby_lsp/document.rb#103 sig { returns(T::Boolean) } def syntax_error?; end - # source://ruby-lsp/lib/ruby_lsp/document.rb#13 - sig { returns(T.nilable(::SyntaxTree::Node)) } + # source://ruby-lsp/lib/ruby_lsp/document.rb#36 + sig { returns(::YARP::ProgramNode) } def tree; end # source://ruby-lsp/lib/ruby_lsp/document.rb#22 @@ -472,35 +741,35 @@ RubyLsp::Document::PositionShape = T.type_alias { {line: ::Integer, character: : # source://ruby-lsp/lib/ruby_lsp/document.rb#9 RubyLsp::Document::RangeShape = T.type_alias { {start: {line: ::Integer, character: ::Integer}, end: {line: ::Integer, character: ::Integer}} } -# source://ruby-lsp/lib/ruby_lsp/document.rb#182 +# source://ruby-lsp/lib/ruby_lsp/document.rb#179 class RubyLsp::Document::Scanner - # source://ruby-lsp/lib/ruby_lsp/document.rb#190 + # source://ruby-lsp/lib/ruby_lsp/document.rb#187 sig { params(source: ::String, encoding: ::String).void } def initialize(source, encoding); end # Finds the character index inside the source string for a given line and column # - # source://ruby-lsp/lib/ruby_lsp/document.rb#199 + # source://ruby-lsp/lib/ruby_lsp/document.rb#196 sig { params(position: {line: ::Integer, character: ::Integer}).returns(::Integer) } def find_char_position(position); end # Subtract 1 for each character after 0xFFFF in the current line from the column position, so that we hit the # right character in the UTF-8 representation # - # source://ruby-lsp/lib/ruby_lsp/document.rb#221 + # source://ruby-lsp/lib/ruby_lsp/document.rb#218 sig { params(current_position: ::Integer, requested_position: ::Integer).returns(::Integer) } def utf_16_character_position_correction(current_position, requested_position); end end -# source://ruby-lsp/lib/ruby_lsp/document.rb#185 +# source://ruby-lsp/lib/ruby_lsp/document.rb#182 RubyLsp::Document::Scanner::LINE_BREAK = T.let(T.unsafe(nil), Integer) # After character 0xFFFF, UTF-16 considers characters to have length 2 and we have to account for that # -# source://ruby-lsp/lib/ruby_lsp/document.rb#187 +# source://ruby-lsp/lib/ruby_lsp/document.rb#184 RubyLsp::Document::Scanner::SURROGATE_PAIR_START = T.let(T.unsafe(nil), Integer) -# EventEmitter is an intermediary between our requests and Syntax Tree visitors. It's used to visit the document's AST +# EventEmitter is an intermediary between our requests and YARP visitors. It's used to visit the document's AST # and emit events that the requests can listen to for providing functionality. Usages: # # - For positional requests, locate the target node and use `emit_for_target` to fire events for each listener @@ -518,110 +787,216 @@ RubyLsp::Document::Scanner::SURROGATE_PAIR_START = T.let(T.unsafe(nil), Integer) # ``` # # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#21 -class RubyLsp::EventEmitter < ::SyntaxTree::Visitor - include ::SyntaxTree::WithScope - - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#26 +class RubyLsp::EventEmitter < ::YARP::Visitor + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#25 sig { void } def initialize; end # Emit events for a specific node. This is similar to the regular `visit` method, but avoids going deeper into the # tree for performance # - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#39 - sig { params(node: T.nilable(::SyntaxTree::Node)).void } + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#38 + sig { params(node: T.nilable(::YARP::Node)).void } def emit_for_target(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#32 + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#31 sig { params(listener: RubyLsp::Listener[T.untyped], events: ::Symbol).void } def register(listener, *events); end # Visit dispatchers are below. Notice that for nodes that create a new scope (e.g.: classes, modules, method defs) # we need both an `on_*` and `after_*` event. This is because some requests must know when we exit the scope # - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#59 - sig { override.params(node: T.nilable(::SyntaxTree::Node)).void } + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#60 + sig { override.params(node: T.nilable(::YARP::Node)).void } def visit(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#66 + sig { params(nodes: T::Array[T.nilable(::YARP::Node)]).void } + def visit_all(nodes); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#280 + sig { override.params(node: ::YARP::ArrayNode).void } + def visit_array_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#340 + sig { override.params(node: ::YARP::BeginNode).void } + def visit_begin_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#250 + sig { override.params(node: ::YARP::BlockLocalVariableNode).void } + def visit_block_local_variable_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#111 + sig { override.params(node: ::YARP::BlockNode).void } + def visit_block_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#130 + sig { override.params(node: ::YARP::BlockParameterNode).void } + def visit_block_parameter_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#85 + sig { override.params(node: ::YARP::CallNode).void } + def visit_call_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#286 + sig { override.params(node: ::YARP::CaseNode).void } + def visit_case_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#71 + sig { override.params(node: ::YARP::ClassNode).void } + def visit_class_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#98 + sig { override.params(node: ::YARP::ClassVariableWriteNode).void } + def visit_class_variable_write_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#190 + sig { override.params(node: ::YARP::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#196 + sig { override.params(node: ::YARP::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#202 + sig { override.params(node: ::YARP::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#172 + sig { override.params(node: ::YARP::ConstantPathNode).void } + def visit_constant_path_node(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#178 - sig { override.params(node: ::SyntaxTree::Binary).void } - def visit_binary(node); end + sig { override.params(node: ::YARP::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#166 - sig { override.params(node: ::SyntaxTree::BlockVar).void } - def visit_block_var(node); end + sig { override.params(node: ::YARP::ConstantReadNode).void } + def visit_constant_read_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#92 - sig { override.params(node: ::SyntaxTree::CallNode).void } - def visit_call(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#208 + sig { override.params(node: ::YARP::ConstantTargetNode).void } + def visit_constant_target_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#65 - sig { override.params(node: ::SyntaxTree::ClassDeclaration).void } - def visit_class(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#184 + sig { override.params(node: ::YARP::ConstantWriteNode).void } + def visit_constant_write_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#79 - sig { override.params(node: ::SyntaxTree::Command).void } - def visit_command(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#104 + sig { override.params(node: ::YARP::DefNode).void } + def visit_def_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#86 - sig { override.params(node: ::SyntaxTree::CommandCall).void } - def visit_command_call(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#328 + sig { override.params(node: ::YARP::ElseNode).void } + def visit_else_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#130 - sig { override.params(node: ::SyntaxTree::Comment).void } - def visit_comment(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#334 + sig { override.params(node: ::YARP::EnsureNode).void } + def visit_ensure_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#184 - sig { override.params(node: ::SyntaxTree::Const).void } - def visit_const(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#292 + sig { override.params(node: ::YARP::ForNode).void } + def visit_for_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#105 - sig { override.params(node: ::SyntaxTree::ConstPathField).void } - def visit_const_path_field(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#298 + sig { override.params(node: ::YARP::HashNode).void } + def visit_hash_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#117 - sig { override.params(node: ::SyntaxTree::DefNode).void } - def visit_def(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#256 + sig { override.params(node: ::YARP::IfNode).void } + def visit_if_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#154 - sig { override.params(node: ::SyntaxTree::Field).void } - def visit_field(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#262 + sig { override.params(node: ::YARP::InNode).void } + def visit_in_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#92 + sig { override.params(node: ::YARP::InstanceVariableWriteNode).void } + def visit_instance_variable_write_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#274 + sig { override.params(node: ::YARP::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#136 + sig { override.params(node: ::YARP::KeywordParameterNode).void } + def visit_keyword_parameter_node(node); end # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#142 - sig { override.params(node: ::SyntaxTree::Kw).void } - def visit_kw(node); end + sig { override.params(node: ::YARP::KeywordRestParameterNode).void } + def visit_keyword_rest_parameter_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#172 - sig { override.params(node: ::SyntaxTree::LambdaVar).void } - def visit_lambda_var(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#226 + sig { override.params(node: ::YARP::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#72 - sig { override.params(node: ::SyntaxTree::ModuleDeclaration).void } - def visit_module(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#232 + sig { override.params(node: ::YARP::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#148 - sig { override.params(node: ::SyntaxTree::Params).void } - def visit_params(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#238 + sig { override.params(node: ::YARP::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#136 - sig { override.params(node: ::SyntaxTree::Rescue).void } - def visit_rescue(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#220 + sig { override.params(node: ::YARP::LocalVariableReadNode).void } + def visit_local_variable_read_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#111 - sig { override.params(node: ::SyntaxTree::TopConstField).void } - def visit_top_const_field(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#244 + sig { override.params(node: ::YARP::LocalVariableTargetNode).void } + def visit_local_variable_target_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#214 + sig { override.params(node: ::YARP::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#78 + sig { override.params(node: ::YARP::ModuleNode).void } + def visit_module_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#148 + sig { override.params(node: ::YARP::OptionalParameterNode).void } + def visit_optional_parameter_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#154 + sig { override.params(node: ::YARP::RequiredParameterNode).void } + def visit_required_parameter_node(node); end # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#124 - sig { override.params(node: ::SyntaxTree::VarField).void } - def visit_var_field(node); end + sig { override.params(node: ::YARP::RescueNode).void } + def visit_rescue_node(node); end # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#160 - sig { override.params(node: ::SyntaxTree::VarRef).void } - def visit_var_ref(node); end + sig { override.params(node: ::YARP::RestParameterNode).void } + def visit_rest_parameter_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#118 + sig { override.params(node: ::YARP::SelfNode).void } + def visit_self_node(node); end - # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#99 - sig { override.params(node: ::SyntaxTree::VCall).void } - def visit_vcall(node); end + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#304 + sig { override.params(node: ::YARP::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#346 + sig { override.params(node: ::YARP::StringConcatNode).void } + def visit_string_concat_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#310 + sig { override.params(node: ::YARP::UnlessNode).void } + def visit_unless_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#316 + sig { override.params(node: ::YARP::UntilNode).void } + def visit_until_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#268 + sig { override.params(node: ::YARP::WhenNode).void } + def visit_when_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/event_emitter.rb#322 + sig { override.params(node: ::YARP::WhileNode).void } + def visit_while_node(node); end end # This class dispatches a request execution to the right request class. No IO should happen anywhere here! @@ -632,21 +1007,21 @@ class RubyLsp::Executor sig { params(store: ::RubyLsp::Store, message_queue: ::Thread::Queue).void } def initialize(store, message_queue); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#22 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#21 sig { params(request: T::Hash[::Symbol, T.untyped]).returns(::RubyLsp::Result) } def execute(request); end private - # source://ruby-lsp/lib/ruby_lsp/executor.rb#527 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#517 sig { params(id: ::String, title: ::String).void } def begin_progress(id, title); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#721 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#711 sig { void } def check_formatter_is_available; end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#404 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#396 sig do params( uri: ::URI::Generic, @@ -656,11 +1031,11 @@ class RubyLsp::Executor end def code_action(uri, range, context); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#411 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#403 sig { params(params: T::Hash[::Symbol, T.untyped]).returns(::LanguageServer::Protocol::Interface::CodeAction) } def code_action_resolve(params); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#472 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#464 sig do params( uri: ::URI::Generic, @@ -669,7 +1044,7 @@ class RubyLsp::Executor end def completion(uri, position); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#247 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#246 sig do params( uri: ::URI::Generic, @@ -678,7 +1053,7 @@ class RubyLsp::Executor end def definition(uri, position); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#441 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#433 sig do params( uri: ::URI::Generic @@ -686,11 +1061,11 @@ class RubyLsp::Executor end def diagnostic(uri); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#184 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#183 sig { params(changes: T::Array[{uri: ::String, type: ::Integer}]).returns(::Object) } def did_change_watched_files(changes); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#372 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#366 sig do params( uri: ::URI::Generic, @@ -699,19 +1074,15 @@ class RubyLsp::Executor end def document_highlight(uri, position); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#545 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#535 sig { params(id: ::String).void } def end_progress(id); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#265 - sig { params(uri: ::URI::Generic).returns(T::Array[::LanguageServer::Protocol::Interface::FoldingRange]) } - def folding_range(uri); end - - # source://ruby-lsp/lib/ruby_lsp/executor.rb#348 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#342 sig { params(uri: ::URI::Generic).returns(T.nilable(T::Array[::LanguageServer::Protocol::Interface::TextEdit])) } def formatting(uri); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#277 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#273 sig do params( uri: ::URI::Generic, @@ -720,7 +1091,7 @@ class RubyLsp::Executor end def hover(uri, position); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#558 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#548 sig do params( options: T::Hash[::Symbol, T.untyped] @@ -728,7 +1099,7 @@ class RubyLsp::Executor end def initialize_request(options); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#384 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#377 sig do params( uri: ::URI::Generic, @@ -737,7 +1108,7 @@ class RubyLsp::Executor end def inlay_hint(uri, range); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#362 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#356 sig do params( uri: ::URI::Generic, @@ -747,15 +1118,15 @@ class RubyLsp::Executor end def on_type_formatting(uri, position, character); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#209 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#208 sig { void } def perform_initial_indexing; end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#38 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#37 sig { params(request: T::Hash[::Symbol, T.untyped]).returns(T.untyped) } def run(request); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#328 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#322 sig do params( uri: ::URI::Generic, @@ -764,233 +1135,92 @@ class RubyLsp::Executor end def selection_range(uri, positions); end - # source://ruby-lsp/lib/ruby_lsp/executor.rb#450 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#442 sig do params( uri: ::URI::Generic, range: {start: {line: ::Integer, character: ::Integer}, end: {line: ::Integer, character: ::Integer}} ).returns(::LanguageServer::Protocol::Interface::SemanticTokens) end - def semantic_tokens_range(uri, range); end - - # source://ruby-lsp/lib/ruby_lsp/executor.rb#237 - sig do - params( - uri: ::URI::Generic, - range: T.nilable({start: {line: ::Integer, character: ::Integer}, end: {line: ::Integer, character: ::Integer}}) - ).returns({ast: ::String}) - end - def show_syntax_tree(uri, range); end - - # source://ruby-lsp/lib/ruby_lsp/executor.rb#305 - sig do - params( - uri: ::URI::Generic, - content_changes: T::Array[{range: {start: {line: ::Integer, character: ::Integer}, end: {line: ::Integer, character: ::Integer}}, text: ::String}], - version: ::Integer - ).returns(::Object) - end - def text_document_did_change(uri, content_changes, version); end - - # source://ruby-lsp/lib/ruby_lsp/executor.rb#317 - sig { params(uri: ::URI::Generic).returns(::Object) } - def text_document_did_close(uri); end - - # source://ruby-lsp/lib/ruby_lsp/executor.rb#311 - sig { params(uri: ::URI::Generic, text: ::String, version: ::Integer).returns(::Object) } - def text_document_did_open(uri, text, version); end - - # source://ruby-lsp/lib/ruby_lsp/executor.rb#232 - sig { params(query: T.nilable(::String)).returns(T::Array[::LanguageServer::Protocol::Interface::WorkspaceSymbol]) } - def workspace_symbol(query); end -end - -# ExtensibleListener is an abstract class to be used by requests that accept extensions. -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://ruby-lsp/lib/ruby_lsp/listener.rb#35 -class RubyLsp::ExtensibleListener < ::RubyLsp::Listener - extend T::Generic - - abstract! - - ResponseType = type_member - - # When inheriting from ExtensibleListener, the `super` of constructor must be called **after** the subclass's own - # ivars have been initialized. This is because the constructor of ExtensibleListener calls - # `initialize_external_listener` which may depend on the subclass's ivars. - # - # source://ruby-lsp/lib/ruby_lsp/listener.rb#47 - sig { params(emitter: ::RubyLsp::EventEmitter, message_queue: ::Thread::Queue).void } - def initialize(emitter, message_queue); end - - # @abstract - # - # source://ruby-lsp/lib/ruby_lsp/listener.rb#74 - sig { abstract.params(extension: ::RubyLsp::Extension).returns(T.nilable(RubyLsp::Listener[ResponseType])) } - def initialize_external_listener(extension); end - - # Merge responses from all external listeners into the base listener's response. We do this to return a single - # response to the editor including the results of all extensions - # - # source://ruby-lsp/lib/ruby_lsp/listener.rb#61 - sig { void } - def merge_external_listeners_responses!; end - - # Does nothing by default. Requests that accept extensions should override this method to define how to merge - # responses coming from external listeners - # - # @abstract - # - # source://ruby-lsp/lib/ruby_lsp/listener.rb#79 - sig { abstract.params(other: RubyLsp::Listener[T.untyped]).returns(T.self_type) } - def merge_response!(other); end - - # source://ruby-lsp/lib/ruby_lsp/listener.rb#66 - sig { returns(ResponseType) } - def response; end -end - -# To register an extension, inherit from this class and implement both `name` and `activate` -# -# # Example -# -# ```ruby -# module MyGem -# class MyExtension < Extension -# def activate -# # Perform any relevant initialization -# end -# -# def name -# "My extension name" -# end -# end -# end -# ``` -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://ruby-lsp/lib/ruby_lsp/extension.rb#22 -class RubyLsp::Extension - abstract! - - # source://ruby-lsp/lib/ruby_lsp/extension.rb#67 - sig { void } - def initialize; end - - # Each extension should implement `MyExtension#activate` and use to perform any sort of initialization, such as - # reading information into memory or even spawning a separate process - # - # @abstract - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#98 - sig { abstract.void } - def activate; end - - # source://ruby-lsp/lib/ruby_lsp/extension.rb#72 - sig { params(error: ::StandardError).returns(T.self_type) } - def add_error(error); end - - # source://ruby-lsp/lib/ruby_lsp/extension.rb#91 - sig { returns(::String) } - def backtraces; end - - # Creates a new CodeLens listener. This method is invoked on every CodeLens request - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#117 - sig do - overridable - .params( - uri: ::URI::Generic, - emitter: ::RubyLsp::EventEmitter, - message_queue: ::Thread::Queue - ).returns(T.nilable(RubyLsp::Listener[T::Array[::LanguageServer::Protocol::Interface::CodeLens]])) - end - def create_code_lens_listener(uri, emitter, message_queue); end - - # Creates a new Definition listener. This method is invoked on every Definition request - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#147 - sig do - overridable - .params( - uri: ::URI::Generic, - nesting: T::Array[::String], - index: ::RubyIndexer::Index, - emitter: ::RubyLsp::EventEmitter, - message_queue: ::Thread::Queue - ).returns(T.nilable(RubyLsp::Listener[T.nilable(T.any(::LanguageServer::Protocol::Interface::Location, T::Array[::LanguageServer::Protocol::Interface::Location]))])) - end - def create_definition_listener(uri, nesting, index, emitter, message_queue); end + def semantic_tokens_range(uri, range); end - # Creates a new DocumentSymbol listener. This method is invoked on every DocumentSymbol request - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#135 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#236 sig do - overridable - .params( - emitter: ::RubyLsp::EventEmitter, - message_queue: ::Thread::Queue - ).returns(T.nilable(RubyLsp::Listener[T::Array[::LanguageServer::Protocol::Interface::DocumentSymbol]])) + params( + uri: ::URI::Generic, + range: T.nilable({start: {line: ::Integer, character: ::Integer}, end: {line: ::Integer, character: ::Integer}}) + ).returns({ast: ::String}) end - def create_document_symbol_listener(emitter, message_queue); end + def show_syntax_tree(uri, range); end - # Creates a new Hover listener. This method is invoked on every Hover request - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#126 + # source://ruby-lsp/lib/ruby_lsp/executor.rb#299 sig do - overridable - .params( - emitter: ::RubyLsp::EventEmitter, - message_queue: ::Thread::Queue - ).returns(T.nilable(RubyLsp::Listener[T.nilable(::LanguageServer::Protocol::Interface::Hover)])) + params( + uri: ::URI::Generic, + content_changes: T::Array[{range: {start: {line: ::Integer, character: ::Integer}, end: {line: ::Integer, character: ::Integer}}, text: ::String}], + version: ::Integer + ).returns(::Object) end - def create_hover_listener(emitter, message_queue); end + def text_document_did_change(uri, content_changes, version); end - # Each extension should implement `MyExtension#deactivate` and use to perform any clean up, like shutting down a - # child process - # - # @abstract - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#103 - sig { abstract.void } - def deactivate; end + # source://ruby-lsp/lib/ruby_lsp/executor.rb#311 + sig { params(uri: ::URI::Generic).returns(::Object) } + def text_document_did_close(uri); end - # source://ruby-lsp/lib/ruby_lsp/extension.rb#78 - sig { returns(T::Boolean) } - def error?; end + # source://ruby-lsp/lib/ruby_lsp/executor.rb#305 + sig { params(uri: ::URI::Generic, text: ::String, version: ::Integer).returns(::Object) } + def text_document_did_open(uri, text, version); end - # source://ruby-lsp/lib/ruby_lsp/extension.rb#83 - sig { returns(::String) } - def formatted_errors; end + # source://ruby-lsp/lib/ruby_lsp/executor.rb#231 + sig { params(query: T.nilable(::String)).returns(T::Array[::LanguageServer::Protocol::Interface::WorkspaceSymbol]) } + def workspace_symbol(query); end +end + +# ExtensibleListener is an abstract class to be used by requests that accept addons. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://ruby-lsp/lib/ruby_lsp/listener.rb#35 +class RubyLsp::ExtensibleListener < ::RubyLsp::Listener + extend T::Generic + + abstract! + + ResponseType = type_member - # Extensions should override the `name` method to return the extension name + # When inheriting from ExtensibleListener, the `super` of constructor must be called **after** the subclass's own + # ivars have been initialized. This is because the constructor of ExtensibleListener calls + # `initialize_external_listener` which may depend on the subclass's ivars. # + # source://ruby-lsp/lib/ruby_lsp/listener.rb#47 + sig { params(emitter: ::RubyLsp::EventEmitter, message_queue: ::Thread::Queue).void } + def initialize(emitter, message_queue); end + # @abstract # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#107 - sig { abstract.returns(::String) } - def name; end + # source://ruby-lsp/lib/ruby_lsp/listener.rb#74 + sig { abstract.params(addon: ::RubyLsp::Addon).returns(T.nilable(RubyLsp::Listener[ResponseType])) } + def initialize_external_listener(addon); end - class << self - # source://ruby-lsp/lib/ruby_lsp/extension.rb#39 - sig { returns(T::Array[::RubyLsp::Extension]) } - def extensions; end + # Merge responses from all external listeners into the base listener's response. We do this to return a single + # response to the editor including the results of all addons + # + # source://ruby-lsp/lib/ruby_lsp/listener.rb#61 + sig { void } + def merge_external_listeners_responses!; end - # Automatically track and instantiate extension classes - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#33 - sig { params(child_class: T.class_of(RubyLsp::Extension)).void } - def inherited(child_class); end + # Does nothing by default. Requests that accept addons should override this method to define how to merge responses + # coming from external listeners + # + # @abstract + # + # source://ruby-lsp/lib/ruby_lsp/listener.rb#79 + sig { abstract.params(other: RubyLsp::Listener[T.untyped]).returns(T.self_type) } + def merge_response!(other); end - # Discovers and loads all extensions. Returns the list of activated extensions - # - # source://ruby-lsp/lib/ruby_lsp/extension.rb#45 - sig { returns(T::Array[::RubyLsp::Extension]) } - def load_extensions; end - end + # source://ruby-lsp/lib/ruby_lsp/listener.rb#66 + sig { returns(ResponseType) } + def response; end end # source://ruby-lsp/lib/ruby_lsp/server.rb#6 @@ -998,21 +1228,21 @@ RubyLsp::Interface = LanguageServer::Protocol::Interface # A request that will sit in the queue until it's executed # -# source://ruby-lsp/lib/ruby_lsp/utils.rb#62 +# source://ruby-lsp/lib/ruby_lsp/utils.rb#52 class RubyLsp::Job - # source://ruby-lsp/lib/ruby_lsp/utils.rb#72 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#62 sig { params(request: T::Hash[::Symbol, T.untyped], cancelled: T::Boolean).void } def initialize(request:, cancelled:); end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#78 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#68 sig { void } def cancel; end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#69 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#59 sig { returns(T::Boolean) } def cancelled; end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#66 + # source://ruby-lsp/lib/ruby_lsp/utils.rb#56 sig { returns(T::Hash[::Symbol, T.untyped]) } def request; end end @@ -1073,6 +1303,29 @@ end # source://ruby-lsp/lib/ruby_lsp/utils.rb#31 class RubyLsp::Notification < ::RubyLsp::Message; end +# source://ruby-lsp/lib/ruby_lsp/parameter_scope.rb#5 +class RubyLsp::ParameterScope + # source://ruby-lsp/lib/ruby_lsp/parameter_scope.rb#12 + sig { params(parent: T.nilable(::RubyLsp::ParameterScope)).void } + def initialize(parent = T.unsafe(nil)); end + + # source://ruby-lsp/lib/ruby_lsp/parameter_scope.rb#18 + sig { params(name: T.any(::String, ::Symbol)).void } + def <<(name); end + + # source://ruby-lsp/lib/ruby_lsp/parameter_scope.rb#28 + sig { params(name: T.any(::String, ::Symbol)).returns(T::Boolean) } + def parameter?(name); end + + # source://ruby-lsp/lib/ruby_lsp/parameter_scope.rb#9 + sig { returns(T.nilable(::RubyLsp::ParameterScope)) } + def parent; end + + # source://ruby-lsp/lib/ruby_lsp/parameter_scope.rb#23 + sig { params(name: T.any(::String, ::Symbol)).returns(::Symbol) } + def type_for(name); end +end + # source://ruby-lsp/lib/ruby_lsp/utils.rb#32 class RubyLsp::Request < ::RubyLsp::Message; end @@ -1103,7 +1356,7 @@ module RubyLsp::Requests; end # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://ruby-lsp/lib/ruby_lsp/requests/base_request.rb#7 -class RubyLsp::Requests::BaseRequest < ::SyntaxTree::Visitor +class RubyLsp::Requests::BaseRequest < ::YARP::Visitor include ::RubyLsp::Requests::Support::Common abstract! @@ -1118,12 +1371,12 @@ class RubyLsp::Requests::BaseRequest < ::SyntaxTree::Visitor sig { abstract.returns(::Object) } def run; end - # Syntax Tree implements `visit_all` using `map` instead of `each` for users who want to use the pattern + # YARP implements `visit_all` using `map` instead of `each` for users who want to use the pattern # `result = visitor.visit(tree)`. However, we don't use that pattern and should avoid producing a new array for # every single node visited # # source://ruby-lsp/lib/ruby_lsp/requests/base_request.rb#27 - sig { params(nodes: T::Array[T.nilable(::SyntaxTree::Node)]).void } + sig { params(nodes: T::Array[T.nilable(::YARP::Node)]).void } def visit_all(nodes); end end @@ -1255,77 +1508,58 @@ class RubyLsp::Requests::CodeLens < ::RubyLsp::ExtensibleListener ResponseType = type_member { { fixed: T::Array[::LanguageServer::Protocol::Interface::CodeLens] } } # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#35 - sig do - params( - uri: ::URI::Generic, - emitter: ::RubyLsp::EventEmitter, - message_queue: ::Thread::Queue, - test_library: ::String - ).void - end - def initialize(uri, emitter, message_queue, test_library); end + sig { params(uri: ::URI::Generic, emitter: ::RubyLsp::EventEmitter, message_queue: ::Thread::Queue).void } + def initialize(uri, emitter, message_queue); end # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#32 sig { override.returns(ResponseType) } def _response; end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#134 - sig { params(node: ::SyntaxTree::CallNode).void } + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#126 + sig { params(node: ::YARP::CallNode).void } def after_call(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#76 - sig { params(node: ::SyntaxTree::ClassDeclaration).void } + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#72 + sig { params(node: ::YARP::ClassNode).void } def after_class(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#115 - sig { params(node: ::SyntaxTree::Command).void } - def after_command(node); end - - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#150 - sig { override.params(extension: ::RubyLsp::Extension).returns(T.nilable(RubyLsp::Listener[ResponseType])) } - def initialize_external_listener(extension); end + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#132 + sig { override.params(addon: ::RubyLsp::Addon).returns(T.nilable(RubyLsp::Listener[ResponseType])) } + def initialize_external_listener(addon); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#155 + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#137 sig { override.params(other: RubyLsp::Listener[ResponseType]).returns(T.self_type) } def merge_response!(other); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#121 - sig { params(node: ::SyntaxTree::CallNode).void } + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#97 + sig { params(node: ::YARP::CallNode).void } def on_call(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#60 - sig { params(node: ::SyntaxTree::ClassDeclaration).void } + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#56 + sig { params(node: ::YARP::ClassNode).void } def on_class(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#101 - sig { params(node: ::SyntaxTree::Command).void } - def on_command(node); end - - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#82 - sig { params(node: ::SyntaxTree::DefNode).void } + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#78 + sig { params(node: ::YARP::DefNode).void } def on_def(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#140 - sig { params(node: ::SyntaxTree::VCall).void } - def on_vcall(node); end - private - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#243 - sig { params(node: ::SyntaxTree::Command, remote: ::String).void } + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#219 + sig { params(node: ::YARP::CallNode, remote: ::String).void } def add_open_gem_remote_code_lens(node, remote); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#163 - sig { params(node: ::SyntaxTree::Node, name: ::String, command: ::String, kind: ::Symbol).void } + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#145 + sig { params(node: ::YARP::Node, name: ::String, command: ::String, kind: ::Symbol).void } def add_test_code_lens(node, name:, command:, kind:); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#221 + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#197 sig { params(class_name: ::String, method_name: T.nilable(::String)).returns(::String) } def generate_test_command(class_name:, method_name: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#205 - sig { params(node: ::SyntaxTree::Command).returns(T.nilable(::String)) } - def resolve_gem_remote(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#187 + sig { params(gem_name: ::YARP::StringNode).returns(T.nilable(::String)) } + def resolve_gem_remote(gem_name); end end # source://ruby-lsp/lib/ruby_lsp/requests/code_lens.rb#28 @@ -1373,44 +1607,38 @@ class RubyLsp::Requests::Completion < ::RubyLsp::Listener sig { override.returns(ResponseType) } def _response; end - # Handle completion on regular constant references (e.g. `Bar`) - # - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#55 - sig { params(node: ::SyntaxTree::Const).void } - def on_const(node); end - # Handle completion on namespaced constant references (e.g. `Foo::Bar`) # - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#67 - sig { params(node: ::SyntaxTree::ConstPathRef).void } - def on_const_path_ref(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#68 + sig { params(node: ::YARP::ConstantPathNode).void } + def on_constant_path(node); end - # Handle completion on top level constant references (e.g. `::Bar`) + # Handle completion on regular constant references (e.g. `Bar`) # - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#79 - sig { params(node: ::SyntaxTree::TopConstRef).void } - def on_top_const_ref(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#55 + sig { params(node: ::YARP::ConstantReadNode).void } + def on_constant_read(node); end # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#47 - sig { params(node: ::SyntaxTree::TStringContent).void } - def on_tstring_content(node); end + sig { params(node: ::YARP::StringNode).void } + def on_string(node); end private - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#90 + # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#112 sig do params( label: ::String, - node: ::SyntaxTree::TStringContent + node: ::YARP::StringNode ).returns(::LanguageServer::Protocol::Interface::CompletionItem) end def build_completion(label, node); end - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#109 + # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#131 sig do params( name: ::String, - node: ::SyntaxTree::Node, + node: ::YARP::Node, entries: T::Array[::RubyIndexer::Index::Entry], top_level: T::Boolean ).returns(::LanguageServer::Protocol::Interface::CompletionItem) @@ -1420,7 +1648,7 @@ class RubyLsp::Requests::Completion < ::RubyLsp::Listener # Check if the `entry_name` has potential conflicts in `candidates`, so that we use a top level reference instead # of a short name # - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#163 + # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#185 sig { params(entry_name: ::String, candidates: T::Array[T::Array[::RubyIndexer::Index::Entry]]).returns(T::Boolean) } def top_level?(entry_name, candidates); end end @@ -1462,29 +1690,29 @@ class RubyLsp::Requests::Definition < ::RubyLsp::ExtensibleListener sig { override.returns(ResponseType) } def _response; end - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#50 - sig { override.params(ext: ::RubyLsp::Extension).returns(T.nilable(RubyLsp::Listener[ResponseType])) } - def initialize_external_listener(ext); end + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#49 + sig { override.params(addon: ::RubyLsp::Addon).returns(T.nilable(RubyLsp::Listener[ResponseType])) } + def initialize_external_listener(addon); end - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#55 + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#54 sig { override.params(other: RubyLsp::Listener[ResponseType]).returns(T.self_type) } def merge_response!(other); end - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#82 - sig { params(node: ::SyntaxTree::Command).void } - def on_command(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#70 + sig { params(node: ::YARP::CallNode).void } + def on_call(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#77 - sig { params(node: ::SyntaxTree::Const).void } - def on_const(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#114 + sig { params(node: ::YARP::ConstantPathNode).void } + def on_constant_path(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#71 - sig { params(node: ::SyntaxTree::ConstPathRef).void } - def on_const_path_ref(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#119 + sig { params(node: ::YARP::ConstantReadNode).void } + def on_constant_read(node); end private - # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#128 + # source://ruby-lsp/lib/ruby_lsp/requests/definition.rb#126 sig { params(value: ::String).void } def find_in_index(value); end end @@ -1510,8 +1738,14 @@ class RubyLsp::Requests::Diagnostics < ::RubyLsp::Requests::BaseRequest def initialize(document); end # source://ruby-lsp/lib/ruby_lsp/requests/diagnostics.rb#32 - sig { override.returns(T.nilable(T.all(::Object, T::Array[::RubyLsp::Requests::Support::RuboCopDiagnostic]))) } + sig { override.returns(T.nilable(T.all(::Object, T::Array[::LanguageServer::Protocol::Interface::Diagnostic]))) } def run; end + + private + + # source://ruby-lsp/lib/ruby_lsp/requests/diagnostics.rb#48 + sig { returns(T.nilable(T::Array[::LanguageServer::Protocol::Interface::Diagnostic])) } + def syntax_error_diagnostics; end end # ![Document highlight demo](../../document_highlight.gif) @@ -1543,8 +1777,8 @@ class RubyLsp::Requests::DocumentHighlight < ::RubyLsp::Listener # source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#41 sig do params( - target: T.nilable(::SyntaxTree::Node), - parent: T.nilable(::SyntaxTree::Node), + target: T.nilable(::YARP::Node), + parent: T.nilable(::YARP::Node), emitter: ::RubyLsp::EventEmitter, message_queue: ::Thread::Queue ).void @@ -1555,20 +1789,17 @@ class RubyLsp::Requests::DocumentHighlight < ::RubyLsp::Listener sig { override.returns(ResponseType) } def _response; end - # source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#63 - sig { params(node: T.nilable(::SyntaxTree::Node)).void } + # source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#73 + sig { params(node: T.nilable(::YARP::Node)).void } def on_node(node); end private - # source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#84 + # source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#83 sig { params(match: ::RubyLsp::Requests::Support::HighlightTarget::HighlightMatch).void } def add_highlight(match); end end -# source://ruby-lsp/lib/ruby_lsp/requests/document_highlight.rb#72 -RubyLsp::Requests::DocumentHighlight::DIRECT_HIGHLIGHTS = T.let(T.unsafe(nil), Array) - # ![Document link demo](../../document_link.gif) # # The [document link](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentLink) @@ -1589,26 +1820,53 @@ class RubyLsp::Requests::DocumentLink < ::RubyLsp::Listener ResponseType = type_member { { fixed: T::Array[::LanguageServer::Protocol::Interface::DocumentLink] } } - # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#79 - sig { params(uri: ::URI::Generic, emitter: ::RubyLsp::EventEmitter, message_queue: ::Thread::Queue).void } - def initialize(uri, emitter, message_queue); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#86 + sig do + params( + uri: ::URI::Generic, + comments: T::Array[::YARP::Comment], + emitter: ::RubyLsp::EventEmitter, + message_queue: ::Thread::Queue + ).void + end + def initialize(uri, comments, emitter, message_queue); end # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#76 sig { override.returns(ResponseType) } def _response; end - # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#93 - sig { params(node: ::SyntaxTree::Comment).void } - def on_comment(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#111 + sig { params(node: ::YARP::ClassNode).void } + def on_class(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#126 + sig { params(node: ::YARP::ConstantPathWriteNode).void } + def on_constant_path_write(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#121 + sig { params(node: ::YARP::ConstantWriteNode).void } + def on_constant_write(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#106 + sig { params(node: ::YARP::DefNode).void } + def on_def(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#116 + sig { params(node: ::YARP::ModuleNode).void } + def on_module(node); end private + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#133 + sig { params(node: ::YARP::Node).void } + def extract_document_link(node); end + # Try to figure out the gem version for a source:// link. The order of precedence is: # 1. The version in the URI # 2. The version in the RBI file name # 3. The version from the gemspec # - # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#118 + # source://ruby-lsp/lib/ruby_lsp/requests/document_link.rb#159 sig { params(uri: ::URI::Source).returns(T.nilable(::String)) } def resolve_version(uri); end @@ -1660,68 +1918,72 @@ class RubyLsp::Requests::DocumentSymbol < ::RubyLsp::ExtensibleListener sig { override.returns(T::Array[::LanguageServer::Protocol::Interface::DocumentSymbol]) } def _response; end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#101 - sig { params(node: ::SyntaxTree::ClassDeclaration).void } + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#102 + sig { params(node: ::YARP::ClassNode).void } def after_class(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#154 - sig { params(node: ::SyntaxTree::DefNode).void } + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#149 + sig { params(node: ::YARP::DefNode).void } def after_def(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#169 - sig { params(node: ::SyntaxTree::ModuleDeclaration).void } + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#186 + sig { params(node: ::YARP::ModuleNode).void } def after_module(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#79 - sig { override.params(extension: ::RubyLsp::Extension).returns(T.nilable(RubyLsp::Listener[ResponseType])) } - def initialize_external_listener(extension); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#80 + sig { override.params(addon: ::RubyLsp::Addon).returns(T.nilable(RubyLsp::Listener[ResponseType])) } + def initialize_external_listener(addon); end # Merges responses from other listeners # - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#85 + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#86 sig { override.params(other: RubyLsp::Listener[ResponseType]).returns(T.self_type) } def merge_response!(other); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#91 - sig { params(node: ::SyntaxTree::ClassDeclaration).void } + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#107 + sig { params(node: ::YARP::CallNode).void } + def on_call(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#92 + sig { params(node: ::YARP::ClassNode).void } def on_class(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#106 - sig { params(node: ::SyntaxTree::Command).void } - def on_command(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#201 + sig { params(node: ::YARP::ClassVariableWriteNode).void } + def on_class_variable_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#122 - sig { params(node: ::SyntaxTree::ConstPathField).void } - def on_const_path_field(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#129 + sig { params(node: ::YARP::ConstantPathWriteNode).void } + def on_constant_path_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#132 - sig { params(node: ::SyntaxTree::DefNode).void } - def on_def(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#139 + sig { params(node: ::YARP::ConstantWriteNode).void } + def on_constant_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#159 - sig { params(node: ::SyntaxTree::ModuleDeclaration).void } - def on_module(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#164 + sig { params(node: ::YARP::DefNode).void } + def on_def(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#174 - sig { params(node: ::SyntaxTree::TopConstField).void } - def on_top_const_field(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#191 + sig { params(node: ::YARP::InstanceVariableWriteNode).void } + def on_instance_variable_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#184 - sig { params(node: ::SyntaxTree::VarField).void } - def on_var_field(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#154 + sig { params(node: ::YARP::ModuleNode).void } + def on_module(node); end private - # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#213 + # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#220 sig do params( name: ::String, kind: ::Integer, - range_node: ::SyntaxTree::Node, - selection_range_node: ::SyntaxTree::Node + range_location: ::YARP::Location, + selection_range_location: ::YARP::Location ).returns(::LanguageServer::Protocol::Interface::DocumentSymbol) end - def create_document_symbol(name:, kind:, range_node:, selection_range_node:); end + def create_document_symbol(name:, kind:, range_location:, selection_range_location:); end end # source://ruby-lsp/lib/ruby_lsp/requests/document_symbol.rb#35 @@ -1752,105 +2014,137 @@ end # ``` # # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#18 -class RubyLsp::Requests::FoldingRanges < ::RubyLsp::Requests::BaseRequest - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#64 - sig { params(document: ::RubyLsp::Document).void } - def initialize(document); end +class RubyLsp::Requests::FoldingRanges < ::RubyLsp::Listener + extend T::Generic - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#72 - sig { override.returns(T.all(::Object, T::Array[::LanguageServer::Protocol::Interface::FoldingRange])) } - def run; end + ResponseType = type_member { { fixed: T::Array[::LanguageServer::Protocol::Interface::FoldingRange] } } - private + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#25 + sig { params(comments: T::Array[::YARP::Comment], emitter: ::RubyLsp::EventEmitter, queue: ::Thread::Queue).void } + def initialize(comments, emitter, queue); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#223 - sig { params(node: T.any(::SyntaxTree::CallNode, ::SyntaxTree::CommandCall)).void } - def add_call_range(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#61 + sig { override.returns(ResponseType) } + def _response; end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#257 - sig { params(node: ::SyntaxTree::DefNode).void } - def add_def_range(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#100 + sig { params(node: ::YARP::ArrayNode).void } + def on_array(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#296 - sig { params(start_line: ::Integer, end_line: ::Integer).void } - def add_lines_range(start_line, end_line); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#165 + sig { params(node: ::YARP::BeginNode).void } + def on_begin(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#281 - sig { params(node: ::SyntaxTree::Node, statements: ::SyntaxTree::Statements).void } - def add_statements_range(node, statements); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#105 + sig { params(node: ::YARP::BlockNode).void } + def on_block(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#288 - sig { params(node: ::SyntaxTree::StringConcat).void } - def add_string_concat(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#198 + sig { params(node: ::YARP::CallNode).void } + def on_call(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#215 - sig { void } - def emit_partial_range; end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#110 + sig { params(node: ::YARP::CaseNode).void } + def on_case(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#181 - sig { params(node: T.nilable(::SyntaxTree::Node)).returns(T::Boolean) } - def handle_partial_range(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#115 + sig { params(node: ::YARP::ClassNode).void } + def on_class(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#203 - sig { params(node: T.nilable(::SyntaxTree::Node)).returns(T.nilable(::String)) } - def partial_range_kind(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#183 + sig { params(node: ::YARP::DefNode).void } + def on_def(node); end - # This is to prevent duplicate ranges - # - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#120 - sig { params(node: T.any(::SyntaxTree::Command, ::SyntaxTree::CommandCall)).returns(T::Boolean) } - def same_lines_for_command_and_block?(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#155 + sig { params(node: ::YARP::ElseNode).void } + def on_else(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#84 - sig { override.params(node: T.nilable(::SyntaxTree::Node)).void } - def visit(node); end -end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#160 + sig { params(node: ::YARP::EnsureNode).void } + def on_ensure(node); end -# source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#42 -RubyLsp::Requests::FoldingRanges::NODES_WITH_STATEMENTS = T.let(T.unsafe(nil), Array) + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#125 + sig { params(node: ::YARP::ForNode).void } + def on_for(node); end -# source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#129 -class RubyLsp::Requests::FoldingRanges::PartialRange - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#148 - sig { params(start_line: ::Integer, end_line: ::Integer, kind: ::String).void } - def initialize(start_line, end_line, kind); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#130 + sig { params(node: ::YARP::HashNode).void } + def on_hash(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#136 - sig { returns(::Integer) } - def end_line; end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#72 + sig { params(node: ::YARP::IfNode).void } + def on_if(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#155 - sig { params(node: ::SyntaxTree::Node).returns(::RubyLsp::Requests::FoldingRanges::PartialRange) } - def extend_to(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#77 + sig { params(node: ::YARP::InNode).void } + def on_in(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#133 - sig { returns(::String) } - def kind; end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#92 + sig { params(node: ::YARP::InterpolatedStringNode).void } + def on_interpolated_string(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#120 + sig { params(node: ::YARP::ModuleNode).void } + def on_module(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#170 + sig { params(node: ::YARP::Node).void } + def on_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#82 + sig { params(node: ::YARP::RescueNode).void } + def on_rescue(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#135 + sig { params(node: ::YARP::SingletonClassNode).void } + def on_singleton_class(node); end # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#175 - sig { returns(T::Boolean) } - def multiline?; end + sig { params(node: ::YARP::StringConcatNode).void } + def on_string_concat(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#161 - sig { params(node: ::SyntaxTree::Node).returns(T::Boolean) } - def new_section?(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#140 + sig { params(node: ::YARP::UnlessNode).void } + def on_unless(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#166 - sig { returns(::LanguageServer::Protocol::Interface::FoldingRange) } - def to_range; end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#145 + sig { params(node: ::YARP::UntilNode).void } + def on_until(node); end - class << self - # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#142 - sig { params(node: ::SyntaxTree::Node, kind: ::String).returns(::RubyLsp::Requests::FoldingRanges::PartialRange) } - def from(node, kind); end - end -end + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#87 + sig { params(node: ::YARP::WhenNode).void } + def on_when(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#150 + sig { params(node: ::YARP::WhileNode).void } + def on_while(node); end + + private + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#273 + sig { params(start_line: ::Integer, end_line: ::Integer).void } + def add_lines_range(start_line, end_line); end -# source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#21 -RubyLsp::Requests::FoldingRanges::SIMPLE_FOLDABLES = T.let(T.unsafe(nil), Array) + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#267 + sig { params(node: ::YARP::Node).void } + def add_simple_range(node); end -# source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#53 -RubyLsp::Requests::FoldingRanges::StatementNode = T.type_alias { T.any(::SyntaxTree::Elsif, ::SyntaxTree::IfNode, ::SyntaxTree::In, ::SyntaxTree::Rescue, ::SyntaxTree::When) } + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#256 + sig { params(node: T.any(::YARP::IfNode, ::YARP::InNode, ::YARP::RescueNode, ::YARP::WhenNode)).void } + def add_statements_range(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#229 + sig { void } + def emit_requires_range; end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#213 + sig { void } + def push_comment_ranges; end + + # source://ruby-lsp/lib/ruby_lsp/requests/folding_ranges.rb#242 + sig { params(node: ::YARP::CallNode).returns(T::Boolean) } + def require?(node); end +end # ![Formatting symbol demo](../../formatting.gif) # @@ -1874,11 +2168,11 @@ RubyLsp::Requests::FoldingRanges::StatementNode = T.type_alias { T.any(::SyntaxT # # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#28 class RubyLsp::Requests::Formatting < ::RubyLsp::Requests::BaseRequest - # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#58 + # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#57 sig { params(document: ::RubyLsp::Document, formatter: ::String).void } def initialize(document, formatter: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#66 + # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#65 sig { override.returns(T.nilable(T.all(::Object, T::Array[::LanguageServer::Protocol::Interface::TextEdit]))) } def run; end @@ -1886,16 +2180,16 @@ class RubyLsp::Requests::Formatting < ::RubyLsp::Requests::BaseRequest # @raise [InvalidFormatter] # - # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#95 + # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#94 sig { returns(T.nilable(::String)) } def formatted_file; end class << self - # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#43 + # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#38 sig { returns(T::Hash[::String, ::RubyLsp::Requests::Support::FormatterRunner]) } def formatters; end - # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#46 + # source://ruby-lsp/lib/ruby_lsp/requests/formatting.rb#41 sig { params(identifier: ::String, instance: ::RubyLsp::Requests::Support::FormatterRunner).void } def register_formatter(identifier, instance); end end @@ -1940,8 +2234,8 @@ class RubyLsp::Requests::Hover < ::RubyLsp::ExtensibleListener def _response; end # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#53 - sig { override.params(extension: ::RubyLsp::Extension).returns(T.nilable(RubyLsp::Listener[ResponseType])) } - def initialize_external_listener(extension); end + sig { override.params(addon: ::RubyLsp::Addon).returns(T.nilable(RubyLsp::Listener[ResponseType])) } + def initialize_external_listener(addon); end # Merges responses from other hover listeners # @@ -1949,19 +2243,23 @@ class RubyLsp::Requests::Hover < ::RubyLsp::ExtensibleListener sig { override.params(other: RubyLsp::Listener[ResponseType]).returns(T.self_type) } def merge_response!(other); end - # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#81 - sig { params(node: ::SyntaxTree::Const).void } - def on_const(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#87 + sig { params(node: ::YARP::ConstantPathNode).void } + def on_constant_path(node); end # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#73 - sig { params(node: ::SyntaxTree::ConstPathRef).void } - def on_const_path_ref(node); end + sig { params(node: ::YARP::ConstantReadNode).void } + def on_constant_read(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#80 + sig { params(node: ::YARP::ConstantWriteNode).void } + def on_constant_write(node); end private - # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#90 - sig { params(name: ::String, node: ::SyntaxTree::Node).void } - def generate_hover(name, node); end + # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#96 + sig { params(name: ::String, location: ::YARP::Location).void } + def generate_hover(name, location); end end # source://ruby-lsp/lib/ruby_lsp/requests/hover.rb#22 @@ -1998,7 +2296,7 @@ class RubyLsp::Requests::InlayHints < ::RubyLsp::Listener def _response; end # source://ruby-lsp/lib/ruby_lsp/requests/inlay_hints.rb#43 - sig { params(node: ::SyntaxTree::Rescue).void } + sig { params(node: ::YARP::RescueNode).void } def on_rescue(node); end end @@ -2088,11 +2386,11 @@ RubyLsp::Requests::OnTypeFormatting::END_REGEXES = T.let(T.unsafe(nil), Array) # # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#23 class RubyLsp::Requests::SelectionRanges < ::RubyLsp::Requests::BaseRequest - # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#66 + # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#62 sig { params(document: ::RubyLsp::Document).void } def initialize(document); end - # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#74 + # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#70 sig { override.returns(T.all(::Object, T::Array[::RubyLsp::Requests::Support::SelectionRange])) } def run; end @@ -2101,14 +2399,23 @@ class RubyLsp::Requests::SelectionRanges < ::RubyLsp::Requests::BaseRequest # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#101 sig do params( - location: ::SyntaxTree::Location, + node: ::YARP::InterpolatedStringNode, + parent: T.nilable(::RubyLsp::Requests::Support::SelectionRange) + ).returns(::RubyLsp::Requests::Support::SelectionRange) + end + def create_heredoc_selection_range(node, parent); end + + # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#126 + sig do + params( + location: ::YARP::Location, parent: T.nilable(::RubyLsp::Requests::Support::SelectionRange) ).returns(::RubyLsp::Requests::Support::SelectionRange) end - def create_selection_range(location, parent = T.unsafe(nil)); end + def create_selection_range(location, parent); end - # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#82 - sig { override.params(node: T.nilable(::SyntaxTree::Node)).void } + # source://ruby-lsp/lib/ruby_lsp/requests/selection_ranges.rb#78 + sig { override.params(node: T.nilable(::YARP::Node)).void } def visit(node); end end @@ -2151,100 +2458,130 @@ class RubyLsp::Requests::SemanticHighlighting < ::RubyLsp::Listener sig { override.returns(ResponseType) } def _response; end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#327 - sig { params(location: ::SyntaxTree::Location, type: ::Symbol, modifiers: T::Array[::Symbol]).void } + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#377 + sig { params(location: ::YARP::Location, type: ::Symbol, modifiers: T::Array[::Symbol]).void } def add_token(location, type, modifiers = T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#286 - sig { params(node: ::SyntaxTree::Binary).void } - def after_binary(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#240 + sig { params(node: ::YARP::BlockNode).void } + def after_block(node); end - # All block locals are variables. E.g.: [].each do |x; block_local| - # - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#254 - sig { params(node: ::SyntaxTree::BlockVar).void } - def on_block_var(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#230 + sig { params(node: ::YARP::DefNode).void } + def after_def(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#235 + sig { params(node: ::YARP::BlockNode).void } + def on_block(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#245 + sig { params(node: ::YARP::BlockLocalVariableNode).void } + def on_block_local_variable(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#250 + sig { params(node: ::YARP::BlockParameterNode).void } + def on_block_parameter(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#146 - sig { params(node: ::SyntaxTree::CallNode).void } + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#158 + sig { params(node: ::YARP::CallNode).void } def on_call(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#310 - sig { params(node: ::SyntaxTree::ClassDeclaration).void } + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#360 + sig { params(node: ::YARP::ClassNode).void } def on_class(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#157 - sig { params(node: ::SyntaxTree::Command).void } - def on_command(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#194 + sig { params(node: ::YARP::ConstantAndWriteNode).void } + def on_constant_and_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#164 - sig { params(node: ::SyntaxTree::CommandCall).void } - def on_command_call(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#201 + sig { params(node: ::YARP::ConstantOperatorWriteNode).void } + def on_constant_operator_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#172 - sig { params(node: ::SyntaxTree::Const).void } - def on_const(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#208 + sig { params(node: ::YARP::ConstantOrWriteNode).void } + def on_constant_or_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#183 - sig { params(node: ::SyntaxTree::DefNode).void } + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#176 + sig { params(node: ::YARP::ConstantReadNode).void } + def on_constant_read(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#215 + sig { params(node: ::YARP::ConstantTargetNode).void } + def on_constant_target(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#187 + sig { params(node: ::YARP::ConstantWriteNode).void } + def on_constant_write(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#222 + sig { params(node: ::YARP::DefNode).void } def on_def(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#220 - sig { params(node: ::SyntaxTree::Field).void } - def on_field(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#256 + sig { params(node: ::YARP::KeywordParameterNode).void } + def on_keyword_parameter(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#190 - sig { params(node: ::SyntaxTree::Kw).void } - def on_kw(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#267 + sig { params(node: ::YARP::KeywordRestParameterNode).void } + def on_keyword_rest_parameter(node); end - # All lambda locals are variables. E.g.: ->(x; lambda_local) {} - # - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#260 - sig { params(node: ::SyntaxTree::LambdaVar).void } - def on_lambda_var(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#332 + sig { params(node: ::YARP::LocalVariableAndWriteNode).void } + def on_local_variable_and_write(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#320 - sig { params(node: ::SyntaxTree::ModuleDeclaration).void } + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#339 + sig { params(node: ::YARP::LocalVariableOperatorWriteNode).void } + def on_local_variable_operator_write(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#346 + sig { params(node: ::YARP::LocalVariableOrWriteNode).void } + def on_local_variable_or_write(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#319 + sig { params(node: ::YARP::LocalVariableReadNode).void } + def on_local_variable_read(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#353 + sig { params(node: ::YARP::LocalVariableTargetNode).void } + def on_local_variable_target(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#312 + sig { params(node: ::YARP::LocalVariableWriteNode).void } + def on_local_variable_write(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#370 + sig { params(node: ::YARP::ModuleNode).void } def on_module(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#200 - sig { params(node: ::SyntaxTree::Params).void } - def on_params(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#278 + sig { params(node: ::YARP::OptionalParameterNode).void } + def on_optional_parameter(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#227 - sig { params(node: ::SyntaxTree::VarField).void } - def on_var_field(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#286 + sig { params(node: ::YARP::RequiredParameterNode).void } + def on_required_parameter(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#240 - sig { params(node: ::SyntaxTree::VarRef).void } - def on_var_ref(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#294 + sig { params(node: ::YARP::RestParameterNode).void } + def on_rest_parameter(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#265 - sig { params(node: ::SyntaxTree::VCall).void } - def on_vcall(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#305 + sig { params(node: ::YARP::SelfNode).void } + def on_self(node); end private - # Exclude the ":" symbol at the end of a location - # We use it on keyword parameters to be consistent - # with the rest of the parameters - # - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#346 - sig { params(location: T.untyped).returns(::SyntaxTree::Location) } - def location_without_colon(location); end + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#400 + sig { params(node: ::YARP::CallNode).void } + def process_regexp_locals(node); end - # Textmate provides highlighting for a subset - # of these special Ruby-specific methods. - # We want to utilize that highlighting, so we - # avoid making a semantic token for it. + # Textmate provides highlighting for a subset of these special Ruby-specific methods. We want to utilize that + # highlighting, so we avoid making a semantic token for it. # - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#362 + # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#395 sig { params(method_name: ::String).returns(T::Boolean) } def special_method?(method_name); end - - # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#367 - sig { params(value: ::SyntaxTree::Ident).returns(::Symbol) } - def type_for_local(value); end end # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#72 @@ -2253,14 +2590,7 @@ RubyLsp::Requests::SemanticHighlighting::SPECIAL_RUBY_METHODS = T.let(T.unsafe(n # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#83 class RubyLsp::Requests::SemanticHighlighting::SemanticToken # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#99 - sig do - params( - location: ::SyntaxTree::Location, - length: ::Integer, - type: ::Integer, - modifier: T::Array[::Integer] - ).void - end + sig { params(location: ::YARP::Location, length: ::Integer, type: ::Integer, modifier: T::Array[::Integer]).void } def initialize(location:, length:, type:, modifier:); end # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#90 @@ -2268,7 +2598,7 @@ class RubyLsp::Requests::SemanticHighlighting::SemanticToken def length; end # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#87 - sig { returns(::SyntaxTree::Location) } + sig { returns(::YARP::Location) } def location; end # source://ruby-lsp/lib/ruby_lsp/requests/semantic_highlighting.rb#96 @@ -2317,7 +2647,7 @@ class RubyLsp::Requests::ShowSyntaxTree < ::RubyLsp::Requests::BaseRequest private - # source://ruby-lsp/lib/ruby_lsp/requests/show_syntax_tree.rb#43 + # source://ruby-lsp/lib/ruby_lsp/requests/show_syntax_tree.rb#42 sig { returns(::String) } def ast_for_range; end end @@ -2332,28 +2662,26 @@ class RubyLsp::Requests::Support::Annotation def initialize(arity:, receiver: T.unsafe(nil)); end # source://ruby-lsp/lib/ruby_lsp/requests/support/annotation.rb#21 - sig { returns(T.any(::Integer, T::Range[::Integer])) } - def arity; end + sig { params(node: ::YARP::CallNode).returns(T::Boolean) } + def match?(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/annotation.rb#24 - sig { returns(T::Boolean) } - def receiver; end + private - # source://ruby-lsp/lib/ruby_lsp/requests/support/annotation.rb#27 - sig { params(arity: T.any(::Integer, T::Range[::Integer])).returns(T::Boolean) } - def supports_arity?(arity); end + # source://ruby-lsp/lib/ruby_lsp/requests/support/annotation.rb#34 + sig { params(node: ::YARP::CallNode).returns(T::Boolean) } + def arity_matches?(node); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/annotation.rb#38 - sig { params(receiver: T.nilable(::String)).returns(T::Boolean) } - def supports_receiver?(receiver); end + # source://ruby-lsp/lib/ruby_lsp/requests/support/annotation.rb#28 + sig { params(node: ::YARP::CallNode).returns(T::Boolean) } + def receiver_matches?(node); end end # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#7 module RubyLsp::Requests::Support::Common - # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#64 + # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#55 sig do params( - node: ::SyntaxTree::Node, + node: ::YARP::Node, title: ::String, command_name: ::String, arguments: T.nilable(T::Array[T.untyped]), @@ -2362,15 +2690,7 @@ module RubyLsp::Requests::Support::Common end def create_code_lens(node, title:, command_name:, arguments:, data:); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#28 - sig do - params( - node: T.any(::SyntaxTree::ConstPathRef, ::SyntaxTree::ConstRef, ::SyntaxTree::TopConstRef) - ).returns(::String) - end - def full_constant_name(node); end - - # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#79 + # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#70 sig do params( title: ::String, @@ -2379,12 +2699,16 @@ module RubyLsp::Requests::Support::Common end def markdown_from_index_entries(title, entries); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#13 - sig { params(node: ::SyntaxTree::Node).returns(::LanguageServer::Protocol::Interface::Range) } - def range_from_syntax_tree_node(node); end + # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#27 + sig { params(location: ::YARP::Location).returns(::LanguageServer::Protocol::Interface::Range) } + def range_from_location(location); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#47 - sig { params(node: T.nilable(::SyntaxTree::Node), range: T.nilable(T::Range[::Integer])).returns(T::Boolean) } + # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#14 + sig { params(node: ::YARP::Node).returns(::LanguageServer::Protocol::Interface::Range) } + def range_from_node(node); end + + # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#38 + sig { params(node: T.nilable(::YARP::Node), range: T.nilable(T::Range[::Integer])).returns(T::Boolean) } def visible?(node, range); end end @@ -2404,15 +2728,11 @@ end # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#7 class RubyLsp::Requests::Support::HighlightTarget # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#30 - sig { params(node: ::SyntaxTree::Node).void } + sig { params(node: ::YARP::Node).void } def initialize(node); end # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#36 - sig do - params( - other: ::SyntaxTree::Node - ).returns(T.nilable(::RubyLsp::Requests::Support::HighlightTarget::HighlightMatch)) - end + sig { params(other: ::YARP::Node).returns(T.nilable(::RubyLsp::Requests::Support::HighlightTarget::HighlightMatch)) } def highlight_type(other); end private @@ -2421,27 +2741,23 @@ class RubyLsp::Requests::Support::HighlightTarget # visiting) # # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#45 - sig do - params( - other: ::SyntaxTree::Node - ).returns(T.nilable(::RubyLsp::Requests::Support::HighlightTarget::HighlightMatch)) - end + sig { params(other: ::YARP::Node).returns(T.nilable(::RubyLsp::Requests::Support::HighlightTarget::HighlightMatch)) } def matched_highlight(other); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#77 - sig { params(node: ::SyntaxTree::Node).returns(T.nilable(::String)) } + # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#89 + sig { params(node: ::YARP::Node).returns(T.nilable(::String)) } def value(node); end end # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#13 class RubyLsp::Requests::Support::HighlightTarget::HighlightMatch # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#23 - sig { params(type: ::Integer, node: ::SyntaxTree::Node).void } - def initialize(type:, node:); end + sig { params(type: ::Integer, location: ::YARP::Location).void } + def initialize(type:, location:); end # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#20 - sig { returns(::SyntaxTree::Node) } - def node; end + sig { returns(::YARP::Location) } + def location; end # source://ruby-lsp/lib/ruby_lsp/requests/support/highlight_target.rb#17 sig { returns(::Integer) } @@ -2457,7 +2773,7 @@ RubyLsp::Requests::Support::HighlightTarget::WRITE = T.let(T.unsafe(nil), Intege # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#19 class RubyLsp::Requests::Support::InternalRuboCopError < ::StandardError # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#29 - sig { params(rubocop_error: ::RuboCop::ErrorWithAnalyzedFileLocation).void } + sig { params(rubocop_error: T.any(::RuboCop::ErrorWithAnalyzedFileLocation, ::StandardError)).void } def initialize(rubocop_error); end end @@ -2536,35 +2852,35 @@ class RubyLsp::Requests::Support::RuboCopFormattingRunner 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#41 class RubyLsp::Requests::Support::RuboCopRunner < ::RuboCop::Runner - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#63 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#68 sig { params(args: ::String).void } def initialize(*args); end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#95 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#100 sig { returns(::String) } def formatted_source; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#42 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#47 sig { returns(T::Array[::RuboCop::Cop::Offense]) } def offenses; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#77 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#82 sig { params(path: ::String, contents: ::String).void } def run(path, contents); end private - # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#102 + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#107 sig { params(_file: ::String, offenses: T::Array[::RuboCop::Cop::Offense]).void } def file_finished(_file, offenses); end end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#39 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#44 class RubyLsp::Requests::Support::RuboCopRunner::ConfigurationError < ::StandardError; end -# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#44 +# source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_runner.rb#49 RubyLsp::Requests::Support::RuboCopRunner::DEFAULT_ARGS = T.let(T.unsafe(nil), Array) # source://ruby-lsp/lib/ruby_lsp/requests/support/selection_range.rb#7 @@ -2609,40 +2925,22 @@ end class RubyLsp::Requests::Support::Sorbet class << self # source://ruby-lsp/lib/ruby_lsp/requests/support/sorbet.rb#48 - sig { params(node: T.any(::SyntaxTree::CallNode, ::SyntaxTree::VCall)).returns(T::Boolean) } + sig { params(node: ::YARP::CallNode).returns(T::Boolean) } def annotation?(node); end - - private - - # source://ruby-lsp/lib/ruby_lsp/requests/support/sorbet.rb#61 - sig do - params( - node: T.any(::SyntaxTree::CallNode, ::SyntaxTree::VCall) - ).returns(T.nilable(::RubyLsp::Requests::Support::Annotation)) - end - def annotation(node); end - - # source://ruby-lsp/lib/ruby_lsp/requests/support/sorbet.rb#90 - sig { params(node: T.nilable(::SyntaxTree::Node)).returns(T.nilable(::String)) } - def node_name(node); end - - # source://ruby-lsp/lib/ruby_lsp/requests/support/sorbet.rb#76 - sig { params(receiver: T.any(::SyntaxTree::CallNode, ::SyntaxTree::VCall)).returns(T.nilable(::String)) } - def receiver_name(receiver); end end end -# source://ruby-lsp/lib/ruby_lsp/requests/support/syntax_tree_formatting_runner.rb#11 +# source://ruby-lsp/lib/ruby_lsp/requests/support/syntax_tree_formatting_runner.rb#17 class RubyLsp::Requests::Support::SyntaxTreeFormattingRunner include ::Singleton include ::RubyLsp::Requests::Support::FormatterRunner extend ::Singleton::SingletonClassMethods - # source://ruby-lsp/lib/ruby_lsp/requests/support/syntax_tree_formatting_runner.rb#17 + # source://ruby-lsp/lib/ruby_lsp/requests/support/syntax_tree_formatting_runner.rb#23 sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_lsp/requests/support/syntax_tree_formatting_runner.rb#30 + # source://ruby-lsp/lib/ruby_lsp/requests/support/syntax_tree_formatting_runner.rb#36 sig { override.params(uri: ::URI::Generic, document: ::RubyLsp::Document).returns(T.nilable(::String)) } def run(uri, document); end @@ -2681,7 +2979,7 @@ class RubyLsp::Requests::WorkspaceSymbol private - # source://ruby-lsp/lib/ruby_lsp/requests/workspace_symbol.rb#74 + # source://ruby-lsp/lib/ruby_lsp/requests/workspace_symbol.rb#77 sig { params(entry: ::RubyIndexer::Index::Entry).returns(T.nilable(::Integer)) } def kind_for_entry(entry); end end @@ -2690,18 +2988,14 @@ end # # source://ruby-lsp/lib/ruby_lsp/utils.rb#35 class RubyLsp::Result - # source://ruby-lsp/lib/ruby_lsp/utils.rb#54 - sig { params(response: T.untyped, error: T.nilable(::Exception), request_time: T.nilable(::Float)).void } - def initialize(response:, error: T.unsafe(nil), request_time: T.unsafe(nil)); end + # source://ruby-lsp/lib/ruby_lsp/utils.rb#45 + sig { params(response: T.untyped, error: T.nilable(::Exception)).void } + def initialize(response:, error: T.unsafe(nil)); end # source://ruby-lsp/lib/ruby_lsp/utils.rb#42 sig { returns(T.nilable(::Exception)) } def error; end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#45 - sig { returns(T.nilable(::Float)) } - def request_time; end - # source://ruby-lsp/lib/ruby_lsp/utils.rb#39 sig { returns(T.untyped) } def response; end @@ -2728,16 +3022,6 @@ class RubyLsp::Server # source://ruby-lsp/lib/ruby_lsp/server.rb#120 sig { returns(::Thread) } def new_worker; end - - # source://ruby-lsp/lib/ruby_lsp/server.rb#177 - sig do - params( - request: T::Hash[::Symbol, T.untyped], - request_time: ::Float, - error: T.nilable(::Exception) - ).returns(T::Hash[::Symbol, T.any(::Float, ::String)]) - end - def telemetry_params(request, request_time, error); end end # source://ruby-lsp/lib/ruby_lsp/store.rb#7 diff --git a/sorbet/rbi/gems/unparser@0.6.8.rbi b/sorbet/rbi/gems/unparser@0.6.8.rbi deleted file mode 100644 index 937e273..0000000 --- a/sorbet/rbi/gems/unparser@0.6.8.rbi +++ /dev/null @@ -1,4525 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `unparser` gem. -# Please instead update this file by running `bin/tapioca gem unparser`. - -# Library namespace -# -# source://unparser//lib/unparser/equalizer.rb#3 -module Unparser - class << self - # Construct a parser buffer from string - # - # @param source [String] - # @return [Parser::Source::Buffer] - # - # source://unparser//lib/unparser.rb#147 - def buffer(source, identification = T.unsafe(nil)); end - - # Parse string into AST - # - # @param source [String] - # @return [Parser::AST::Node, nil] - # - # source://unparser//lib/unparser.rb#105 - def parse(source); end - - # Parse string into either syntax error or AST - # - # @param source [String] - # @return [Either] - # - # source://unparser//lib/unparser.rb#114 - def parse_either(source); end - - # Parse string into AST, with comments - # - # @param source [String] - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser.rb#125 - def parse_with_comments(source); end - - # Parser instance that produces AST unparser understands - # - # @api private - # @return [Parser::Base] - # - # source://unparser//lib/unparser.rb#134 - def parser; end - - # Unparse an AST (and, optionally, comments) into a string - # - # @api public - # @param node [Parser::AST::Node, nil] - # @param comment_array [Array] - # @raise InvalidNodeError - # if the node passed is invalid - # @return [String] - # - # source://unparser//lib/unparser.rb#60 - def unparse(node, comment_array = T.unsafe(nil)); end - - # Unparse capturing errors - # - # This is mostly useful for writing testing tools against unparser. - # - # @param node [Parser::AST::Node, nil] - # @return [Either] - # - # source://unparser//lib/unparser.rb#96 - def unparse_either(node); end - - # Unparse with validation - # - # @param node [Parser::AST::Node, nil] - # @param comment_array [Array] - # @return [Either] - # - # source://unparser//lib/unparser.rb#78 - def unparse_validate(node, comment_array = T.unsafe(nil)); end - end -end - -# Namespace for AST processing tools -# -# source://unparser//lib/unparser/ast.rb#5 -module Unparser::AST - class << self - # Return local variables that get assigned in scope - # - # @api private - # @param node [Parser::AST::Node] - # @return [Set] - # - # source://unparser//lib/unparser/ast.rb#57 - def local_variable_assignments(node); end - - # Return local variables read - # - # @api private - # @param node [Parser::AST::Node] - # @return [Set] - # - # source://unparser//lib/unparser/ast.rb#72 - def local_variable_reads(node); end - - # Test for local variable inherited scope reset - # - # @api private - # @param node [Parser::AST::Node] - # @return [Boolean] - # - # source://unparser//lib/unparser/ast.rb#33 - def not_close_scope?(node); end - - # Test for local variable scope reset - # - # @api private - # @param node [Parser::AST::Node] - # @return [Boolean] - # - # source://unparser//lib/unparser/ast.rb#45 - def not_reset_scope?(node); end - end -end - -# Nodes that assign a local variable -# -# source://unparser//lib/unparser/ast.rb#14 -Unparser::AST::ASSIGN_NODES = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/ast.rb#11 -Unparser::AST::CLOSE_NODES = T.let(T.unsafe(nil), Array) - -# AST enumerator -# -# source://unparser//lib/unparser/ast.rb#80 -class Unparser::AST::Enumerator - include ::Enumerable - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Return each node - # - # @api private - # @return [Enumerator] if no block given - # @return [self] otherwise - # - # source://unparser//lib/unparser/ast.rb#106 - def each(&block); end - - # Return nodes selected by type - # - # @api private - # @param type [Symbol] - # @return [Enumerable] - # - # source://unparser//lib/unparser/ast.rb#130 - def type(type); end - - # Return nodes selected by types - # - # @api private - # @param types [Enumerable] - # @return [Enumerable] - # - # source://unparser//lib/unparser/ast.rb#118 - def types(types); end - - class << self - # Return new instance - # - # @api private - # @param node [Parser::AST::Node] - # @param controller [#call(node)] - # @return [Enumerator] - # - # source://unparser//lib/unparser/ast.rb#92 - def new(node, controller = T.unsafe(nil)); end - - private - - # Return frozne set of objects - # - # @api private - # @param enumerable [Enumerable] - # @return [Set] - # - # source://unparser//lib/unparser/ast.rb#142 - def set(enumerable); end - - # Return nodes of type - # - # @api private - # @param node [Parser::AST::Node] - # @param type [Symbol] - # @return [Enumerable>] ] - # otherwise - # - # source://unparser//lib/unparser/ast/local_variable_scope.rb#121 - def each(node, &block); end - - private - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#127 - def current; end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#156 - def define(name); end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#141 - def enter(node); end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#152 - def leave(node); end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#168 - def pop; end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#164 - def push_inherit; end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#160 - def push_reset; end - - # @yield [node, current.dup, before] - # - # source://unparser//lib/unparser/ast/local_variable_scope.rb#131 - def visit(node, &block); end - - class << self - # Enumerate each node with its local variable scope - # - # @api private - # @param node [Parser::AST::Node] - # @return [self] - # - # source://unparser//lib/unparser/ast/local_variable_scope.rb#106 - def each(node, &block); end - end -end - -# source://unparser//lib/unparser/ast.rb#9 -Unparser::AST::RESET_NODES = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser/ast.rb#7 -Unparser::AST::TAUTOLOGY = T.let(T.unsafe(nil), Proc) - -# Controlled AST walker walking the AST in deeth first search with pre order -# -# source://unparser//lib/unparser/ast.rb#164 -class Unparser::AST::Walker - include ::Unparser::Equalizer::Methods - - # Call walker with node - # - # @api private - # @param node [Parser::AST::Node] - # @return [undefined] - # - # source://unparser//lib/unparser/ast.rb#188 - def call(node); end - - class << self - # Call ast walker - # - # @api private - # @param node [Parser::AST::Node] - # @return [self] - # - # source://unparser//lib/unparser/ast.rb#175 - def call(node, controller = T.unsafe(nil), &block); end - end -end - -# Module to allow class and methods to be abstract -# -# Original code before vendoring and reduction from: https://github.com/dkubb/abstract_type. -# -# source://unparser//lib/unparser/abstract_type.rb#7 -module Unparser::AbstractType - mixes_in_class_methods ::Unparser::AbstractType::AbstractMethodDeclarations - - class << self - private - - # Define the new method on the abstract type - # - # Ensures that the instance cannot be of the abstract type - # and must be a descendant. - # - # @api private - # @param abstract_class [Class] - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#35 - def create_new_method(abstract_class); end - - # Hook called when module is included - # - # @api private - # @param descendant [Module] the module or class including AbstractType - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#17 - def included(descendant); end - end -end - -# source://unparser//lib/unparser/abstract_type.rb#47 -module Unparser::AbstractType::AbstractMethodDeclarations - # Create abstract instance methods - # - # @api public - # @example - # class Foo - # include AbstractType - # - # # Create an abstract instance method - # abstract_method :some_method - # end - # @param names [Array<#to_s>] - # @return [self] - # - # source://unparser//lib/unparser/abstract_type.rb#64 - def abstract_method(*names); end - - # Create abstract singleton methods - # - # @api private - # @example - # class Foo - # include AbstractType - # - # # Create an abstract instance method - # abstract_singleton_method :some_method - # end - # @param names [Array<#to_s>] - # @return [self] - # - # source://unparser//lib/unparser/abstract_type.rb#84 - def abstract_singleton_method(*names); end - - private - - # Create abstract instance method - # - # @api private - # @param name [#to_s] the name of the method to create - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#113 - def create_abstract_instance_method(name); end - - # Create abstract singleton method - # - # @api private - # @param name [#to_s] the name of the method to create - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#99 - def create_abstract_singleton_method(name); end -end - -# Allows objects to be made immutable -# -# Original code before vendoring and reduction from: https://github.com/dkubb/adamantium. -# -# source://unparser//lib/unparser/adamantium.rb#7 -module Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - - mixes_in_class_methods ::Unparser::Adamantium::ModuleMethods - mixes_in_class_methods ::Unparser::Adamantium::ClassMethods - - class << self - private - - # ModuleMethods - # - # source://unparser//lib/unparser/adamantium.rb#141 - def included(descendant); end - end -end - -# Methods mixed in to adamantium classes -# -# source://unparser//lib/unparser/adamantium.rb#70 -module Unparser::Adamantium::ClassMethods - # Instantiate a new frozen object - # - # @api public - # @return [Object] - # - # source://unparser//lib/unparser/adamantium.rb#77 - def new(*_arg0); end -end - -# source://unparser//lib/unparser/adamantium.rb#8 -module Unparser::Adamantium::InstanceMethods - # A noop #dup for immutable objects - # - # @api public - # @return [self] - # - # source://unparser//lib/unparser/adamantium.rb#14 - def dup; end - - # Freeze the object - # - # @api public - # @return [Object] - # - # source://unparser//lib/unparser/adamantium.rb#23 - def freeze; end - - private - - # source://unparser//lib/unparser/adamantium.rb#30 - def memoized_method_cache; end -end - -# Storage for memoized methods -# -# source://unparser//lib/unparser/adamantium.rb#37 -class Unparser::Adamantium::Memory - # Initialize the memory storage for memoized methods - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/adamantium.rb#44 - def initialize(values); end - - # Fetch the value from memory, or evaluate if it does not exist - # - # @api public - # @param name [Symbol] - # @yieldreturn [Object] the value to memoize - # - # source://unparser//lib/unparser/adamantium.rb#58 - def fetch(name); end -end - -# Build the memoized method -# -# source://unparser//lib/unparser/adamantium/method_builder.rb#6 -class Unparser::Adamantium::MethodBuilder - # Initialize an object to build a memoized method - # - # @api private - # @param descendant [Module] - # @param method_name [Symbol] - # @return [undefined] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#47 - def initialize(descendant, method_name); end - - # Build a new memoized method - # - # @api public - # @example - # method_builder.call # => creates new method - # @return [UnboundMethod] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#63 - def call; end - - private - - # source://unparser//lib/unparser/adamantium/method_builder.rb#72 - def assert_arity(arity); end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#83 - def create_memoized_method; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#78 - def remove_original_method; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#97 - def set_method_visibility; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#101 - def visibility; end -end - -# Raised when a block is passed to a memoized method -# -# source://unparser//lib/unparser/adamantium/method_builder.rb#25 -class Unparser::Adamantium::MethodBuilder::BlockNotAllowedError < ::ArgumentError - # Initialize a block not allowed exception - # - # @api private - # @param descendant [Module] - # @param method [Symbol] - # @return [BlockNotAllowedError] a new instance of BlockNotAllowedError - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#33 - def initialize(descendant, method); end -end - -# Raised when the method arity is invalid -# -# source://unparser//lib/unparser/adamantium/method_builder.rb#9 -class Unparser::Adamantium::MethodBuilder::InvalidArityError < ::ArgumentError - # Initialize an invalid arity exception - # - # @api private - # @param descendant [Module] - # @param method [Symbol] - # @param arity [Integer] - # @return [InvalidArityError] a new instance of InvalidArityError - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#18 - def initialize(descendant, method, arity); end -end - -# Methods mixed in to adamantium modules -# -# source://unparser//lib/unparser/adamantium.rb#84 -module Unparser::Adamantium::ModuleMethods - # Memoize a list of methods - # - # @api public - # @param methods [Array<#to_s>] a list of methods to memoize - # @return [self] - # - # source://unparser//lib/unparser/adamantium.rb#94 - def memoize(*methods); end - - # Test if method is memoized - # - # @param name [Symbol] - # @return [Bool] - # - # source://unparser//lib/unparser/adamantium.rb#104 - def memoized?(method_name); end - - # Return unmemoized instance method - # - # @api public - # @param name [Symbol] - # @raise [NameError] raised if the method is unknown - # @return [UnboundMethod] the memoized method - # - # source://unparser//lib/unparser/adamantium.rb#119 - def unmemoized_instance_method(method_name); end - - private - - # source://unparser//lib/unparser/adamantium.rb#127 - def memoize_method(method_name); end - - # source://unparser//lib/unparser/adamantium.rb#135 - def memoized_methods; end -end - -# Original code before vendoring and reduction from: https://github.com/mbj/anima. -# -# source://unparser//lib/unparser/anima.rb#5 -class Unparser::Anima < ::Module - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Initialize object - # - # - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#18 - def initialize(*names); end - - # Return new anima with attributes added - # - # @example - # anima = Anima.new(:foo) - # anima.add(:bar) # equals Anima.new(:foo, :bar) - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#31 - def add(*names); end - - # Return attribute names - # - # @return [Enumerable] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def attribute_names(&block); end - - # Return names - # - # @return [AttributeSet] - # - # source://unparser//lib/unparser/anima.rb#11 - def attributes; end - - # Return attributes hash for instance - # - # @param object [Object] - # @return [Hash] - # - # source://unparser//lib/unparser/anima.rb#52 - def attributes_hash(object); end - - # Initialize instance - # - # @param object [Object] - # @param attribute_hash [Hash] - # @return [self] - # - # source://unparser//lib/unparser/anima.rb#73 - def initialize_instance(object, attribute_hash); end - - # Return new anima with attributes removed - # - # @example - # anima = Anima.new(:foo, :bar) - # anima.remove(:bar) # equals Anima.new(:foo) - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#43 - def remove(*names); end - - private - - # Fail unless keys in +attribute_hash+ matches #attribute_names - # - # @param klass [Class] the class being initialized - # @param attribute_hash [Hash] the attributes to initialize +object+ with - # @raise [Error] - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#164 - def assert_known_attributes(klass, attribute_hash); end - - # Infect the instance with anima - # - # @param scope [Class, Module] - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#137 - def included(descendant); end - - # Return new instance - # - # @param attributes [Enumerable] - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#180 - def new(attributes); end -end - -# An attribute -# -# source://unparser//lib/unparser/anima/attribute.rb#6 -class Unparser::Anima::Attribute - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Initialize attribute - # - # @param name [Symbol] - # @return [Attribute] a new instance of Attribute - # - # source://unparser//lib/unparser/anima/attribute.rb#12 - def initialize(name); end - - # Get attribute value from object - # - # @param object [Object] - # @return [Object] - # - # source://unparser//lib/unparser/anima/attribute.rb#42 - def get(object); end - - # Return instance variable name - # - # @return [Symbol] - # - # source://unparser//lib/unparser/anima/attribute.rb#25 - def instance_variable_name; end - - # Load attribute - # - # @param object [Object] - # @param attributes [Hash] - # @return [self] - # - # source://unparser//lib/unparser/anima/attribute.rb#33 - def load(object, attributes); end - - # Return attribute name - # - # @return [Symbol] - # - # source://unparser//lib/unparser/anima/attribute.rb#20 - def name; end - - # Set attribute value in object - # - # @param object [Object] - # @param value [Object] - # @return [self] - # - # source://unparser//lib/unparser/anima/attribute.rb#52 - def set(object, value); end -end - -# Abstract base class for anima errors -# -# source://unparser//lib/unparser/anima/error.rb#6 -class Unparser::Anima::Error < ::RuntimeError - # Initialize object - # - # @param klass [Class] the class being initialized - # @param missing [Enumerable] - # @param unknown [Enumerable] - # @return [undefined] - # - # source://unparser//lib/unparser/anima/error.rb#18 - def initialize(klass, missing, unknown); end -end - -# source://unparser//lib/unparser/anima/error.rb#7 -Unparser::Anima::Error::FORMAT = T.let(T.unsafe(nil), String) - -# Static instance methods for anima infected classes -# -# source://unparser//lib/unparser/anima.rb#82 -module Unparser::Anima::InstanceMethods - # Initialize an anima infected object - # - # - # @param attributes [#to_h] a hash that matches anima defined attributes - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#91 - def initialize(attributes); end - - # Return a hash representation of an anima infected object - # - # @api public - # @example - # anima.to_h # => { :foo => : bar } - # @return [Hash] - # - # source://unparser//lib/unparser/anima.rb#104 - def to_h; end - - # Return updated instance - # - # @api public - # @example - # klass = Class.new do - # include Anima.new(:foo, :bar) - # end - # - # foo = klass.new(:foo => 1, :bar => 2) - # updated = foo.with(:foo => 3) - # updated.foo # => 3 - # updated.bar # => 2 - # @param attributes [Hash] - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#125 - def with(attributes); end -end - -# Buffer used to emit into -# -# source://unparser//lib/unparser/buffer.rb#6 -class Unparser::Buffer - # Initialize object - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/buffer.rb#16 - def initialize; end - - # Append string - # - # @api private - # @param string [String] - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#29 - def append(string); end - - # Append a string without an indentation prefix - # - # @api private - # @param string [String] - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#45 - def append_without_prefix(string); end - - # Return content of buffer - # - # @api private - # @return [String] - # - # source://unparser//lib/unparser/buffer.rb#104 - def content; end - - # Test for a fresh line - # - # @api private - # @return [Boolean] - # - # source://unparser//lib/unparser/buffer.rb#94 - def fresh_line?; end - - # Increase indent - # - # @api private - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#55 - def indent; end - - # Write newline - # - # @api private - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#77 - def nl; end - - # source://unparser//lib/unparser/buffer.rb#81 - def root_indent; end - - # Decrease indent - # - # @api private - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#66 - def unindent; end - - # Write raw fragment to buffer - # - # Does not do indentation logic. - # - # @param fragment [String] - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#115 - def write(fragment); end - - private - - # source://unparser//lib/unparser/buffer.rb#124 - def prefix; end -end - -# source://unparser//lib/unparser/buffer.rb#122 -Unparser::Buffer::INDENT_SPACE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/buffer.rb#8 -Unparser::Buffer::NL = T.let(T.unsafe(nil), String) - -# Unparser specific AST builder defaulting to modern AST format -# -# source://unparser//lib/unparser.rb#23 -class Unparser::Builder < ::Parser::Builders::Default - # @return [Builder] a new instance of Builder - # - # source://unparser//lib/unparser.rb#26 - def initialize; end -end - -# Unparser CLI implementation -# -# source://unparser//lib/unparser/cli.rb#5 -class Unparser::CLI - # Initialize object - # - # @api private - # @param arguments [Array] - # @return [undefined] - # - # source://unparser//lib/unparser/cli.rb#74 - def initialize(arguments); end - - # Add options - # - # - # @api private - # @param builder [OptionParser] - # @return [undefined] - # - # source://unparser//lib/unparser/cli.rb#102 - def add_options(builder); end - - # Return exit status - # - # @api private - # @return [Integer] - # - # source://unparser//lib/unparser/cli.rb#132 - def exit_status; end - - private - - # source://unparser//lib/unparser/cli.rb#155 - def effective_targets; end - - # source://unparser//lib/unparser/cli.rb#143 - def process_target(target); end - - # source://unparser//lib/unparser/cli.rb#170 - def targets(file_name); end - - class << self - # Run CLI - # - # @api private - # @param arguments [Array] - # @return [Integer] the exit status - # - # source://unparser//lib/unparser/cli.rb#63 - def run(*arguments); end - end -end - -# source://unparser//lib/unparser/cli.rb#8 -Unparser::CLI::EXIT_FAILURE = T.let(T.unsafe(nil), Integer) - -# source://unparser//lib/unparser/cli.rb#7 -Unparser::CLI::EXIT_SUCCESS = T.let(T.unsafe(nil), Integer) - -# source://unparser//lib/unparser/cli.rb#10 -class Unparser::CLI::Target - include ::Unparser::AbstractType - extend ::Unparser::AbstractType::AbstractMethodDeclarations - - class << self - # source://unparser//lib/unparser/abstract_type.rb#36 - def new(*args, &block); end - end -end - -# Path target -# -# source://unparser//lib/unparser/cli.rb#14 -class Unparser::CLI::Target::Path < ::Unparser::CLI::Target - include ::Unparser::Equalizer::Methods - - # Literal for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#27 - def literal_validation; end - - # Validation for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#20 - def validation; end -end - -# String target -# -# source://unparser//lib/unparser/cli.rb#33 -class Unparser::CLI::Target::String - include ::Unparser::Equalizer::Methods - - # Literal for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#46 - def literal_validation; end - - # Validation for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#39 - def validation; end -end - -# Class to colorize strings -# -# source://unparser//lib/unparser/color.rb#5 -class Unparser::Color - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Format text with color - # - # @param text [String] - # @return [String] - # - # source://unparser//lib/unparser/color.rb#13 - def format(text); end -end - -# source://unparser//lib/unparser/color.rb#41 -Unparser::Color::GREEN = T.let(T.unsafe(nil), Unparser::Color) - -# source://unparser//lib/unparser/color.rb#17 -Unparser::Color::NONE = T.let(T.unsafe(nil), T.untyped) - -# source://unparser//lib/unparser/color.rb#40 -Unparser::Color::RED = T.let(T.unsafe(nil), Unparser::Color) - -# Holds the comments that remain to be emitted -# -# source://unparser//lib/unparser/comments.rb#6 -class Unparser::Comments - # Initialize object - # - # @api private - # @param comments [Array] - # @return [undefined] - # - # source://unparser//lib/unparser/comments.rb#30 - def initialize(comments); end - - # Consume part or all of the node - # - # @api private - # @param node [Parser::AST::Node] - # @param source_part [Symbol] - # @return [undefined] - # - # source://unparser//lib/unparser/comments.rb#44 - def consume(node, source_part = T.unsafe(nil)); end - - # Proxy to singleton - # - # NOTICE: - # Delegating to stateless helpers is a pattern I saw many times in our code. - # Maybe we should make another helper module? include SingletonDelegator.new(:source_range) ? - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/comments.rb#18 - def source_range(*arguments); end - - # Take all remaining comments - # - # @api private - # @return [Array] - # - # source://unparser//lib/unparser/comments.rb#68 - def take_all; end - - # Take comments appear in the source before the specified part of the node - # - # @api private - # @param node [Parser::AST::Node] - # @param source_part [Symbol] - # @return [Array] - # - # source://unparser//lib/unparser/comments.rb#81 - def take_before(node, source_part); end - - # Take end-of-line comments - # - # @api private - # @return [Array] - # - # source://unparser//lib/unparser/comments.rb#55 - def take_eol_comments; end - - private - - # source://unparser//lib/unparser/comments.rb#119 - def take_up_to_line(line); end - - # source://unparser//lib/unparser/comments.rb#114 - def take_while; end - - # source://unparser//lib/unparser/comments.rb#123 - def unshift_documents(comments); end - - class << self - # Return source location part - # - # FIXME: This method should not be needed. It does to much inline signalling. - # - # :reek:ManualDispatch - # - # @api private - # @param node [Parser::AST::Node] - # @param part [Symbol] - # @return [Parser::Source::Range] if present - # @return [nil] otherwise - # - # source://unparser//lib/unparser/comments.rb#107 - def source_range(node, part); end - end -end - -# A mixin to define a composition -# -# Original code before vendoring and reduction from: https://github.com/mbj/concord. -# -# source://unparser//lib/unparser/concord.rb#7 -class Unparser::Concord < ::Module - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Initialize object - # - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#30 - def initialize(*names); end - - # Return names - # - # @api private - # @return [Enumerable] - # - # source://unparser//lib/unparser/concord.rb#19 - def names; end - - private - - # Define equalizer - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#48 - def define_equalizer; end - - # Define initialize method - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#72 - def define_initialize; end - - # Define readers - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#58 - def define_readers; end - - # Return instance variable names - # - # @api private - # @return [String] - # - # source://unparser//lib/unparser/concord.rb#92 - def instance_variable_names; end -end - -# The maximum number of objects the hosting class is composed of -# -# source://unparser//lib/unparser/concord.rb#11 -Unparser::Concord::MAX_NR_OF_OBJECTS = T.let(T.unsafe(nil), Integer) - -# Mixin for public attribute readers -# -# source://unparser//lib/unparser/concord.rb#97 -class Unparser::Concord::Public < ::Unparser::Concord - # Hook called when module is included - # - # @api private - # @param descendant [Class, Module] - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#107 - def included(descendant); end -end - -# All unparser constants maybe included in other libraries. -# -# source://unparser//lib/unparser/constants.rb#5 -module Unparser::Constants; end - -# All binary operators of the ruby language -# -# source://unparser//lib/unparser/constants.rb#13 -Unparser::Constants::BINARY_OPERATORS = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/constants.rb#63 -Unparser::Constants::KEYWORDS = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/constants.rb#45 -Unparser::Constants::K_ALIAS = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#44 -Unparser::Constants::K_AND = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#23 -Unparser::Constants::K_BEGIN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#37 -Unparser::Constants::K_BREAK = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#24 -Unparser::Constants::K_CASE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#25 -Unparser::Constants::K_CLASS = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#21 -Unparser::Constants::K_DEF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#28 -Unparser::Constants::K_DEFINE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#33 -Unparser::Constants::K_DEFINED = T.let(T.unsafe(nil), String) - -# Keywords -# -# source://unparser//lib/unparser/constants.rb#20 -Unparser::Constants::K_DO = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#59 -Unparser::Constants::K_EEND = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#46 -Unparser::Constants::K_ELSE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#47 -Unparser::Constants::K_ELSIF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#58 -Unparser::Constants::K_ENCODING = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#22 -Unparser::Constants::K_END = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#27 -Unparser::Constants::K_ENSURE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#41 -Unparser::Constants::K_FALSE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#60 -Unparser::Constants::K_FILE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#48 -Unparser::Constants::K_FOR = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#43 -Unparser::Constants::K_IF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#51 -Unparser::Constants::K_IN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#29 -Unparser::Constants::K_MODULE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#40 -Unparser::Constants::K_NEXT = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#49 -Unparser::Constants::K_NIL = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#50 -Unparser::Constants::K_NOT = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#52 -Unparser::Constants::K_OR = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#35 -Unparser::Constants::K_POSTEXE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#34 -Unparser::Constants::K_PREEXE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#39 -Unparser::Constants::K_REDO = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#30 -Unparser::Constants::K_RESCUE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#38 -Unparser::Constants::K_RETRY = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#31 -Unparser::Constants::K_RETURN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#26 -Unparser::Constants::K_SELF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#36 -Unparser::Constants::K_SUPER = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#61 -Unparser::Constants::K_THEN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#42 -Unparser::Constants::K_TRUE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#32 -Unparser::Constants::K_UNDEF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#53 -Unparser::Constants::K_UNLESS = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#56 -Unparser::Constants::K_UNTIL = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#54 -Unparser::Constants::K_WHEN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#55 -Unparser::Constants::K_WHILE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#57 -Unparser::Constants::K_YIELD = T.let(T.unsafe(nil), String) - -# All unary operators of the ruby language -# -# source://unparser//lib/unparser/constants.rb#8 -Unparser::Constants::UNARY_OPERATORS = T.let(T.unsafe(nil), Set) - -# DSL to help defining emitters -# -# source://unparser//lib/unparser/dsl.rb#5 -module Unparser::DSL - private - - # source://unparser//lib/unparser/dsl.rb#32 - def children(*names); end - - # source://unparser//lib/unparser/dsl.rb#17 - def define_child(name, index); end - - # source://unparser//lib/unparser/dsl.rb#24 - def define_group(name, range); end - - # source://unparser//lib/unparser/dsl.rb#9 - def define_remaining_children(names); end -end - -# Class to create diffs from source code -# -# source://unparser//lib/unparser/diff.rb#5 -class Unparser::Diff - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Colorized unified source diff between old and new - # - # @return [String] if there is a diff - # @return [nil] otherwise - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def colorized_diff(&block); end - - # Unified source diff between old and new - # - # @return [String] if there is exactly one diff - # @return [nil] otherwise - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def diff(&block); end - - private - - # source://unparser//lib/unparser/diff.rb#62 - def diffs; end - - # source://unparser//lib/unparser/diff.rb#66 - def hunks; end - - # source://unparser//lib/unparser/diff.rb#81 - def max_length; end - - # source://unparser//lib/unparser/diff.rb#72 - def minimized_hunk; end - - class << self - # Build new object from source strings - # - # @param old [String] - # @param new [String] - # @return [Diff] - # - # source://unparser//lib/unparser/diff.rb#46 - def build(old, new); end - - private - - # source://unparser//lib/unparser/diff.rb#85 - def colorize_line(line); end - - # Break up source into lines - # - # @param source [String] - # @return [Array] - # - # source://unparser//lib/unparser/diff.rb#55 - def lines(source); end - end -end - -# source://unparser//lib/unparser/diff.rb#8 -Unparser::Diff::ADDITION = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/diff.rb#9 -Unparser::Diff::DELETION = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/diff.rb#10 -Unparser::Diff::NEWLINE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser.rb#34 -Unparser::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser.rb#33 -Unparser::EMPTY_STRING = T.let(T.unsafe(nil), String) - -# RequireBLock -# -# source://unparser//lib/unparser/either.rb#21 -class Unparser::Either - include ::Unparser::RequireBlock - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Test for left constructor - # - # @return [Boolean] - # - # source://unparser//lib/unparser/either.rb#42 - def left?; end - - # Test for right constructor - # - # @return [Boolean] - # - # source://unparser//lib/unparser/either.rb#49 - def right?; end - - class << self - # Execute block and wrap error in left - # - # @param exception [Class] - # @return [Either] - # - # source://unparser//lib/unparser/either.rb#33 - def wrap_error(*exceptions); end - end -end - -# source://unparser//lib/unparser/either.rb#53 -class Unparser::Either::Left < ::Unparser::Either - # Evaluate applicative block - # - # @return [Either::Left] - # - # source://unparser//lib/unparser/either.rb#64 - def bind(&block); end - - # Evaluate left side of branch - # - # @param left [#call] - # @param _right [#call] - # - # source://unparser//lib/unparser/either.rb#98 - def either(left, _right); end - - # Evaluate functor block - # - # @return [Either::Left] - # - # source://unparser//lib/unparser/either.rb#57 - def fmap(&block); end - - # Unwrap value from left - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#71 - def from_left; end - - # Unwrap value from right - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#79 - def from_right; end - - # Map over left value - # - # @return [Either::Right] - # - # source://unparser//lib/unparser/either.rb#90 - def lmap; end -end - -# Left -# -# source://unparser//lib/unparser/either.rb#103 -class Unparser::Either::Right < ::Unparser::Either - # Evaluate applicative block - # - # @return [Either] - # @yield [value] - # - # source://unparser//lib/unparser/either.rb#114 - def bind; end - - # Evaluate right side of branch - # - # @param _left [#call] - # @param right [#call] - # - # source://unparser//lib/unparser/either.rb#148 - def either(_left, right); end - - # Evaluate functor block - # - # @return [Either::Right] - # - # source://unparser//lib/unparser/either.rb#107 - def fmap; end - - # Unwrap value from left - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#122 - def from_left; end - - # Unwrap value from right - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#133 - def from_right; end - - # Map over left value - # - # @return [Either::Right] - # - # source://unparser//lib/unparser/either.rb#140 - def lmap(&block); end -end - -# Emitter base class -# -# source://unparser//lib/unparser/emitter.rb#7 -class Unparser::Emitter - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Constants - include ::Unparser::AbstractType - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::AbstractType::AbstractMethodDeclarations - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # Dispatch node write as statement - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#114 - def dispatch(*_arg0); end - - # source://unparser//lib/unparser/emitter.rb#59 - def emit_mlhs; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - # LocalVariableRoot - # - # source://unparser//lib/unparser/emitter.rb#38 - def node_type; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - - # Return emitter - # - # - # @api private - # @return [Emitter] - # - # source://unparser//lib/unparser/emitter.rb#70 - def emitter(buffer:, comments:, node:, local_variable_scope:); end - - # source://unparser//lib/unparser/abstract_type.rb#36 - def new(*args, &block); end - - private - - # Register emitter for type - # - # @api private - # @param types [Symbol] - # @return [undefined] - # - # source://unparser//lib/unparser/emitter.rb#50 - def handle(*types); end - end -end - -# Emitter for alias nodes -# -# source://unparser//lib/unparser/emitter/alias.rb#6 -class Unparser::Emitter::Alias < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/alias.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def source; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Arguments emitter -# -# source://unparser//lib/unparser/emitter/args.rb#6 -class Unparser::Emitter::Args < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/args.rb#7 - def emit_block_arguments; end - - # source://unparser//lib/unparser/emitter/args.rb#15 - def emit_def_arguments; end - - # source://unparser//lib/unparser/emitter/args.rb#19 - def emit_lambda_arguments; end - - private - - # source://unparser//lib/unparser/emitter/args.rb#26 - def emit_shadowargs; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def normal_arguments(&block); end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def shadowargs(&block); end -end - -# Argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#84 -class Unparser::Emitter::Argument < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#91 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Array literal emitter -# -# source://unparser//lib/unparser/emitter/array.rb#6 -class Unparser::Emitter::Array < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/array.rb#9 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/array.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def emitters(&block); end -end - -# Emitter for array patterns -# -# source://unparser//lib/unparser/emitter/array_pattern.rb#6 -class Unparser::Emitter::ArrayPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/array_pattern.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/emitter/array_pattern.rb#20 - def emit_member(node); end -end - -# Base class for assignment emitters -# -# source://unparser//lib/unparser/emitter/assignment.rb#7 -class Unparser::Emitter::Assignment < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/assignment.rb#14 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/abstract_type.rb#114 - def emit_left(*_arg0); end - - # source://unparser//lib/unparser/emitter/assignment.rb#10 - def symbol_name; end - - private - - # source://unparser//lib/unparser/emitter/assignment.rb#22 - def dispatch; end - - # source://unparser//lib/unparser/emitter/assignment.rb#27 - def emit_right; end -end - -# source://unparser//lib/unparser/emitter/assignment.rb#8 -Unparser::Emitter::Assignment::BINARY_OPERATOR = T.let(T.unsafe(nil), Array) - -# Constant assignment emitter -# -# source://unparser//lib/unparser/emitter/assignment.rb#57 -class Unparser::Emitter::Assignment::Constant < ::Unparser::Emitter::Assignment - private - - # source://unparser//lib/unparser/dsl.rb#18 - def base; end - - # source://unparser//lib/unparser/emitter/assignment.rb#65 - def emit_left; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Variable assignment emitter -# -# source://unparser//lib/unparser/emitter/assignment.rb#42 -class Unparser::Emitter::Assignment::Variable < ::Unparser::Emitter::Assignment - private - - # source://unparser//lib/unparser/emitter/assignment.rb#50 - def emit_left; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Emitter for begin nodes -# -# source://unparser//lib/unparser/emitter/begin.rb#7 -class Unparser::Emitter::Begin < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/begin.rb#11 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/begin.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Non send binary operator / keyword emitter -# -# source://unparser//lib/unparser/emitter/binary.rb#6 -class Unparser::Emitter::Binary < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/binary.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def writer(&block); end -end - -# Base class for and and or op-assign -# -# source://unparser//lib/unparser/emitter/op_assign.rb#7 -class Unparser::Emitter::BinaryAssign < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/op_assign.rb#17 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/op_assign.rb#24 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def expression; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# source://unparser//lib/unparser/emitter/op_assign.rb#10 -Unparser::Emitter::BinaryAssign::MAP = T.let(T.unsafe(nil), Hash) - -# Block emitter -# -# source://unparser//lib/unparser/emitter/block.rb#7 -class Unparser::Emitter::Block < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def arguments; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/block.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/emitter/block.rb#75 - def emit_block_arguments; end - - # source://unparser//lib/unparser/emitter/block.rb#67 - def emit_lambda_arguments; end - - # source://unparser//lib/unparser/emitter/block.rb#61 - def emit_send_target; end - - # source://unparser//lib/unparser/emitter/block.rb#49 - def emit_target; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/block.rb#24 - def need_do?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/block.rb#71 - def numblock?; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def target_writer(&block); end - - # source://unparser//lib/unparser/emitter/block.rb#36 - def write_close; end - - # source://unparser//lib/unparser/emitter/block.rb#28 - def write_open; end -end - -# Block pass node emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#123 -class Unparser::Emitter::BlockPass < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#130 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for toplevel constant reference nodes -# -# source://unparser//lib/unparser/emitter/cbase.rb#6 -class Unparser::Emitter::CBase < ::Unparser::Emitter - private - - # Perform dispatch - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/emitter/cbase.rb#17 - def dispatch; end -end - -# Emitter for case nodes -# -# source://unparser//lib/unparser/emitter/case.rb#6 -class Unparser::Emitter::Case < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/case.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/emitter/case.rb#35 - def emit_condition; end - - # source://unparser//lib/unparser/emitter/case.rb#22 - def emit_else; end - - # source://unparser//lib/unparser/emitter/case.rb#30 - def emit_whens; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def whens(&block); end -end - -# Emitter for case guards -# -# source://unparser//lib/unparser/emitter/case_guard.rb#6 -class Unparser::Emitter::CaseGuard < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/case_guard.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/case_guard.rb#10 -Unparser::Emitter::CaseGuard::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for case matches -# -# source://unparser//lib/unparser/emitter/case_match.rb#6 -class Unparser::Emitter::CaseMatch < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/case_match.rb#20 - def dispatch; end - - # source://unparser//lib/unparser/emitter/case_match.rb#16 - def else_branch; end - - # source://unparser//lib/unparser/emitter/case_match.rb#30 - def emit_else_branch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def patterns(&block); end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for class nodes -# -# source://unparser//lib/unparser/emitter/class.rb#6 -class Unparser::Emitter::Class < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/class.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/emitter/class.rb#23 - def emit_superclass; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def superclass; end -end - -# Emitter for constant access -# -# source://unparser//lib/unparser/emitter/variable.rb#21 -class Unparser::Emitter::Const < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/variable.rb#28 - def dispatch; end - - # source://unparser//lib/unparser/emitter/variable.rb#33 - def emit_scope; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def scope; end -end - -# Emitter for const pattern node -# -# source://unparser//lib/unparser/emitter/const_pattern.rb#6 -class Unparser::Emitter::ConstPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def const; end - - # source://unparser//lib/unparser/emitter/const_pattern.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Dynamic string emitter -# -# source://unparser//lib/unparser/emitter/dstr.rb#6 -class Unparser::Emitter::DStr < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/dstr.rb#10 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/dstr.rb#16 - def dispatch; end -end - -# Dynamic symbol literal emitter -# -# source://unparser//lib/unparser/emitter/dsym.rb#6 -class Unparser::Emitter::DSym < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/dsym.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/emitter/dsym.rb#34 - def emit_begin_child(component); end - - # source://unparser//lib/unparser/emitter/dsym.rb#24 - def emit_str_child(value); end -end - -# Emitter for def node -# -# source://unparser//lib/unparser/emitter/def.rb#6 -class Unparser::Emitter::Def < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - private - - # source://unparser//lib/unparser/abstract_type.rb#114 - def body(*_arg0); end - - # source://unparser//lib/unparser/emitter/def.rb#17 - def dispatch; end - - # source://unparser//lib/unparser/emitter/def.rb#25 - def emit_arguments; end - - # source://unparser//lib/unparser/abstract_type.rb#114 - def emit_name(*_arg0); end -end - -# Instance def emitter -# -# source://unparser//lib/unparser/emitter/def.rb#34 -class Unparser::Emitter::Def::Instance < ::Unparser::Emitter::Def - private - - # source://unparser//lib/unparser/dsl.rb#18 - def arguments; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/def.rb#41 - def emit_name; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for defines on singleton -# -# source://unparser//lib/unparser/emitter/def.rb#48 -class Unparser::Emitter::Def::Singleton < ::Unparser::Emitter::Def - private - - # source://unparser//lib/unparser/dsl.rb#18 - def arguments; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/def.rb#56 - def emit_name; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/def.rb#63 - def subject_without_parens?; end -end - -# Emitter for defined? nodes -# -# source://unparser//lib/unparser/emitter/defined.rb#6 -class Unparser::Emitter::Defined < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/defined.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/find_pattern.rb#6 -class Unparser::Emitter::FindPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/find_pattern.rb#11 - def dispatch; end -end - -# Emitter for flip flops -# -# source://unparser//lib/unparser/emitter/flipflop.rb#6 -class Unparser::Emitter::FlipFlop < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/flipflop.rb#17 - def symbol_name; end - - private - - # source://unparser//lib/unparser/emitter/flipflop.rb#27 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# source://unparser//lib/unparser/emitter/flipflop.rb#7 -Unparser::Emitter::FlipFlop::MAP = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/emitter/flipflop.rb#12 -Unparser::Emitter::FlipFlop::SYMBOLS = T.let(T.unsafe(nil), Hash) - -# Emiter for float literals -# -# source://unparser//lib/unparser/emitter/float.rb#6 -class Unparser::Emitter::Float < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/float.rb#16 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# source://unparser//lib/unparser/emitter/float.rb#11 -Unparser::Emitter::Float::INFINITY = T.let(T.unsafe(nil), Float) - -# source://unparser//lib/unparser/emitter/float.rb#12 -Unparser::Emitter::Float::NEG_INFINITY = T.let(T.unsafe(nil), Float) - -# Emitter control flow modifiers -# -# source://unparser//lib/unparser/emitter/flow_modifier.rb#6 -class Unparser::Emitter::FlowModifier < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/flow_modifier.rb#17 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/flow_modifier.rb#25 - def dispatch; end - - # source://unparser//lib/unparser/emitter/flow_modifier.rb#36 - def emit_arguments; end -end - -# source://unparser//lib/unparser/emitter/flow_modifier.rb#7 -Unparser::Emitter::FlowModifier::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for for nodes -# -# source://unparser//lib/unparser/emitter/for.rb#6 -class Unparser::Emitter::For < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def assignment; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/for.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/emitter/for.rb#20 - def emit_condition; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for forwarding arguments -# -# source://unparser//lib/unparser/emitter/argument.rb#6 -class Unparser::Emitter::ForwardArg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#20 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/argument.rb#7 -Unparser::Emitter::ForwardArg::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for Hash literals -# -# source://unparser//lib/unparser/emitter/hash.rb#6 -class Unparser::Emitter::Hash < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/hash.rb#9 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/hash.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/emitter/hash.rb#31 - def emit_hash_body; end - - # source://unparser//lib/unparser/emitter/hash.rb#27 - def emit_heredoc_reminder_member(node); end -end - -# Emitter for hash patterns -# -# source://unparser//lib/unparser/emitter/hash_pattern.rb#6 -class Unparser::Emitter::HashPattern < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/hash_pattern.rb#10 - def emit_const_pattern; end - - private - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#18 - def dispatch; end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#24 - def emit_hash_body; end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#41 - def emit_match_var(node); end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#28 - def emit_member(node); end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#46 - def emit_pair(node); end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#62 - def write_symbol_body(symbol); end -end - -# Base class for pre and postexe emitters -# -# source://unparser//lib/unparser/emitter/hookexe.rb#6 -class Unparser::Emitter::Hookexe < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/hookexe.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/hookexe.rb#8 -Unparser::Emitter::Hookexe::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter if nodes -# -# source://unparser//lib/unparser/emitter/if.rb#6 -class Unparser::Emitter::If < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/if.rb#11 - def emit_ternary; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/if.rb#21 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def else_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#59 - def emit_condition; end - - # source://unparser//lib/unparser/emitter/if.rb#71 - def emit_else_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#63 - def emit_if_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#43 - def emit_normal; end - - # source://unparser//lib/unparser/emitter/if.rb#37 - def emit_postcondition; end - - # source://unparser//lib/unparser/dsl.rb#18 - def if_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#55 - def keyword; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/if.rb#29 - def postcondition?; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/if.rb#51 - def unless?; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/in_match.rb#6 -class Unparser::Emitter::InMatch < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/in_match.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/in_pattern.rb#6 -class Unparser::Emitter::InPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def branch; end - - # source://unparser//lib/unparser/emitter/in_pattern.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def else_branch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end - - # source://unparser//lib/unparser/dsl.rb#18 - def unless_guard; end -end - -# Emitter for send to index references -# -# source://unparser//lib/unparser/emitter/index.rb#6 -class Unparser::Emitter::Index < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/index.rb#10 - def dispatch; end - - # source://unparser//lib/unparser/emitter/index.rb#15 - def emit_receiver; end -end - -# Emitter for assign to index nodes -# -# source://unparser//lib/unparser/emitter/index.rb#34 -class Unparser::Emitter::Index::Assign < ::Unparser::Emitter::Index - # source://unparser//lib/unparser/emitter/index.rb#47 - def dispatch; end - - # source://unparser//lib/unparser/emitter/index.rb#43 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/emitter/index.rb#54 - def emit_mlhs; end - - private - - # source://unparser//lib/unparser/emitter/index.rb#61 - def emit_operation(indices); end -end - -# source://unparser//lib/unparser/emitter/index.rb#39 -Unparser::Emitter::Index::Assign::NO_VALUE_PARENT = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/emitter/index.rb#38 -Unparser::Emitter::Index::Assign::VALUE_RANGE = T.let(T.unsafe(nil), Range) - -# source://unparser//lib/unparser/emitter/index.rb#19 -class Unparser::Emitter::Index::Reference < ::Unparser::Emitter::Index - private - - # source://unparser//lib/unparser/emitter/index.rb#26 - def emit_operation; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def indices(&block); end -end - -# Emitter for explicit begins -# -# source://unparser//lib/unparser/emitter/kwbegin.rb#6 -class Unparser::Emitter::KWBegin < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/kwbegin.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/emitter/kwbegin.rb#25 - def emit_multiple_body; end -end - -# Optional keyword argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#41 -class Unparser::Emitter::KeywordOptional < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#48 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Emitter for splats -# -# source://unparser//lib/unparser/emitter/splat.rb#6 -class Unparser::Emitter::KwSplat < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/splat.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end -end - -# Keyword argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#56 -class Unparser::Emitter::Kwarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#63 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/kwargs.rb#5 -class Unparser::Emitter::Kwargs < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/kwargs.rb#8 - def dispatch; end -end - -# Emitter for lambda nodes -# -# source://unparser//lib/unparser/emitter/lambda.rb#6 -class Unparser::Emitter::Lambda < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/lambda.rb#11 - def dispatch; end -end - -# source://unparser//lib/unparser/emitter.rb#20 -module Unparser::Emitter::LocalVariableRoot - # Return local variable root - # - # @api private - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser/emitter.rb#27 - def local_variable_scope; end - - class << self - # @private - # - # source://unparser//lib/unparser/emitter.rb#31 - def included(descendant); end - end -end - -# Emitter for multiple assignment nodes -# -# source://unparser//lib/unparser/emitter/masgn.rb#6 -class Unparser::Emitter::MASGN < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/masgn.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def source; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for multiple assignment left hand side -# -# source://unparser//lib/unparser/emitter/mlhs.rb#6 -class Unparser::Emitter::MLHS < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/mlhs.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/emitter/mlhs.rb#31 - def emit_many; end - - # source://unparser//lib/unparser/emitter/mlhs.rb#23 - def emit_one_child_mlhs; end -end - -# source://unparser//lib/unparser/emitter/mlhs.rb#9 -Unparser::Emitter::MLHS::NO_COMMA = T.let(T.unsafe(nil), Array) - -# Base class for special match node emitters -# -# source://unparser//lib/unparser/emitter/match.rb#7 -class Unparser::Emitter::Match < ::Unparser::Emitter; end - -# Emitter for match current line -# -# source://unparser//lib/unparser/emitter/match.rb#25 -class Unparser::Emitter::Match::CurrentLine < ::Unparser::Emitter::Match - private - - # source://unparser//lib/unparser/emitter/match.rb#32 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def regexp; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for match with local variable assignment -# -# source://unparser//lib/unparser/emitter/match.rb#9 -class Unparser::Emitter::Match::Lvasgn < ::Unparser::Emitter::Match - private - - # source://unparser//lib/unparser/emitter/match.rb#16 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def lvasgn; end - - # source://unparser//lib/unparser/dsl.rb#18 - def regexp; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_alt.rb#6 -class Unparser::Emitter::MatchAlt < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_alt.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_as.rb#6 -class Unparser::Emitter::MatchAs < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_as.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_pattern.rb#6 -class Unparser::Emitter::MatchPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_pattern.rb#23 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Modern ast format emits `match_pattern` -# node on single line pre 3.0, but 3.0+ uses `match_pattern_p` -# -# source://unparser//lib/unparser/emitter/match_pattern.rb#14 -Unparser::Emitter::MatchPattern::SYMBOL = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/emitter/match_pattern_p.rb#5 -class Unparser::Emitter::MatchPatternP < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_pattern_p.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emiter for match rest nodes -# -# source://unparser//lib/unparser/emitter/match_rest.rb#6 -class Unparser::Emitter::MatchRest < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/match_rest.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/emitter/match_rest.rb#16 - def emit_array_pattern; end - - # source://unparser//lib/unparser/emitter/match_rest.rb#21 - def emit_hash_pattern; end - - private - - # source://unparser//lib/unparser/emitter/match_rest.rb#28 - def emit_match_var; end - - # source://unparser//lib/unparser/dsl.rb#18 - def match_var; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_var.rb#6 -class Unparser::Emitter::MatchVar < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_var.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for module nodes -# -# source://unparser//lib/unparser/emitter/module.rb#6 -class Unparser::Emitter::Module < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/module.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter.rb#18 -Unparser::Emitter::NO_INDENT = T.let(T.unsafe(nil), Array) - -# Emitter for nth_ref nodes (regexp captures) -# -# source://unparser//lib/unparser/emitter/variable.rb#42 -class Unparser::Emitter::NthRef < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/variable.rb#50 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/variable.rb#43 -Unparser::Emitter::NthRef::PREFIX = T.let(T.unsafe(nil), String) - -# Emitter for op assign -# -# source://unparser//lib/unparser/emitter/op_assign.rb#33 -class Unparser::Emitter::OpAssign < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/op_assign.rb#40 - def dispatch; end - - # source://unparser//lib/unparser/emitter/op_assign.rb#46 - def emit_operator; end - - # source://unparser//lib/unparser/dsl.rb#18 - def operator; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Optional argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#27 -class Unparser::Emitter::Optarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#34 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Emitter for key value pairs in hash literals or kwargs -# -# source://unparser//lib/unparser/emitter/pair.rb#6 -class Unparser::Emitter::Pair < ::Unparser::Emitter - private - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/pair.rb#28 - def colon?(key); end - - # source://unparser//lib/unparser/emitter/pair.rb#17 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def key; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# source://unparser//lib/unparser/emitter/pair.rb#7 -Unparser::Emitter::Pair::BAREWORD = T.let(T.unsafe(nil), Regexp) - -# Emitter for pin nodes -# -# source://unparser//lib/unparser/emitter/pin.rb#6 -class Unparser::Emitter::Pin < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/pin.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for postconditions -# -# source://unparser//lib/unparser/emitter/repetition.rb#7 -class Unparser::Emitter::Post < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/repetition.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/repetition.rb#10 -Unparser::Emitter::Post::MAP = T.let(T.unsafe(nil), Hash) - -# Base class for primitive emitters -# -# source://unparser//lib/unparser/emitter/primitive.rb#6 -class Unparser::Emitter::Primitive < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Emitter for complex literals -# -# source://unparser//lib/unparser/emitter/primitive.rb#24 -class Unparser::Emitter::Primitive::Complex < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#39 - def dispatch; end - - # source://unparser//lib/unparser/emitter/primitive.rb#44 - def emit_imaginary; end - - # source://unparser//lib/unparser/emitter/primitive.rb#48 - def imaginary_node; end -end - -# source://unparser//lib/unparser/emitter/primitive.rb#30 -Unparser::Emitter::Primitive::Complex::MAP = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/emitter/primitive.rb#28 -Unparser::Emitter::Primitive::Complex::RATIONAL_FORMAT = T.let(T.unsafe(nil), String) - -# Emitter for primitives based on Object#inspect -# -# source://unparser//lib/unparser/emitter/primitive.rb#11 -class Unparser::Emitter::Primitive::Inspect < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#17 - def dispatch; end -end - -# Emiter for numeric literals -# -# source://unparser//lib/unparser/emitter/primitive.rb#80 -class Unparser::Emitter::Primitive::Numeric < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#86 - def dispatch; end -end - -# Emitter for rational literals -# -# source://unparser//lib/unparser/emitter/primitive.rb#56 -class Unparser::Emitter::Primitive::Rational < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#65 - def dispatch; end - - # source://unparser//lib/unparser/emitter/primitive.rb#73 - def write_rational(value); end -end - -# source://unparser//lib/unparser/emitter/primitive.rb#60 -Unparser::Emitter::Primitive::Rational::RATIONAL_FORMAT = T.let(T.unsafe(nil), String) - -# Progarg emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#98 -class Unparser::Emitter::Procarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#105 - def dispatch; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/argument.rb#115 - def needs_parens?; end -end - -# source://unparser//lib/unparser/emitter/argument.rb#101 -Unparser::Emitter::Procarg::PARENS = T.let(T.unsafe(nil), Array) - -# Registry for node emitters -# -# source://unparser//lib/unparser/emitter.rb#16 -Unparser::Emitter::REGISTRY = T.let(T.unsafe(nil), Hash) - -# Range emitters -# -# source://unparser//lib/unparser/emitter/range.rb#6 -class Unparser::Emitter::Range < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/range.rb#17 - def symbol_name; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def begin_node; end - - # source://unparser//lib/unparser/emitter/range.rb#27 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def end_node; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/range.rb#12 -Unparser::Emitter::Range::SYMBOLS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/emitter/range.rb#7 -Unparser::Emitter::Range::TOKENS = T.let(T.unsafe(nil), Hash) - -# Emitter for regexp literals -# -# source://unparser//lib/unparser/emitter/regexp.rb#6 -class Unparser::Emitter::Regexp < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def body(&block); end - - # source://unparser//lib/unparser/emitter/regexp.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/emitter/regexp.rb#24 - def emit_body(node); end - - # source://unparser//lib/unparser/emitter/regexp.rb#20 - def emit_options; end -end - -# Emitter for while and until nodes -# -# source://unparser//lib/unparser/emitter/repetition.rb#27 -class Unparser::Emitter::Repetition < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/repetition.rb#39 - def dispatch; end - - # source://unparser//lib/unparser/emitter/repetition.rb#51 - def emit_keyword; end - - # source://unparser//lib/unparser/emitter/repetition.rb#55 - def emit_normal; end - - # source://unparser//lib/unparser/emitter/repetition.rb#66 - def emit_postcontrol; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/repetition.rb#47 - def postcontrol?; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/repetition.rb#28 -Unparser::Emitter::Repetition::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for rescue nodes -# -# source://unparser//lib/unparser/emitter/rescue.rb#6 -class Unparser::Emitter::Rescue < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/rescue.rb#11 - def dispatch; end -end - -# Rest argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#70 -class Unparser::Emitter::Restarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#77 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Root emitter a special case -# -# source://unparser//lib/unparser/emitter/root.rb#6 -class Unparser::Emitter::Root < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/concord.rb#60 - def buffer; end - - # source://unparser//lib/unparser/concord.rb#60 - def comments; end - - # source://unparser//lib/unparser/emitter/root.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - # source://unparser//lib/unparser/concord.rb#60 - def node; end -end - -# source://unparser//lib/unparser/emitter/root.rb#10 -Unparser::Emitter::Root::END_NL = T.let(T.unsafe(nil), Array) - -# Emitter for sclass nodes -# -# source://unparser//lib/unparser/emitter/class.rb#33 -class Unparser::Emitter::SClass < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/class.rb#40 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def object; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for send -# -# source://unparser//lib/unparser/emitter/send.rb#6 -class Unparser::Emitter::Send < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/send.rb#13 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/emitter/send.rb#9 - def emit_mlhs; end - - private - - # source://unparser//lib/unparser/emitter/send.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def writer(&block); end -end - -# Emitter for simple nodes that generate a single token -# -# source://unparser//lib/unparser/emitter/simple.rb#6 -class Unparser::Emitter::Simple < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/simple.rb#28 - def dispatch; end -end - -# source://unparser//lib/unparser/emitter/simple.rb#7 -Unparser::Emitter::Simple::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for splats -# -# source://unparser//lib/unparser/emitter/splat.rb#20 -class Unparser::Emitter::Splat < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/splat.rb#25 - def emit_mlhs; end - - private - - # source://unparser//lib/unparser/emitter/splat.rb#32 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def subject_emitter(&block); end -end - -# Emitter for super nodes -# -# source://unparser//lib/unparser/emitter/super.rb#7 -class Unparser::Emitter::Super < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/super.rb#12 - def dispatch; end -end - -# Emitter for undef nodes -# -# source://unparser//lib/unparser/emitter/undef.rb#6 -class Unparser::Emitter::Undef < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/undef.rb#11 - def dispatch; end -end - -# Emitter for various variable accesses -# -# source://unparser//lib/unparser/emitter/variable.rb#7 -class Unparser::Emitter::Variable < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/variable.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for when nodes -# -# source://unparser//lib/unparser/emitter/case.rb#44 -class Unparser::Emitter::When < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def captures(&block); end - - # source://unparser//lib/unparser/emitter/case.rb#51 - def dispatch; end - - # source://unparser//lib/unparser/emitter/case.rb#57 - def emit_captures; end -end - -# Dynamic execute string literal emitter -# -# source://unparser//lib/unparser/emitter/xstr.rb#6 -class Unparser::Emitter::XStr < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/xstr.rb#12 - def dispatch; end - - # source://unparser//lib/unparser/emitter/xstr.rb#65 - def emit_begin(component); end - - # source://unparser//lib/unparser/emitter/xstr.rb#24 - def emit_heredoc; end - - # source://unparser//lib/unparser/emitter/xstr.rb#51 - def emit_string(value); end - - # source://unparser//lib/unparser/emitter/xstr.rb#39 - def emit_xstr; end - - # source://unparser//lib/unparser/emitter/xstr.rb#55 - def escape_xstr(input); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/xstr.rb#20 - def heredoc?; end -end - -# Emitter for yield node -# -# source://unparser//lib/unparser/emitter/yield.rb#7 -class Unparser::Emitter::Yield < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/yield.rb#12 - def dispatch; end -end - -# Define equality, equivalence and inspection methods -# -# Original code before vendoring and reduction from: https://github.com/dkubb/equalizer. -# -# source://unparser//lib/unparser/equalizer.rb#7 -class Unparser::Equalizer < ::Module - # Initialize an Equalizer with the given keys - # - # Will use the keys with which it is initialized to define #cmp?, - # #hash, and #inspect - # - # - # @api private - # @param keys [Array] - # @return [undefined] - # - # source://unparser//lib/unparser/equalizer.rb#20 - def initialize(*keys); end - - private - - # source://unparser//lib/unparser/equalizer.rb#39 - def define_cmp_method; end - - # source://unparser//lib/unparser/equalizer.rb#49 - def define_hash_method; end - - # source://unparser//lib/unparser/equalizer.rb#56 - def define_inspect_method; end - - # source://unparser//lib/unparser/equalizer.rb#33 - def define_methods; end - - # source://unparser//lib/unparser/equalizer.rb#29 - def included(descendant); end -end - -# The comparison methods -# -# source://unparser//lib/unparser/equalizer.rb#66 -module Unparser::Equalizer::Methods - # Compare the object with other object for equivalency - # - # @api public - # @example - # object == other # => true or false - # @param other [Object] the other object to compare with - # @return [Boolean] - # - # source://unparser//lib/unparser/equalizer.rb#93 - def ==(other); end - - # Compare the object with other object for equality - # - # @api public - # @example - # object.eql?(other) # => true or false - # @param other [Object] the other object to compare with - # @return [Boolean] - # - # source://unparser//lib/unparser/equalizer.rb#78 - def eql?(other); end -end - -# source://unparser//lib/unparser/generation.rb#5 -module Unparser::Generation - # source://unparser//lib/unparser/generation.rb#10 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/generation.rb#12 - def symbol_name; end - - # source://unparser//lib/unparser/generation.rb#14 - def write_to_buffer; end - - private - - # source://unparser//lib/unparser/generation.rb#247 - def children; end - - # source://unparser//lib/unparser/generation.rb#239 - def conditional_parentheses(flag, &block); end - - # source://unparser//lib/unparser/generation.rb#21 - def delimited(nodes, delimiter = T.unsafe(nil), &block); end - - # source://unparser//lib/unparser/generation.rb#123 - def emit_body(node, indent: T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#196 - def emit_body_ensure_rescue(node); end - - # source://unparser//lib/unparser/generation.rb#145 - def emit_body_inner(node); end - - # source://unparser//lib/unparser/generation.rb#158 - def emit_body_member(node); end - - # source://unparser//lib/unparser/generation.rb#180 - def emit_body_rescue(node); end - - # source://unparser//lib/unparser/generation.rb#77 - def emit_comments(comments); end - - # source://unparser//lib/unparser/generation.rb#69 - def emit_comments_before(source_part = T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#166 - def emit_ensure(node); end - - # source://unparser//lib/unparser/generation.rb#60 - def emit_eof_comments; end - - # source://unparser//lib/unparser/generation.rb#54 - def emit_eol_comments; end - - # source://unparser//lib/unparser/generation.rb#27 - def emit_join(nodes, emit_node, emit_delimiter); end - - # source://unparser//lib/unparser/generation.rb#115 - def emit_optional_body(node, indent: T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#188 - def emit_optional_body_ensure_rescue(node); end - - # source://unparser//lib/unparser/generation.rb#206 - def emit_rescue_postcontrol(node); end - - # source://unparser//lib/unparser/generation.rb#212 - def emit_rescue_regular(node); end - - # source://unparser//lib/unparser/generation.rb#220 - def emitter(node); end - - # source://unparser//lib/unparser/generation.rb#235 - def first_child; end - - # source://unparser//lib/unparser/generation.rb#106 - def indented; end - - # source://unparser//lib/unparser/generation.rb#93 - def k_end; end - - # source://unparser//lib/unparser/generation.rb#39 - def nl; end - - # source://unparser//lib/unparser/generation.rb#100 - def parentheses(open = T.unsafe(nil), close = T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#224 - def visit(node); end - - # source://unparser//lib/unparser/generation.rb#228 - def visit_deep(node); end - - # source://unparser//lib/unparser/generation.rb#44 - def with_comments; end - - # source://unparser//lib/unparser/generation.rb#89 - def write(*strings); end - - # source://unparser//lib/unparser/generation.rb#216 - def writer_with(klass, node); end - - # source://unparser//lib/unparser/generation.rb#50 - def ws; end -end - -# source://unparser//lib/unparser/generation.rb#6 -Unparser::Generation::EXTRA_NL = T.let(T.unsafe(nil), Array) - -# Error raised when unparser encounters an invalid AST -# -# source://unparser//lib/unparser.rb#39 -class Unparser::InvalidNodeError < ::RuntimeError - # @return [InvalidNodeError] a new instance of InvalidNodeError - # - # source://unparser//lib/unparser.rb#42 - def initialize(message, node); end - - # Returns the value of attribute node. - # - # source://unparser//lib/unparser.rb#40 - def node; end -end - -# source://unparser//lib/unparser/node_details.rb#4 -module Unparser::NodeDetails - include ::Unparser::NodeHelpers - include ::Unparser::Constants - - private - - # source://unparser//lib/unparser/node_details.rb#17 - def children; end - - class << self - # @private - # - # source://unparser//lib/unparser/node_details.rb#7 - def included(descendant); end - end -end - -# source://unparser//lib/unparser/node_details/send.rb#5 -class Unparser::NodeDetails::Send - include ::Unparser::NodeHelpers - include ::Unparser::Constants - include ::Unparser::NodeDetails - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def arguments(&block); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#37 - def arguments?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def assignment?(&block); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#33 - def assignment_operator?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#21 - def binary_syntax_allowed?; end - - # source://unparser//lib/unparser/node_details/send.rb#41 - def non_assignment_selector; end - - # source://unparser//lib/unparser/dsl.rb#18 - def receiver; end - - # source://unparser//lib/unparser/dsl.rb#18 - def selector; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#17 - def selector_binary_operator?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#29 - def selector_unary_operator?; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def string_selector(&block); end - - private - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/node_details/send.rb#8 -Unparser::NodeDetails::Send::ASSIGN_SUFFIX = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/node_details/send.rb#9 -Unparser::NodeDetails::Send::NON_ASSIGN_RANGE = T.let(T.unsafe(nil), Range) - -# source://unparser//lib/unparser/node_helpers.rb#4 -module Unparser::NodeHelpers - # Helper for building nodes - # - # @api private - # @param type [Symbol] - # @param children [Array] - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser/node_helpers.rb#26 - def n(type, children = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_helpers.rb#30 - def n?(type, node); end - - # Helper for building nodes - # - # @api private - # @param type [Symbol] - # @param children [Parser::AST::Node] - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser/node_helpers.rb#14 - def s(type, *children); end - - # source://unparser//lib/unparser/node_helpers.rb#71 - def unwrap_single_begin(node); end - - private - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_arg?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_args?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_array?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_array_pattern?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_begin?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_block?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_cbase?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_const?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_dstr?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_empty_else?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_ensure?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_hash?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_hash_pattern?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_if?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_in_pattern?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_int?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_kwarg?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_kwargs?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_kwsplat?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_lambda?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_match_rest?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_pair?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_rescue?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_send?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_shadowarg?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_splat?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_str?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_sym?(node); end -end - -# source://unparser//lib/unparser/either.rb#4 -module Unparser::RequireBlock - private - - # Raise error unless block is provided - # - # @raise [MissingBlockError] if no block is given - # @return [self] - # - # source://unparser//lib/unparser/either.rb#14 - def require_block; end -end - -# source://unparser//lib/unparser/emitter.rb#4 -class Unparser::UnknownNodeError < ::ArgumentError; end - -# Validation of unparser results -# -# source://unparser//lib/unparser/validation.rb#5 -class Unparser::Validation - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # source://unparser//lib/unparser/anima.rb#146 - def generated_node; end - - # source://unparser//lib/unparser/anima.rb#146 - def generated_source; end - - # source://unparser//lib/unparser/anima.rb#146 - def identification; end - - # source://unparser//lib/unparser/anima.rb#146 - def original_node; end - - # source://unparser//lib/unparser/anima.rb#146 - def original_source; end - - # Return error report - # - # @api private - # @return [String] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def report(&block); end - - # Test if source could be unparsed successfully - # - # - # @api private - # @return [Boolean] - # - # source://unparser//lib/unparser/validation.rb#21 - def success?; end - - private - - # source://unparser//lib/unparser/validation.rb#108 - def make_report(label, attribute_name); end - - # source://unparser//lib/unparser/validation.rb#120 - def node_diff_report; end - - # source://unparser//lib/unparser/validation.rb#112 - def report_exception(exception); end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - - # Create validator from node - # - # @param original_node [Parser::AST::Node] - # @return [Validator] - # - # source://unparser//lib/unparser/validation.rb#81 - def from_node(original_node); end - - # Create validator from file - # - # @param path [Pathname] - # @return [Validator] - # - # source://unparser//lib/unparser/validation.rb#102 - def from_path(path); end - - # Create validator from string - # - # @param original_source [String] - # @return [Validator] - # - # source://unparser//lib/unparser/validation.rb#55 - def from_string(original_source); end - - private - - # source://unparser//lib/unparser/validation.rb#135 - def const_unit(_value); end - end -end - -# source://unparser//lib/unparser/validation.rb#138 -class Unparser::Validation::Literal < ::Unparser::Validation - # source://unparser//lib/unparser/validation.rb#143 - def report; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/validation.rb#139 - def success?; end - - private - - # source://unparser//lib/unparser/validation.rb#158 - def source_diff_report; end -end - -# source://unparser//lib/unparser/writer.rb#4 -module Unparser::Writer - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - - mixes_in_class_methods ::Unparser::DSL - - class << self - # @private - # - # source://unparser//lib/unparser/writer.rb#7 - def included(descendant); end - end -end - -# source://unparser//lib/unparser/writer/binary.rb#5 -class Unparser::Writer::Binary - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/binary.rb#54 - def dispatch; end - - # source://unparser//lib/unparser/writer/binary.rb#46 - def emit_operator; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - # source://unparser//lib/unparser/writer/binary.rb#50 - def symbol_name; end - - private - - # source://unparser//lib/unparser/writer/binary.rb#62 - def effective_symbol; end - - # source://unparser//lib/unparser/writer/binary.rb#74 - def emit_with(map); end - - # source://unparser//lib/unparser/writer/binary.rb#80 - def keyword_symbol; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def left_emitter(&block); end - - # source://unparser//lib/unparser/writer/binary.rb#84 - def operator_symbol; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def right_emitter(&block); end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# source://unparser//lib/unparser/writer/binary.rb#22 -Unparser::Writer::Binary::KEYWORD_SYMBOLS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#16 -Unparser::Writer::Binary::KEYWORD_TOKENS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#34 -Unparser::Writer::Binary::MAP = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#42 -Unparser::Writer::Binary::NEED_KEYWORD = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser/writer/binary.rb#28 -Unparser::Writer::Binary::OPERATOR_SYMBOLS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#10 -Unparser::Writer::Binary::OPERATOR_TOKENS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/dynamic_string.rb#5 -class Unparser::Writer::DynamicString - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#32 - def dispatch; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#25 - def emit_heredoc_reminder; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#159 - def breakpoint?(child, current); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#63 - def classify(node); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#71 - def classify_str(node); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#193 - def emit_body(children); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#149 - def emit_dstr; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#132 - def emit_dynamic(child); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#145 - def emit_dynamic_component(node); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#54 - def emit_heredoc_body; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#59 - def emit_heredoc_footer; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#50 - def emit_heredoc_header; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#116 - def emit_normal_heredoc_body; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#185 - def emit_segment(children, index); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#128 - def escape_dynamic(string); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#46 - def heredoc?; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#42 - def heredoc_header; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#95 - def heredoc_pattern?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#105 - def heredoc_pattern_2?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#99 - def heredoc_pattern_3?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#111 - def nl_last_child?; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#169 - def segments; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#87 - def str_empty?(node); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#83 - def str_nl?(node); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#91 - def str_ws?(node); end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# source://unparser//lib/unparser/writer/dynamic_string.rb#21 -Unparser::Writer::DynamicString::FLAT_INTERPOLATION = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/writer/dynamic_string.rb#8 -Unparser::Writer::DynamicString::PATTERNS_2 = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser/writer/dynamic_string.rb#14 -Unparser::Writer::DynamicString::PATTERNS_3 = T.let(T.unsafe(nil), Array) - -# Writer for rescue bodies -# -# source://unparser//lib/unparser/writer/resbody.rb#6 -class Unparser::Writer::Resbody - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/resbody.rb#11 - def emit_postcontrol; end - - # source://unparser//lib/unparser/writer/resbody.rb#16 - def emit_regular; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def assignment; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/writer/resbody.rb#32 - def emit_assignment; end - - # source://unparser//lib/unparser/writer/resbody.rb#25 - def emit_exception; end - - # source://unparser//lib/unparser/dsl.rb#18 - def exception; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# source://unparser//lib/unparser/writer/rescue.rb#5 -class Unparser::Writer::Rescue - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/rescue.rb#23 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/writer/rescue.rb#27 - def emit_postcontrol; end - - # source://unparser//lib/unparser/writer/rescue.rb#12 - def emit_regular; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/writer/rescue.rb#34 - def else_node; end - - # source://unparser//lib/unparser/writer/rescue.rb#38 - def emit_rescue_body(node); end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def rescue_bodies(&block); end - - # source://unparser//lib/unparser/dsl.rb#18 - def rescue_body; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# Writer for send -# -# source://unparser//lib/unparser/writer/send.rb#6 -class Unparser::Writer::Send - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Constants - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/send.rb#21 - def dispatch; end - - # source://unparser//lib/unparser/writer/send.rb#33 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/writer/send.rb#25 - def emit_mlhs; end - - # source://unparser//lib/unparser/writer/send.rb#29 - def emit_selector; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # source://unparser//lib/unparser/writer/send.rb#73 - def arguments; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#85 - def avoid_clash?; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def details(&block); end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def effective_writer(&block); end - - # source://unparser//lib/unparser/writer/send.rb#45 - def effective_writer_class; end - - # source://unparser//lib/unparser/writer/send.rb#65 - def emit_arguments; end - - # source://unparser//lib/unparser/writer/send.rb#81 - def emit_heredoc_reminder(argument); end - - # source://unparser//lib/unparser/writer/send.rb#77 - def emit_normal_arguments; end - - # source://unparser//lib/unparser/writer/send.rb#61 - def emit_operator; end - - # source://unparser//lib/unparser/writer/send.rb#106 - def emit_send_regular(node); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#89 - def local_variable_clash?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#93 - def parses_as_constant?; end - - # source://unparser//lib/unparser/dsl.rb#18 - def receiver; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def selector; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#57 - def write_as_attribute_assignment?; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# Writer for send as attribute assignment -# -# source://unparser//lib/unparser/writer/send/attribute_assignment.rb#7 -class Unparser::Writer::Send::AttributeAssignment < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#10 - def dispatch; end - - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#22 - def emit_send_mlhs; end - - private - - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#34 - def emit_attribute; end - - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#29 - def emit_receiver; end - - # source://unparser//lib/unparser/dsl.rb#18 - def first_argument; end - - # source://unparser//lib/unparser/dsl.rb#18 - def receiver; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def selector; end -end - -# Writer for binary sends -# -# source://unparser//lib/unparser/writer/send/binary.rb#7 -class Unparser::Writer::Send::Binary < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/binary.rb#8 - def dispatch; end - - private - - # source://unparser//lib/unparser/writer/send/binary.rb#16 - def emit_operator; end - - # source://unparser//lib/unparser/writer/send/binary.rb#20 - def emit_right; end -end - -# source://unparser//lib/unparser/writer/send.rb#9 -Unparser::Writer::Send::INDEX_ASSIGN = T.let(T.unsafe(nil), Symbol) - -# source://unparser//lib/unparser/writer/send.rb#10 -Unparser::Writer::Send::INDEX_REFERENCE = T.let(T.unsafe(nil), Symbol) - -# source://unparser//lib/unparser/writer/send.rb#12 -Unparser::Writer::Send::OPERATORS = T.let(T.unsafe(nil), Hash) - -# Writer for "regular" receiver.selector(arguments...) case -# -# source://unparser//lib/unparser/writer/send/regular.rb#7 -class Unparser::Writer::Send::Regular < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/regular.rb#8 - def dispatch; end - - # source://unparser//lib/unparser/writer/send/regular.rb#18 - def emit_arguments_without_heredoc_body; end - - # source://unparser//lib/unparser/writer/send/regular.rb#22 - def emit_receiver; end - - # source://unparser//lib/unparser/writer/send/regular.rb#14 - def emit_send_mlhs; end -end - -# Writer for unary sends -# -# source://unparser//lib/unparser/writer/send/unary.rb#7 -class Unparser::Writer::Send::Unary < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/unary.rb#15 - def dispatch; end -end - -# source://unparser//lib/unparser/writer/send/unary.rb#8 -Unparser::Writer::Send::Unary::MAP = T.let(T.unsafe(nil), Hash) diff --git a/spec/ruby_lsp_rspec_spec.rb b/spec/ruby_lsp_rspec_spec.rb index 090d4f3..9688b85 100644 --- a/spec/ruby_lsp_rspec_spec.rb +++ b/spec/ruby_lsp_rspec_spec.rb @@ -75,6 +75,35 @@ end end + it "recognizes different it declaration" do + store.set(uri: uri, source: <<~RUBY, version: 1) + RSpec.describe Foo do + it { do_something } + it var do + do_something + end + end + RUBY + + response = RubyLsp::Executor.new(store, message_queue).execute( + { + method: "textDocument/codeLens", + params: { + textDocument: { uri: uri }, + position: { line: 0, character: 0 }, + }, + }, + ) + + expect(response.error).to(be_nil) + + response = response.response + expect(response.count).to eq(9) + + expect(response[3].command.arguments[1]).to eq("") + expect(response[6].command.arguments[1]).to eq("") + end + it "recognizes different describe declaration" do store.set(uri: uri, source: <<~RUBY, version: 1) RSpec.describe(Foo::Bar) do @@ -88,6 +117,12 @@ describe Foo do end + + describe "Foo" do + end + + describe var do + end RUBY response = RubyLsp::Executor.new(store, message_queue).execute( @@ -103,7 +138,11 @@ expect(response.error).to(be_nil) response = response.response - expect(response.count).to eq(12) + expect(response.count).to eq(18) + + expect(response[11].command.arguments[1]).to eq("Foo") + expect(response[13].command.arguments[1]).to eq("Foo") + expect(response[15].command.arguments[1]).to eq("") end context "when there's a binstub" do