Skip to content

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

@dgutov

Description

@dgutov

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"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions