Repository navigation
Conversation
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VpVYsAE2Eb17FkqeVd1gKE
Contributor
Author
|
(One failed test looks not attributable to this patch) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
I'm working on running IRB on https://github.com/hasumikin/fluxpinel (an implementation of Ruby without the C extensions of CRuby). On Fluxpinel, rdoc loads, but
rbs, which rdoc 8.1 requires when it creates the ri driver, needs a C extension and does not load.The problem in the current IRB
The current
RelineInputMethod#rdoc_ri_driverrescues only theLoadErrorofrequire 'rdoc', and onLoadErrorit goes without documentation. ButRDoc::RI::Driver.newrequires the rest of rdoc, and rdoc 8.1 requiresrbson the path ofRDoc::RI::Driver.new. ALoadErrorraised inRDoc::RI::Driver.newis not rescued, and the moment the completion dialog opens, theLoadErrorgoes up past Reline and the session ends.The modified IRB
The
rescue LoadErrorcoversRDoc::RI::Driver.newtoo. When the library is missing, there is no documentation, that is, the same handling as when rdoc itself is missing.With the modified IRB too, the behavior for existing users (environments on CRuby or JRuby where rdoc and rbs are both present) does not change. Unless a
LoadErroris raised, the modifiedrescueis not taken.Test
In an environment where
rbsdoes not load, the modified IRB shows candidates in the completion dialog, shows no documentation, and IRB goes on. In an environment where everything is present, nothing changes.