# Gather autocompletion-information while running tests?

**URL:** <https://www.ruby-forum.com/t/gather-autocompletion-information-while-running-tests/193270>\
**Category:** Ruby\
**Created:** [August 14, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/gather-autocompletion-information-while-running-tests/193270 "2010-08-14T14:59:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Kechel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@Jan\_Kechel](https://www.ruby-forum.com/u/Jan_Kechel)\
**Post date:** [August 14, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/gather-autocompletion-information-while-running-tests/193270/1 "2010-08-14T14:59:39Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: RIPEMD160

Hi everybody,

I was looking around for some autocompletion solution for ruby. Most  
sites tell me that ruby is too dynamic to write any simple IDE  
supporting this.

I came accross the following idea:

Let’s collect the information we need for autocompletion during running  
tests.

Basically we need to know, what variable names in which functions (and  
in which files) are instantiated as what kind of objects.  
Then we could lookup all the available methods of those objects (either  
a static list, or also looked up during the tests running).

Wouldn’t that be a very easy solution for autocompletion? (though not  
100% complete as it won’t work for newly named variables)

The good side-effect would be that from then everyone would have even  
more reasons to write good test coverage 😉

I played around a little with set\_trace\_func, but i’m missing the local  
variablenames here.

Probably the best would be to write a Ruby C extension that creates  
something like (or exactly) ctags file to be interpreted by vim.

What are your thoughts?

Jan Kechel

* * *

[publictimestamp.org/ptb/PTB-9682](http://publictimestamp.org/ptb/PTB-9682) sha224 2010-08-14 12:15:42  
267159826FCA305616B0A8A4DC01999AC0E80150A72CC14E4B668B7C

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBAwAGBQJMZpKEAAoJEI0XMg7eH/Qc6lsP/2usLaEpeiqICD32Ic5g8t2p  
y9i9vwQf7B/Uw1sGcdqYQ5JNV20Dmz2+lDiRCifKO6ndzJcXp3VbJix7+z8/L+fQ  
KdY7E+WpHnFqSa0cQl4b4cVjhIjSUrYv4UselQSkeXKOVO9DQJFXph9S/TZ5/Clx  
0UnMZF4wAnUhkz3k9/HjWA6fx8W6Z2HneLqaOVN8SLU9H+90gdDFfdHOvI30veUt  
5opV6ukJBrqnJrYkvwW1jHuMTHYAjNLCASMg6nYo8eLz/eNPPZmdtBQEtx8dV9Iw  
QqGBt+iTYkin7K3ZPb4h/3iJthYlzd78B9RxLEhxL3pvrWLWL4yxE3sp7Iq+TKeG  
mLdLqMwYNO0Lhcx7fyAD0yuMc7Nm5N4Nv24HV9mUihtrjNUdAKf1Fbjwcu9lUs4Z  
BsO+bll7Svgy6r0s8pXwpOA+6PPgYIRyJaLaMBMr9fQn0lVBK4RsjtF+l6rINiXy  
xeJO3C8U8QXmox/tEUuadR+O3CFeFqvvJ5HQ5vt0uUFOVSS0oAgQgF9S7Afq8EpX  
rjKiw/Dr/avCMGgi3+B/BUmnjFfUB//hXV+oMK/jx+CYamT7lXvMfbemNznIcBr6  
Z8aZs/1hRJzy4XH9SzkTR8ip6dG5+djTNYW/+FDdtG3xJrbQ9YxjoWArRP4FYQr6  
GxZgyCr/FTqkIFkpKHP4  
=t9Jd  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![Jan\_Kechel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@Jan\_Kechel](https://www.ruby-forum.com/u/Jan_Kechel)\
**Post date:** [August 17, 2010, 2:23am UTC](https://www.ruby-forum.com/t/gather-autocompletion-information-while-running-tests/193270/2 "2010-08-17T02:23:02Z")

</div>

> Basically we need to know, what variable names in which functions (and  
> in which files) are instantiated as what kind of objects.  
> Then we could lookup all the available methods of those objects (either  
> a static list, or also looked up during the tests running).
> 
> Wouldn’t that be a very easy solution for autocompletion? (though not  
> 100% complete as it won’t work for newly named variables)

Is static analysis not enough for you?
