Removing auto-completion for BasicObject

As a developer for the open source Ruby project Calabash used for automated UI-tests of mobile applications, we want to access the public API method through a "scope object", instead of contaminating the main scope using include. For example, we have a method `tap(query)`, that taps a view in the application. The API methods are accessible through an instance `cal`, which inherits from BasicObject.

We want to provide our users will excellent Rubymine support.

We only want the API methods of Calabash to autocomplete, but Rubymine includes Kernel methods, and methods it has added to the BasicObject stub and Object stub.

According to the Ruby documentation, BasicObject should only have 13 methods. I don't understand why Rubymine adds a lot of non-existing methods to a BasicObject instance.

Is there a way of telling Rubymine through comments to remove methods from autocompletion? Or at least move our methods to the top of the autocompletion?

I have attached images of the cal autocomplete, as well as a BasicObject autocomplete.



0

Hello, Tobias,

could you please specify whether you've invoked Completion 2 times or 1 (in case you did it twice then the list will contain methods from BasicObject as well)

0
Avatar
Permanently deleted user

Hi Olga, thank you for your response.

 

I have not invoked auto completion myself, this is the automatic box that appears after the dot.

 

There are essentially two issues IMO:

 - Methods not available for the instance are listed in auto-completion (BasicObject does not have the methods available to Object, it should be a clean slate)

 - Methods are "ranked" strangely. I noticed that methods directly in the class are likely listed in the top of the autocompletion, and with a bold font. Methods from inheritance or inclusion are listed (randomly) somewhere after, *unless* they start with the same words as the method implemented in the class itself.

Here is an example, notice that *send* is listed along the class methods because of the method send_app_to_background.

I think both of these are issues. At least I would like to be able to make Rubymine sort my methods first, even if they were included, or somehow bring them to the top.

0

Hello, Tobias,

thank you for such a detailed answer and please vote for the issue with methods sorting:

https://youtrack.jetbrains.com/issue/RUBY-18891 

As for the BasicObject methods, could you please specify why you think these methods shouldn't be in the list (in case you choose one of them and run the script there will be no exception).

0
Avatar
Permanently deleted user

To confirm, is there currently no way of telling Rubymine how to sort the methods in autocompletion either from comments in the class or perhaps a plugin?

0

@Tobias,

at the moment no, but please vote for that issue (since every vote counts) so that you're notified in case there is any update.

0

请先登录再写评论。