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?
Thanks,
John
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
On 2/14/07, James Edward Gray II james@grayproductions.net wrote:
On Feb 14, 2007, at 7:09 AM, John Tsombakos wrote:
...
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
The two system I tried on did not have Rails in the vendor directory. Should this also auto-complete non-Rails Ruby items too? Because I couldn't get anything there either (started to type the name of one of the methods in the file I had open, hit Opt-Esc, and got "No matches were found"
Thanks,
John
On Feb 14, 2007, at 8:15 AM, John Tsombakos wrote:
On 2/14/07, James Edward Gray II james@grayproductions.net wrote: On Feb 14, 2007, at 7:09 AM, John Tsombakos wrote:
...
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
The two system I tried on did not have Rails in the vendor directory.
I really bet that is it. Try vendering Rails and see if that makes a difference.
Should this also auto-complete non-Rails Ruby items too? Because I couldn't get anything there either (started to type the name of one of the methods in the file I had open, hit Opt-Esc, and got "No matches were found"
Again it "should."
As a simple test, try this:
1. Create a new document 2. Change the document language to Ruby 3. Type Array.new.rev 4. Invoke the auto complete
Does that much work?
If so, you're probably just trying something rcodetools doesn't support. The main thing I've noticed is that I cannot autocomplete implicit receiver instance method calls with it. For example:
class Test def abc "abc" end
def xyz ab # <= this will not autocomplete end end
t = Test.new t.ab # <= this will
__END__
This is just the way rcodetools completion works and if you want to know more about that, you will need to take it up with the author.
James Edward Gray II
On 2/14/07, James Edward Gray II james@grayproductions.net wrote:
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
I tried with a project that had Rails in the vendor directory. When I opened a model file, I tried typing 'validate' and hit opt-esc and it could not find any matches.
As a simple test, try this:
- Create a new document
- Change the document language to Ruby
- Type Array.new.rev
- Invoke the auto complete
Does that much work?
This did work.
On Feb 14, 2007, at 6:21 PM, John Tsombakos wrote:
On 2/14/07, James Edward Gray II james@grayproductions.net wrote:
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
I tried with a project that had Rails in the vendor directory. When I opened a model file, I tried typing 'validate' and hit opt-esc and it could not find any matches.
OK. We seem to be closing in. Let's see if we can keep narrowing it down. Here is a new series of steps to try:
1. Make a brand new Rails project: rails test 2. Edit database.yml so it can hook up to a development database. I just used sqlite3. 3. ruby script/generate model just_one 4. Open then new model file and put the caret in the class definition 5. Type val (or validate if you prefer, I checked both) and trigger rcodetools completion
Note that I *did not* have Rails vendored here and this worked just fine.
Does this much work for you?
James Edward Gray II
On Feb 14, 2007, at 10:43 PM, James Edward Gray II wrote:
On Feb 14, 2007, at 6:21 PM, John Tsombakos wrote:
On 2/14/07, James Edward Gray II james@grayproductions.net wrote:
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
I tried with a project that had Rails in the vendor directory. When I opened a model file, I tried typing 'validate' and hit opt-esc and it could not find any matches.
OK. We seem to be closing in. Let's see if we can keep narrowing it down. Here is a new series of steps to try:
- Make a brand new Rails project: rails test
- Edit database.yml so it can hook up to a development database.
I just used sqlite3. 3. ruby script/generate model just_one 4. Open then new model file and put the caret in the class definition 5. Type val (or validate if you prefer, I checked both) and trigger rcodetools completion
Note that I *did not* have Rails vendored here and this worked just fine.
Does this much work for you?
James Edward Gray II
Woah! That actually works. I never would have thought this thing would be able to handle rails like this. Pure Awesomeness!
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
On Feb 15, 2007, at 2:54 AM, Thomas Aylott (subtleGradient) wrote:
On Feb 14, 2007, at 10:43 PM, James Edward Gray II wrote:
On Feb 14, 2007, at 6:21 PM, John Tsombakos wrote:
On 2/14/07, James Edward Gray II james@grayproductions.net wrote:
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
I tried with a project that had Rails in the vendor directory. When I opened a model file, I tried typing 'validate' and hit opt-esc and it could not find any matches.
OK. We seem to be closing in. Let's see if we can keep narrowing it down. Here is a new series of steps to try:
- Make a brand new Rails project: rails test
- Edit database.yml so it can hook up to a development
database. I just used sqlite3. 3. ruby script/generate model just_one 4. Open then new model file and put the caret in the class definition 5. Type val (or validate if you prefer, I checked both) and trigger rcodetools completion
Note that I *did not* have Rails vendored here and this worked just fine.
Does this much work for you?
James Edward Gray II
Woah! That actually works. I never would have thought this thing would be able to handle rails like this. Pure Awesomeness!
Yeah, now if we can just figure out why it chokes and dies on some Rails projects we will be in business...
James Edward Gray II
On Feb 15, 2007, at 8:04 AM, James Edward Gray II wrote:
Woah! That actually works. I never would have thought this thing would be able to handle rails like this. Pure Awesomeness!
Yeah, now if we can just figure out why it chokes and dies on some Rails projects we will be in business...
I know why it fails on CrazyEgg. It's because of our <CENSORED PROPRIETARY INFORMATION>. The application can't function without it.
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
On Feb 15, 2007, at 9:26 AM, Thomas Aylott (subtleGradient) wrote:
On Feb 15, 2007, at 8:04 AM, James Edward Gray II wrote:
Woah! That actually works. I never would have thought this thing would be able to handle rails like this. Pure Awesomeness!
Yeah, now if we can just figure out why it chokes and dies on some Rails projects we will be in business...
I know why it fails on CrazyEgg. It's because of our <CENSORED PROPRIETARY INFORMATION>. The application can't function without it.
How does your application get this information? I load the Rails stack just as the Rails utility scripts do, so *in theory* if you can use those...
James Edward Gray II
On 2/14/07, James Edward Gray II james@grayproductions.net wrote:
- Make a brand new Rails project: rails test
- Edit database.yml so it can hook up to a development database. I
just used sqlite3. 3. ruby script/generate model just_one 4. Open then new model file and put the caret in the class definition 5. Type val (or validate if you prefer, I checked both) and trigger rcodetools completion
Note that I *did not* have Rails vendored here and this worked just fine.
Does this much work for you?
Nope. Got the "No matches were found" tooltip. :(
On Feb 15, 2007, at 6:58 PM, John Tsombakos wrote:
On 2/14/07, James Edward Gray II james@grayproductions.net wrote:
- Make a brand new Rails project: rails test
- Edit database.yml so it can hook up to a development database. I
just used sqlite3. 3. ruby script/generate model just_one 4. Open then new model file and put the caret in the class definition 5. Type val (or validate if you prefer, I checked both) and trigger rcodetools completion
Note that I *did not* have Rails vendored here and this worked just fine.
Does this much work for you?
Nope. Got the "No matches were found" tooltip. :(
Interesting. Maybe it has trouble with some architectures or (more likely) Ruby environments and has nothing to do with Rails projects.
Sadly, I have to admit that I am about out of good ideas now.
I guess the next step would be to see if you can get rcodetools to work outside of TextMate...
James Edward Gray II
- Make a brand new Rails project: rails test
- Edit database.yml so it can hook up to a development database. I
just used sqlite3. 3. ruby script/generate model just_one 4. Open then new model file and put the caret in the class definition 5. Type val (or validate if you prefer, I checked both) and trigger rcodetools completion
Note that I *did not* have Rails vendored here and this worked just fine.
Does this much work for you?
Nope. Got the "No matches were found" tooltip. :(
Interesting. Maybe it has trouble with some architectures or (more likely) Ruby environments and has nothing to do with Rails projects.
Sadly, I have to admit that I am about out of good ideas now.
I guess the next step would be to see if you can get rcodetools to work outside of TextMate...
In my case, it definitely only works if Rails is frozen in /vendor/rails. I created the fresh project as above and also got the "No matches were found" tooltip. After rake rails:freeze:gems everything works great.
Looking at the code in the Bundle editor, I noticed one thing at the beginning of the Rails detection code:
dir = File.dirname(ENV["TM_FILE_PATH"]) rescue ENV["TM_PROJECT_DIRECTORY"]
Isn't the name of the variable TM_FILEPATH (no 2nd underscore)? But changing this does not change anything on my machine.
Ole
On Mar 9, 2007, at 11:39 AM, Ole Begemann wrote:
Looking at the code in the Bundle editor, I noticed one thing at the beginning of the Rails detection code:
dir = File.dirname(ENV["TM_FILE_PATH"]) rescue ENV ["TM_PROJECT_DIRECTORY"]
Isn't the name of the variable TM_FILEPATH (no 2nd underscore)? But changing this does not change anything on my machine.
It is. Good catch. That should only affect non-projects though.
I'll commit the change though.
James Edward Gray II
Hi,
Anyone else having trouble when using "Find in project", the app locks-up (beach ball)!?
This is obviously due to the projects include binary files. As Borat would have said, But why?
I usually have a bin dir with compiled files without extension.
I always launch Textmate for a project/directory using for instance
cd /Dev/tts/festival mate .
One more thing, maybe not related, but "find again" (cmd-G) is sometimes really slow, but that feels like it is an OS X thing that appears after cmd-tabbing between apps quickly and instantly firing a shortcut in the destination-app.. I've found for instance that cmd- tabbing from Safari to Terminal then immediately pressing arrow up a couple of times (for readline history) makes the Terminal crash. After that impossible to force quit. Is it the os x window server / event model that isn't build for 100% speedy keyboard-commando!??
best David
On 14. Mar 2007, at 23:54, David Eriksson wrote:
Anyone else having trouble when using "Find in project", the app locks-up (beach ball)!?
Yes -- there is a troubleshooting page http://macromates.com/wiki/ Troubleshooting/FindInProject (and things will be improved in the future, but no ETA)
This is obviously due to the projects include binary files. As Borat would have said, But why?
I usually have a bin dir with compiled files without extension.
Without extension, TextMate can’t know if the file is binary or not -- it uses a heuristic, but apparently that fails in your case. Best would be to exclude the folder with the binary files from the project.
One more thing, maybe not related, but "find again" (cmd-G) is sometimes really slow, but that feels like it is an OS X thing that appears after cmd-tabbing between apps quickly and instantly firing a shortcut in the destination-app.. I've found for instance that cmd-tabbing from Safari to Terminal then immediately pressing arrow up a couple of times (for readline history) makes the Terminal crash. After that impossible to force quit. Is it the os x window server / event model that isn't build for 100% speedy keyboard- commando!??
I’ve not heard of this problem. If things are slow after switching app, it could be because you are low on memory, and it has to swap in the switched-to application. But it shouldn’t crash. Is it Terminal or the shell (bash) which crashes?
One more thing, maybe not related, but "find again" (cmd-G) is sometimes really slow, but that feels like it is an OS X thing that appears after cmd-tabbing between apps quickly and instantly firing a shortcut in the destination-app.. I've found for instance that cmd-tabbing from Safari to Terminal then immediately pressing arrow up a couple of times (for readline history) makes the Terminal crash. After that impossible to force quit. Is it the os x window server / event model that isn't build for 100% speedy keyboard-commando!??
I’ve not heard of this problem. If things are slow after switching app, it could be because you are low on memory, and it has to swap in the switched-to application. But it shouldn’t crash. Is it Terminal or the shell (bash) which crashes?
When this happens, and with the apps I'm running I'm not low on memory, ~500MB free (green) memo.
It's the Terminal that crashes, but I can still run say Activity Monitor, but force quit wont work, it looks like it just drops it's parent. After this, other apps that I guess use shell-commands start crashing one after the other..
Have found some other people on div forums that have similar problems . All on Intel... No answers though.
My only solution is to not be so quick on the keyboard, like doing a find, and then cmd-z undo before the find completes. That kind of sequences seem to crash almost any cocoa app...