From 9871294ac9458fab1269e4139a26c388b55b2a3d Mon Sep 17 00:00:00 2001 From: ksss Date: Sat, 26 Sep 2026 23:59:28 +0900 Subject: [PATCH 1/2] Add `RuboCop::AST::ProcessedSource#[]` --- gems/rubocop-ast/1.46/rubocop-ast.rbs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gems/rubocop-ast/1.46/rubocop-ast.rbs b/gems/rubocop-ast/1.46/rubocop-ast.rbs index 9a170ecbd..2fddb8c64 100644 --- a/gems/rubocop-ast/1.46/rubocop-ast.rbs +++ b/gems/rubocop-ast/1.46/rubocop-ast.rbs @@ -11,6 +11,9 @@ module RuboCop def raw_source: () -> String def buffer: () -> Parser::Source::Buffer def comments: () -> Array[Parser::Source::Comment] + def []: (Integer index) -> String? + | (Integer start, Integer length) -> Array[String]? + | (Range[Integer] range) -> Array[String]? end class NodePattern From 3ab4b2a058ece22e75edbd9791f889a75ad4165a Mon Sep 17 00:00:00 2001 From: ksss Date: Sat, 26 Sep 2026 23:59:58 +0900 Subject: [PATCH 2/2] Add `RuboCop::Cop::Util#comment_line?` --- gems/rubocop/1.57/rubocop.rbs | 1 + 1 file changed, 1 insertion(+) diff --git a/gems/rubocop/1.57/rubocop.rbs b/gems/rubocop/1.57/rubocop.rbs index 83e1140a8..df8907306 100644 --- a/gems/rubocop/1.57/rubocop.rbs +++ b/gems/rubocop/1.57/rubocop.rbs @@ -154,6 +154,7 @@ module RuboCop def line: ((RuboCop::AST::Node | Parser::Source::Range) node_or_range) -> Integer def same_line?: ((RuboCop::AST::Node | Parser::Source::Range) node1, (RuboCop::AST::Node | Parser::Source::Range) node2) -> bool def indent: (RuboCop::AST::Node node, ?offset: Integer) -> String + def comment_line?: (String line_source) -> bool end end