Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to Modify Existing Completion Rules? #44

Open
sshaw opened this issue Jan 21, 2018 · 0 comments
Open

Possible to Modify Existing Completion Rules? #44

sshaw opened this issue Jan 21, 2018 · 0 comments

Comments

@sshaw
Copy link

sshaw commented Jan 21, 2018

Hi, thanks for this great library.

In my .irbrc I add the #r method which allows me to quickly require:

irb [2.4.0] (tmp)$ r:time
=> true
irb [2.4.0] (tmp)$ r"net/http"
=> true

I can reuse Bond's require completion, when using a string argno problem:

Bond.complete(:method => "r", :action => "require")

But, how can I reuse this to complete Symbol arguments?

I've tried:

complete(:on => /\Ar:?/, :search => false, :action => "require")

But that does not complete like require's and r "<TAB> results in an exception:

irb [2.4.0] (tmp)$ r"ne/Users/sshaw/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- r"ne (LoadError)
	from /Users/sshaw/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/sshaw/.rvm/gems/ruby-2.4.0/gems/bond-0.5.1/lib/bond/mission.rb:96:in `call_action'
	from /Users/sshaw/.rvm/gems/ruby-2.4.0/gems/bond-0.5.1/lib/bond/mission.rb:73:in `execute'
	from /Users/sshaw/.rvm/gems/ruby-2.4.0/gems/bond-0.5.1/lib/bond/agent.rb:46:in `call'
	from /Users/sshaw/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/input-method.rb:151:in `readline'
<snip trace>

Is doing this possible without having to rewrite the completion rule?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant