r6454 (Ruby)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

r6454 (Ruby)

James Gray-7
Updating to rcodetools 0.4.1.

Changed:
U   trunk/Bundles/Ruby.tmbundle/Support/vendor/rcodetools/CHANGES
U   trunk/Bundles/Ruby.tmbundle/Support/vendor/rcodetools/README
U   trunk/Bundles/Ruby.tmbundle/Support/vendor/rcodetools/Rakefile
U   trunk/Bundles/Ruby.tmbundle/Support/vendor/rcodetools/Rakefile.method_analysis
U   trunk/Bundles/Ruby.tmbundle/Support/vendor/rcodetools/icicles-rcodetools.el
U   trunk/Bundles/Ruby.tmbundle/Support/vendor/rcodetools/rcodetools.el

_______________________________________________
textmate-dev mailing list
[hidden email]
http://lists.macromates.com/mailman/listinfo/textmate-dev
Reply | Threaded
Open this post in threaded view
|

Re: r6454 (Ruby)

James.Strachan
Hi James

James Edward Gray II wrote
Updating to rcodetools 0.4.1.0
I wondered have you figured out yet how to wire rcodetools into TextMate's completion operation? I'm itching to try out its method completion capability from inside TextMate (though am a complete newbie on TextMate so am not sure whats required to hook it up).

James
Reply | Threaded
Open this post in threaded view
|

Re: r6454 (Ruby)

James Gray-7
On Jan 17, 2007, at 7:06 AM, James.Strachan wrote:

>
> Hi James
>
>
> James Edward Gray II wrote:
>>
>> Updating to rcodetools 0.4.1.0
>>
>
> I wondered have you figured out yet how to wire rcodetools into  
> TextMate's
> completion operation? I'm itching to try out its method completion
> capability from inside TextMate (though am a complete newbie on  
> TextMate so
> am not sure whats required to hook it up).

Sorry for the delays.  I'm been pretty darn busy.

I've just checked in a first attempt at this.  My wrapper may not be  
perfect yet, so report problems as you find them.

I've placed the command on option-escape, following Thomas's lead.  I  
assume this new command will eliminate the need for the Ruby  
completion command currently in the Experimental bundle and thus we  
won't have to worry about conflicts.  For now though, you may need to  
have the Experimental bundle disabled to play with this version.

Enjoy.

James Edward Gray II


_______________________________________________
textmate-dev mailing list
[hidden email]
http://lists.macromates.com/mailman/listinfo/textmate-dev
Reply | Threaded
Open this post in threaded view
|

Re: r6454 (Ruby)

James.Strachan

James Edward Gray II wrote
On Jan 17, 2007, at 7:06 AM, James.Strachan wrote:
> Hi James
> James Edward Gray II wrote:
>>
>> Updating to rcodetools 0.4.1.0
>>
>
> I wondered have you figured out yet how to wire rcodetools into  
> TextMate's
> completion operation? I'm itching to try out its method completion
> capability from inside TextMate (though am a complete newbie on  
> TextMate so
> am not sure whats required to hook it up).

Sorry for the delays.  I'm been pretty darn busy.
No worries, I totally understand :)


James Edward Gray II wrote
I've just checked in a first attempt at this.  My wrapper may not be  
perfect yet, so report problems as you find them.

I've placed the command on option-escape, following Thomas's lead.  I  
assume this new command will eliminate the need for the Ruby  
completion command currently in the Experimental bundle and thus we  
won't have to worry about conflicts.  For now though, you may need to  
have the Experimental bundle disabled to play with this version.
AWESOME! You da man!

Its working very nicely. It'd be great if one day we can figure out how to do Java IDE style completion, where you can kinda keep typing and it filters the list (like ajax completion of entry fields in rails); also linking to the documentation like the emacs/vim stuff would rock too - but heck, its already great.

It'd be great if it'd work inside, say, Rails controllers/models too rather than self contained ruby scripts. I wonder if the user is in a Rails project we could switch the 'ruby -I' stuff with 'script/console' (or something like that - maybe a require 'config/boot' or something) so that working on a rails project it would boot up the various rails plugins so that we'd get lovely completion inside controllers & models? Will noodle around and see if I can figure it out...

James
Reply | Threaded
Open this post in threaded view
|

Re: r6454 (Ruby)

James Gray-7
On Jan 18, 2007, at 6:51 AM, James.Strachan wrote:

> Its working very nicely. It'd be great if one day we can figure out  
> how to
> do Java IDE style completion, where you can kinda keep typing and  
> it filters
> the list (like ajax completion of entry fields in rails)

Not quite the same, but you can continue typing when the menu appears  
to select an item.

> It'd be great if it'd work inside, say, Rails controllers/models  
> too rather
> than self contained ruby scripts.

I'm pretty sure I can fix this one.  I just need to detect when the  
file is part of a Rails project and require config/boot.rb.  I'll  
give that a shot today.

James Edward Gray II


_______________________________________________
textmate-dev mailing list
[hidden email]
http://lists.macromates.com/mailman/listinfo/textmate-dev
Reply | Threaded
Open this post in threaded view
|

Re: r6454 (Ruby)

James.Strachan
In reply to this post by James.Strachan
James.Strachan wrote
It'd be great if it'd work inside, say, Rails controllers/models too rather than self contained ruby scripts. I wonder if the user is in a Rails project we could switch the 'ruby -I' stuff with 'script/console' (or something like that - maybe a require 'config/boot' or something) so that working on a rails project it would boot up the various rails plugins so that we'd get lovely completion inside controllers & models? Will noodle around and see if I can figure it out...
I've reached the end of my rcodetools/ruby knowledge unfortunately - but I did figure out how to boot up rails config/environment if it was present and pass it into rcodetools which avoids the error message you get with undefined constants like ActionController or ActiveRecord, though when this is added it seems to stop finding any matches at all :)

I'm attaching it here in case it helps anyone else figure it out...patch.txt

James
Reply | Threaded
Open this post in threaded view
|

Re: r6454 (Ruby)

James.Strachan
James.Strachan wrote
James.Strachan wrote
It'd be great if it'd work inside, say, Rails controllers/models too rather than self contained ruby scripts. I wonder if the user is in a Rails project we could switch the 'ruby -I' stuff with 'script/console' (or something like that - maybe a require 'config/boot' or something) so that working on a rails project it would boot up the various rails plugins so that we'd get lovely completion inside controllers & models? Will noodle around and see if I can figure it out...
I've reached the end of my rcodetools/ruby knowledge unfortunately - but I did figure out how to boot up rails config/environment if it was present and pass it into rcodetools which avoids the error message you get with undefined constants like ActionController or ActiveRecord, though when this is added it seems to stop finding any matches at all :)

I'm attaching it here in case it helps anyone else figure it out...patch.txt
Actually this patch does work when trying completion at the class level! e.g. inside an ActiveRecord::Base you get completion of the various validates_* or act_as_* methods etc. YAY!

Though it doesn't seem to find any completions inside a method declaration (with or without the self. prefix). This appears to be some kind of limitations with rcodetools rather than the TextMate integration (as with further testing, even a vanilla ruby class, you can't seem to access instance methods of a class from inside a method declaration). Even so this is an awesome start!

James
Reply | Threaded
Open this post in threaded view
|

Re: r6454 (Ruby)

James Gray-7
On Jan 18, 2007, at 8:39 AM, James.Strachan wrote:

>
>
> James.Strachan wrote:
>>
>>
>> James.Strachan wrote:
>>>
>>> It'd be great if it'd work inside, say, Rails controllers/models too
>>> rather than self contained ruby scripts. I wonder if the user is  
>>> in a
>>> Rails project we could switch the 'ruby -I' stuff with 'script/
>>> console'
>>> (or something like that - maybe a require 'config/boot' or  
>>> something) so
>>> that working on a rails project it would boot up the various rails
>>> plugins so that we'd get lovely completion inside controllers &  
>>> models?
>>> Will noodle around and see if I can figure it out...
>>>
>>
>> I've reached the end of my rcodetools/ruby knowledge unfortunately  
>> - but I
>> did figure out how to boot up rails config/environment if it was  
>> present
>> and pass it into rcodetools which avoids the error message you get  
>> with
>> undefined constants like ActionController or ActiveRecord, though  
>> when
>> this is added it seems to stop finding any matches at all :)
>>
>> I'm attaching it here in case it helps anyone else figure it out...
>> http://www.nabble.com/file/5703/patch.txt patch.txt
>>
>
> Actually this patch does work when trying completion at the class  
> level!
> e.g. inside an ActiveRecord::Base you get completion of the various
> validates_* or act_as_* methods etc. YAY!

I just committed a patch inspired by your own.  Rails support should  
be working now.

James Edward Gray II

_______________________________________________
textmate-dev mailing list
[hidden email]
http://lists.macromates.com/mailman/listinfo/textmate-dev