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

Support showing documentation (at least with IRB 1.4+) #177

Open
dgutov opened this issue Sep 29, 2023 · 0 comments
Open

Support showing documentation (at least with IRB 1.4+) #177

dgutov opened this issue Sep 29, 2023 · 0 comments

Comments

@dgutov
Copy link
Collaborator

dgutov commented Sep 29, 2023

IRB has auto-completion popup now (in the terminal), which while receiving mixed feedback (ruby/irb#445), can show documentation:

image

It shouldn't be too difficult to reuse this here, adding a :company-doc-buffer handler to inf-ruby-completion-at-point.

irb(main):050> IRB::InputCompletor.retrieve_completion_data('1.times', bind: binding, doc_namespace: true)
=> "Integer.times"
irb(main):051> RDoc::RI::Driver.new.display_names(['Integer.times'])
= Integer.times

(from ruby core)
------------------------------------------------------------------------
  int.times {|i| block }  ->  self
  int.times               ->  an_enumerator

------------------------------------------------------------------------

Iterates the given block int times, passing in values from zero to int -
1.

If no block is given, an Enumerator is returned instead.

  5.times {|i| print i, " " }   #=> 0 1 2 3 4


=> ["Integer.times"]
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