From 60d1ffe461637164ab701b7cf753761b44276c5f Mon Sep 17 00:00:00 2001 From: HASUMI Hitoshi Date: Fri, 6 Nov 2026 17:31:32 +0900 Subject: [PATCH] Rescue the LoadError of the ri driver, not only of require 'rdoc' rdoc_ri_driver rescued the LoadError of `require 'rdoc'` only. RDoc::RI::Driver.new requires more of rdoc, and rdoc 8.1 requires rbs there; with a library that is not there, the completion dialog raised LoadError out of Reline instead of showing no document. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01VpVYsAE2Eb17FkqeVd1gKE --- lib/irb/input-method.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index 10758cc83..5ee42c101 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -333,12 +333,13 @@ def rdoc_ri_driver begin require 'rdoc' - rescue LoadError - @rdoc_ri_driver = nil - else options = {} options[:extra_doc_dirs] = IRB.conf[:EXTRA_DOC_DIRS] unless IRB.conf[:EXTRA_DOC_DIRS].empty? + # RDoc::RI::Driver.new requires more of rdoc (rdoc 8.1 requires rbs); + # a library that is not there means no document, not an error @rdoc_ri_driver = RDoc::RI::Driver.new(options) + rescue LoadError + @rdoc_ri_driver = nil end end