Code Completion for Watir::Browser not working

Hi,

First time RubyMine and Ruby user and I have a question about code completion. I have created a project to play with Watir, installed the gem, initialized a bundle and I can see watir and other libs in the "External Libraries" folder/section. However I do not get code completion suggestions for the Watir::Browser class when I do this:

@browser = Watir::Browser.new
@brower.CTRL+SPACE


Basically I expect to see members I can find in the Watir documentation such as "goto" or "close", but they are not listed.

Is this a bug or limitation of RubyMine/Ruby or am I missing something out?

3 comments
Comment actions Permalink

I think I've just answered my own question by looking at the source code. The members I listed are not part of the Browser class. Gotta love dynamic languages.


  module Browser
    @@browser_classes = {}
    @@sub_options = {}
    @@default = nil
    class << self

      # Create a new instance of a browser driver, as determined by the
      # configuration settings. (Don't be fooled: this is not actually
      # an instance of Browser class.)
      def new
        set_sub_options
        klass.new
      end

0
Comment actions Permalink

Hi,

I think your answer is right

0
Comment actions Permalink

OK, but IS there any way to get it working (the code completion)?

0

Please sign in to leave a comment.