Can I make RubyMine autocomplete auto generated methods?

I'm in the process of writing a gem for interacting with an external system's SOAP interface to get object info via XML and convert it into ruby objects. I'm using a gem called roxml for the XML<->object conversions. The writer of that gem defined class methods for xml_accessor, xml_reader and xml_writer, which work the same way as the normal attr_accessor etc for causing relevant getter and setter methods to be available but have additional information about the attribute as it should appear in the XML. However (understandably) RubyMine doesn't know what xml_accessor etc mean. I've now got to the point where i'm wanting to use the gem in a rails project to push and pull information from the rails project database to the external system. I'm working on the rails project with another 2 developers (one of whom also uses RubyMine, the other of whom uses IntelliJ with the ruby plugin).

As things stand at the moment, I keep having to refer back to my gem code to remember what attributes are available on a given class. I'm having the same issue with generating rdocs. Rdoc knows about attr_accessor, and asks for a description of the attribute as a comment, but it doesn't know about xml_accessor so doesn't show any comments I add to xml_accessor definitions in the generated rdoc. From my testing it seems that RubyMine on rails projects, rather than getting that there is a variable to be accessed from there being an attr_accessor definition, gets it from the fact that there is an entry in schema.rb for an attribute with name X on table Y which corresponds to class Y. It also seems to know about the old style find_by_X_and_Y methods on a class, but I have no idea how it knows about them or if there is just some definition somewhere that says for each attribute in schema.rb also list a find_by_ and a find_all_by method.

Can someone tell me if it should be possible, using specifically formatted comments in my gem code or by writing a simple plugin or whatever, to have RubyMine recognise that xml_accessor X in a class means that it should allow autocompletion of .X and .X= as methods on an instance of that class? if this should be possible, can anyone suggest a good resource to show *how* it should be possible? I've never written a RubyMine/IntelliJ plugin if that is what is required, so i'd need to find the documentation for how one goes about doing that.

Please sign in to leave a comment.