[TxMt] Ruby Auto Complete Not working?

James Edward Gray II james at grayproductions.net
Wed Feb 14 13:59:52 UTC 2007


On Feb 14, 2007, at 7:09 AM, John Tsombakos wrote:

> I just updated to the latest cutting edge version, and updated my
> bundles. I wanted to try the Ruby auto complete, but either I'm doing
> something wrong, or it just doesn't work.
>
> No matter what I try to type, all I get is a tooltip saying "No
> matches were found". In a Ruby/Rails document, I start typing
> 'validates' (without the quotes, obviously) and hit Option Escape and
> get No Matches were found.
>
> Is there something else I need to do to get this working?

I just opened a Rails model, typed val, and triggered the command.  I  
did get a menu of the validation methods.  So it seems to work at  
least some of the time.

That said, you are not the first user to report problems using the  
command in Rails projects.  Apparently my Rails support is not perfect.

Rails is a big stack and there's a whole lot that can go wrong when  
loading it for something like this.  Because of that, it's very hard  
for me to troubleshoot these issues.

Instead, I'll explain how the command handles Rails.  To figure out  
if it is in a Rails project, it walks backwards in the directory tree  
from the current open file looking for a config directory with an  
environment.rb file in it.  When it finds that, it requires config/ 
environment.rb as it hands your code off to rcodetools.  This  
"should" load the full Rails stack, much like script/console does.   
If this process somehow fails though, you would probably get an empty  
list for completions.

Ah, that just gave me an idea...

Do you have Rails in the vendor directory of your project?  I always  
do and would not be at all surprised if that is required to make the  
command pick up on the methods.  If you don't, try vendering Rails  
and see if that helps.

James Edward Gray II




More information about the textmate mailing list