From 665b0b44ce4150202ff591f951108a47e87bfe83 Mon Sep 17 00:00:00 2001 From: Oskar Eichler Date: Fri, 28 Aug 2026 02:15:02 +0300 Subject: [PATCH 1/2] Recognize incomplete Prism command-string delimiters --- lib/method_source/code_helpers.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/method_source/code_helpers.rb b/lib/method_source/code_helpers.rb index 4185c18..211e123 100644 --- a/lib/method_source/code_helpers.rb +++ b/lib/method_source/code_helpers.rb @@ -127,6 +127,7 @@ module IncompleteExpression /embedded document meets end of file/, # =begin /unterminated (quoted string|string|regexp|list) meets end of file/, # "quoted string" is ironruby /can't find string ".*" anywhere before EOF/, # rbx and jruby + /expected a closing delimiter for the `%x` or backtick string/, # prism /missing 'end' for/, /expecting kWHEN/ # rbx ] From e5213f1a26ef3ec92f16f3c97b6b1297bfba229e Mon Sep 17 00:00:00 2001 From: Oskar Eichler <62393985+OskarEichler@users.noreply.github.com> Date: Fri, 28 Aug 2026 15:35:02 +0300 Subject: [PATCH 2/2] Add regression coverage for recognize incomplete prism command-string delimiters --- spec/method_source/code_helpers_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/method_source/code_helpers_spec.rb b/spec/method_source/code_helpers_spec.rb index 287ff89..e6115c2 100644 --- a/spec/method_source/code_helpers_spec.rb +++ b/spec/method_source/code_helpers_spec.rb @@ -5,6 +5,11 @@ @tester = Object.new.extend(MethodSource::CodeHelpers) end + it "recognizes incomplete command-string delimiters" do + expect(@tester.complete_expression?("%x[word")).to be_falsy + expect(@tester.complete_expression?("`word")).to be_falsy + end + [ ["p = '", "'"], ["def", "a", "(); end"],