Make emacs autocomplete Ruby methods

Is there a way to get emacs to pull out autocomplete ruby ​​methods like Eclipse and NetBeans do? That is, if I type a file. and press CTRL space in Eclipse. I will get a list of file methods. Same thing with variables. I installed the plugin autocomplete, ruby-mode, rinari and cedet, but so far it fills in the local names of variables and methods, but it will not be native.

+4
source share
3 answers

I think you need something like RSense . You may also like the more general automatic full mode .

+8
source

I am not familiar with ruby, but if by "native methods" you mean material in some kind of system library, there are several CEDET extension options for doing this work.

If there are ruby ​​files somewhere that have all this code, and if ruby ​​supports some kind of "include" or "import" statement, you need to add this location to the include path for ruby. This probably requires changing the ruby ​​source code to add a new path to the system. You can see examples in semantic-c.el. You may also need to override the semantic-tag-include-filename function to convert include to findable filename.

If not, and there is only some kind of ruby ​​interpreter that knows all this, then you will need to create a complete ruby ​​“all-knowing” database similar to semanticdb-el.el. He will need a way to query ruby ​​for different things and return them as responses.

Any such improvements would be welcome in the ruby ​​support for the CEDET contrib.

+2
source

Ruby is an interpreted language, which makes it difficult to perform certain functions, such as autocomplete. How do you know what an object type is if it is not defined? Therefore, turnkey solutions are limited or non-existent. Even autocomplete in Netbean / Eclipse will only work on class methods (if I'm not mistaken).

0
source

Source: https://habr.com/ru/post/1307207/


All Articles